Design quality report – PicInfo sample application
Source file size
| Source file size | Minimum | Maximum | Average | 
|---|---|---|---|
| Source lines (LINES) | 50 | 249 | 145 | 
| Lines of code (LLOC) | 13 | 144 | 74 | 
| Procedures | 4 | 7 | 5.8 | 
| Kilobytes | 2 | 10 | 5.6 | 
LINES = Total number of physical source lines.
LLOC = Logical lines of code, excluding whitespace and comments.
Procedure length
| Lines of code (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 | 1 | 4% | ** | 
| Total procedures | 26 | 100% | |
| Longest procedure | 80 | lines | |
| Average procedure | 9.7 | lines | 
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 = Number of decisions + 1 | 
| Total complexity | 44 | TCC = Total number of decisions + 1 | 
| Decision density | 0.27 | DECDENS = CC/LLOC, complexity per 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.
Nesting of conditional statements
| Nesting depth | Procs | % | Description | 
|---|---|---|---|
| 0 | 12 | 46% | No conditional statements in procedure | 
| 1 | 11 | 42% | Conditional statements not nested | 
| 2–5 | 3 | 12% | Conditional statements nested moderately | 
| 6– | 0 | 0% | Deeply nested complex procedure | 
| Total | 26 | 100% | |
| Max depth | 5 | Most deeply nested procedure | 
Depth of conditional statement nesting in procedure (DCOND). Recommended: 0–5.
Structural fan-in and internal reuse
| SFIN | Procs | % | Description | 
|---|---|---|---|
| 0–1 | 28 | 97% | No reuse | 
| 2–4 | 1 | 3% | Slight reuse | 
| 5–9 | 0 | 0% | Significant reuse | 
| 10– | 0 | 0% | High reuse | 
| Total | 29 | 100% | |
| Maximum SFIN | 2 | Most reused procedure | |
| Average SFIN | 0.7 | 
Structural fan-in (SFIN) = number of procedures that call this procedure.
Higher values indicates more internal reuse of code.
Understandability
Comments
| 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% | |
| Commented-out code | |||
| Comments with commented-out code | 1 | 0% | approximate | 
| Other comments | 230 | 100% | approximate | 
| All comments | 231 | 100% | |
| Comment density | |||
| Meaningful comments per code line | 60% | MCOMM% = MCOMM/LLOC | 
| Meaningful comments in proc | Procs | % | Distribution | 
|---|---|---|---|
| 0 (uncommented procedure) | 1 | 4% | ** | 
| 1–2 | 11 | 42% | ******************** | 
| 3–5 | 9 | 35% | **************** | 
| 6–9 | 0 | 0% | |
| 10–30 | 5 | 19% | ********* | 
| Total procedures | 26 | 100% | |
| Average MCOMM | 5.4 | Average meaningful comments/procedure | 
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.
Naming
| Total number of names | 168 | |
| Unique names | 144 | |
| Name uniqueness ratio UNIQ | 86% | 
| Average name length | Chars | Details | 
|---|---|---|
| Procedure names (LENP) | 10.9 | excl. event handlers/implements procs | 
| Variables names (LENV) | 9.3 | variables and parameters | 
| • Global and module-level | 10.8 | |
| • Local variables | 7.9 | |
| • Parameters | 9.4 | excl. event handler/implements params | 
| Constant names (LENC) | 16.1 | excl. enum and compiler constants | 
| Enum constant names | 16.4 | |
| Control names | 6.7 | |
| Other names | 10.4 | |
| All names (LEN) | 11.3 | Average length of names | 
| Name length | % | Distribution | 
|---|---|---|
| 1 | 1% | |
| 3 | 1% | |
| 4–6 | 17% | ************* | 
| 7–9 | 27% | ******************** | 
| 10–14 | 27% | ******************** | 
| 15–19 | 17% | ************ | 
| 20–24 | 11% | ******** | 
Line length and whitespace
| Line length | Lines | Distribution | ||
|---|---|---|---|---|
| 0 | 173 | ****************** | ||
| 01–19 | 114 | ************ | ||
| 20–39 | 190 | ******************** | ||
| 40–59 | 129 | ************** | ||
| 60–79 | 71 | ******* | ||
| 80–99 | 26 | *** | ||
| 100–119 | 11 | * | ||
| 120–139 | 5 | * | ||
| 140–159 | 2 | |||
| 160–179 | 1 | |||
| 180–199 | 1 | |||
| 200–296 | 2 | |||
| Total lines | 725 | 
| Average line | 32 | characters | 
| Longest line | 296 | characters | 
| Length >80 | 45 | 6% of lines | 
| Length >132 | 7 | 1% of lines | 
Line length is visible length of physical lines.
Indentation is included in length but trailing spaces are not.
Whitespace
| Blank lines | 24% | |
| Non-blank | 76% | |
| Whiteness | 66% | 
Whiteness means blank lines, indentation and unused space after end-of-line.
Assumption: Code is viewed with a fixed-pitch font at a width of 80 characters.
Indentation
Of all non-blank lines, 45% are indented.Average indentation: 3 spaces.
Maximum indentation: 28 spaces.
Tab stops
________________________________________________________________________________
          10        20        30        40        50        60        70        
0123456789|123456789|123456789|123456789|123456789|123456789|123456789|123456789
+ · +   +   +   ·   +   ·   ·                                                   
________________________________________________________________________________
+ = common tab stop
· = uncommon tab stop, less than 1.00% of lines
  = no tab stop here
Most likely tab width: 4
Object-orientedness
| Object-orientedness of code | 59% | (executable statements) | 
| Object-orientedness of data | 91% | (variables) | 
Object-orientedness is the relative amount of code or data in class-like modules.
OO code or data found in: 2 Classes and 1 Form.
Non-OO code or data found in: 1 standard 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 summary | Value | 
|---|---|
| Problems reported | 46 | 
| Problems/line of code (LLOC) | 0.1 | 
| Problems/procedure | 1.6 | 
Filter: <Default>
Quality assessment
| Quality (0-10) | Level | Based on | 
|---|---|---|
| Complexity | 8.6 | Cyclomatic complexity | 
| Internal reuse | 0.9 | Structural fan-in | 
| Understandability | 9.3 | Comments and name lengths | 
| Dead code | 8.8 | Overall deadness | 
| 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: MCOMM% (20% represents level 8) and LEN (10.0 is level 8)