
264
|
Chapter 7, Help and Research
#66 Generate Statistics on Your C# Code
HACK
Study the Report
After analyzing either a Visual Studio Project or Solution, devMetrics dis-
plays the resulting project report (see Figure 7-37). This report lists each C#
Project analyzed, along with the following metrics:
Files
The number of C# files in the project.
Types
The number of classes, interfaces, and structures in the project.
Members
The number of fields, properties, events, methods, and constructors.
Lines
The total number of lines of code in the project, including blank lines
and comments.
Statements
The total number of statements in the project.
Average and maximum code complexity
devMetrics uses the cyclomatic code complexity algorithm as defined
by the Software Engineering Institute (see http://www.sei.cmu.edu/str/
descriptions/cyclomatic_body.html). The complexity is a measure of
linearly independent paths through a program module and is calcu-
lated for each member that contains statements. The code complexity
measurement results in a numerical evaluation, with lower values
meaning less complex code. The maximum code complexity is the
highest complexity value for all members in the project; the average
code complexity is the average complexity of all members.
In addition to showing these metrics for each project, the project report also
displays a summary row.
As Figure 7-37 shows, the name of each project