Project Analyzer

Design quality report - PicInfo sample application

Source file size

Size metric Average Minimum Maximum
Source lines/file (LINES) 145 50 249
Code lines/file (LLOC) 74 13 144
Procedures/file 5.8 4 7
Kilobytes/file 5.6 1.9 10.2

LINES = Total number of physical source lines.
LLOC  = Logical lines of code, excluding whitespace and comments.

Procedure length

Code lines (LLOC) Procs % Distribution
1-4 12 46% *********
5-9 9 35% *******
10-14 1 4% *
15-19 1 4% *
20-39 2 8% **
40-59 0 0%  
60-79 0 0%  
80-80 1 4% *
Total procedures 26 100%
 
Longest procedure 80    
Average procedure 9.7    

LLOC  = Logical lines of code, excluding whitespace and comments.

Procedure complexity

Cyclomatic complexity

Complexity Procs % Description
1- 4 24 92% Simple procedure
5-10 1 4% Well structured, stable
11-20 0 0% More complex
21-50 1 4% Complex, alarming
51- 0 0% Error-prone, troublesome
Total 26 100%

Cyclomatic complexity (CC) = Number of decisions + 1. Recommended: 1-10.

Average complexity 2.65 CC
Total complexity 44 TCC = Total number of decisions + 1
Decision density 0.27 DECDENS = CC/LLOC, complexity per a line of code
Bad fix probability 10% Crude estimate

Bad fix probability:
Probability of introducing a new error while trying to fix a previous error.

Depth of conditional nesting

DCOND = Maximum nested conditional statements in procedure.

Maximum DCOND 5 Most complex procedure found
Maximum recommended 5 Procedure should not exceed this value
DCOND too high (>5) 0 procedures (0%)
Average DCOND 0.8

Other procedural complexity values

Average SFOUT 0.81 Structural fan-out
Average DLOOPS 0.00 Depth of looping
Average IFIN 2.42 Informational fan-in
Average IFIOUT 1.35 Informational fan-out

Structural fan-in and internal reuse

SFIN Procs % Distribution
0-1 No reuse 28 97% *******************
2-4 Slight reuse 1 3% *
5-9 Significant reuse 0 0%  
10- High reuse 0 0%  
Average: 0.7

Structural fan-in (SFIN) = number of calling procedures.

Understandability

Comments and whitespace

Logical lines      
Lines of code (LLOC) 371 52%
Lines of comment (LLOC') 173 24%
Lines of whitespace (LLOW) 173 24%
Total logical lines (LLINES) 717 100%
 
Comment types
Full-line comments 173 75%
End-of-line comments 58 25%
All comments 231 100%
 
Comment contents
Meaningful comments (MCOMM) 224 97%
Meaningless comments 7 3%
All comments 231 100%
 
Comment density
MCOMM per code line (MCOMM%) 60%   MCOMM/LLOC

Logical line: Lines continued on several lines are counted as one logical line.
Lines excluded by conditional compilation are not included in the logical line counts.
A meaningful comment contains text rather than just whitespace or punctuation.

Meaningful comments (MCOMM) Procs % Distribution
0 1 4% *
1-2 11 42% ********
3-5 9 35% *******
6 or more 5 19% ****
Total procedures 26 100%
Average MCOMM 5.4

Length of names

Average length of names LEN 11.3  
Procedure names LENP 10.9 (excl. event handlers/implements procs)
Variable names LENV 9.3 (excl. event handler/implements params)
Constant names LENC 16.1 (excl. enum and compiler constants)
Control names 6.7
Type/Enum names 12.1 (incl. enum constants and type fields)

Name length % Distribution
1 1%  
2 0%  
3 1%  
4 -6 17% ***
7 -9 27% *****
10-14 27% *****
15-19 17% ***
20-24 11% **

Number of names

Total names 167  
Unique names 143
Name uniqueness ratio UNIQ 86%

Object-orientedness

Object-orientedness of code 59% (executable statements)
Object-orientedness of data 91% (variables)

OO code or data found in: 2 Classes and 1 Form.
Non-OO code or data found in: 1 Module.

Problems

Dead code Problematic Total %
Dead procedures 3 29 10%
Removable code lines in procs 11 254 4%
Dead variables 2 25 8%
Dead constants 2 20 10%
Dead Types 0 6 0%
Dead Enums 0 2 0%
Overall deadness     5%

Dead code counts do not include exposed code.

Problems with declarations Problematic Total %
Missing variable type 0 25 0%
Excess var/const scope 0 45 0%
No var/const scope 0 45 0%
Missing ByVal/ByRef 0 37 0%
Missing function type 0 21 0%
Excess procedure scope 1 29 3%
No procedure scope 0 29 0%

Problem statistics

Filter: <Default>
Problems reported 45
Lines of code (LLOC) 371
Source procedures 29
Problems / LLOC 0.1
Problems / procedure 1.6

Quality assessment

Quality (0-10) Level Based on
Complexity 8.6 Cyclomatic complexity
Dead code 8.8 Overall deadness
Internal reuse 0.9 Structural fan-in
Understandability 9.6 Comments and name lengths
Overall quality level 7.0 Good

Quality levels:
0..4 = Questionable, 5..6 = Moderate, 7..8 = Good, 9..10 = Excellent

Quality levels are based on:
Complexity: Bad fix probability (5% is best, 40% or above is worst)
Dead code: Overall deadness (0% is best, 40% or above is worst)
Internal reuse: Amount of procedures reused (30% represents level 8)
Understandability: Average of MCOMM% (20% represents level 8) and LEN (10.0 is level 8)