Code Metrics inside Visual Studio 2022

In the last days I was curious about how many lines of code I have written in my last product called Red Origin.
I forgot Visual Studio (even the Community Edition) has a built-in feature called Code Metrics.

From the menu “Analyze” -> “Calculate C…

In the last days I was curious about how many lines of code I have written in my last product called Red Origin.
I forgot Visual Studio (even the Community Edition) has a built-in feature called Code Metrics.

From the menu “Analyze” -> “Calculate Code Metrics“, you can view calculate and see the metrics.

Code Metrics menu

After a few seconds, a new window will open in the bottom area of Visual Studio with a lot of numbers in a table.

Code Metrics numbers

What you can see very quickly are the lines of code metrics.
The line of Source code is the number of all lines of code in your project with spaces, blank lines and similar.
Lines of executable code are the effective executable lines of code.
This number is definitely much smaller than the last one.

There are other metrics present in the report:

  • Maintainability Index: Calculates an index value between 0 and 100 that represents the relative ease of maintaining the code. A high value means better maintainability.
  • Cyclomatic Complexity: Measures the structural complexity of the code.
  • Depth of Inheritance: Indicates the number of different classes that inherit from one another, all the way back to the base class.
  • Class Coupling: Measures the coupling to unique classes through parameters, local variables, return types, method calls, generic or template instantiations, base classes, interface implementations, fields defined on external types, and attribute decoration.

If you want to know more about Code Metrics, you can follow this link for the official documentation.


Print Share Comment Cite Upload Translate
APA
Emanuele Bartolesi | Sciencx (2024-03-28T10:42:56+00:00) » Code Metrics inside Visual Studio 2022. Retrieved from https://www.scien.cx/2022/11/11/code-metrics-inside-visual-studio-2022/.
MLA
" » Code Metrics inside Visual Studio 2022." Emanuele Bartolesi | Sciencx - Friday November 11, 2022, https://www.scien.cx/2022/11/11/code-metrics-inside-visual-studio-2022/
HARVARD
Emanuele Bartolesi | Sciencx Friday November 11, 2022 » Code Metrics inside Visual Studio 2022., viewed 2024-03-28T10:42:56+00:00,<https://www.scien.cx/2022/11/11/code-metrics-inside-visual-studio-2022/>
VANCOUVER
Emanuele Bartolesi | Sciencx - » Code Metrics inside Visual Studio 2022. [Internet]. [Accessed 2024-03-28T10:42:56+00:00]. Available from: https://www.scien.cx/2022/11/11/code-metrics-inside-visual-studio-2022/
CHICAGO
" » Code Metrics inside Visual Studio 2022." Emanuele Bartolesi | Sciencx - Accessed 2024-03-28T10:42:56+00:00. https://www.scien.cx/2022/11/11/code-metrics-inside-visual-studio-2022/
IEEE
" » Code Metrics inside Visual Studio 2022." Emanuele Bartolesi | Sciencx [Online]. Available: https://www.scien.cx/2022/11/11/code-metrics-inside-visual-studio-2022/. [Accessed: 2024-03-28T10:42:56+00:00]
rf:citation
» Code Metrics inside Visual Studio 2022 | Emanuele Bartolesi | Sciencx | https://www.scien.cx/2022/11/11/code-metrics-inside-visual-studio-2022/ | 2024-03-28T10:42:56+00:00
https://github.com/addpipe/simple-recorderjs-demo