This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Emanuele Bartolesi
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.
After a few seconds, a new window will open in the bottom area of Visual Studio with a lot of numbers in a table.
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.
This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Emanuele Bartolesi
Emanuele Bartolesi | Sciencx (2022-11-11T20:28:04+00:00) Code Metrics inside Visual Studio 2022. Retrieved from https://www.scien.cx/2022/11/11/code-metrics-inside-visual-studio-2022/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.