Free VB code analysis service: Sample report

This is a sample report of the free code analysis service for Visual Basic.

The actual report contents may vary a little depending on the current Project Analyzer version. These reports were generated from the 36-module sample application VisData.vbp that came with Visual Basic 6.0.

  • Summary report with information on the total size of your code, such as the number of lines and procedures.
  • Design quality report with information on the amount of dead code, problems, commentation, internal reuse, procedure lengths and other quality aspects.
  • Dead code statistics listing the amount and types of dead code in your program.
  • Problem statistics summarizing the problems found in code review.
  • File dependency tree, listing "file depends on" information for all files.

Summary report - VisData

System summary

Projects 1  
Total files 84
Source files 36
Source lines (LINES) 10732
System size Medium
VB version(s) VB6

Source lines (LINES): Total physical source lines.

Total size

Logical lines    
Lines of code (LLOC) 8219 77%
Lines of comment (LLOC') 806 8%
Lines of whitespace (LLOW) 1653 15%
Total logical lines (LLINES) 10678 100%
   
Physical lines    
Lines excluded by #If/#Else 0 0%
Lines active (not excluded) 10732 100%
Total physical lines (LINES) 10732 100%
     
Kilobytes    
Source size 486 kB
Binary property (frx) files 29 kB
 
Work effort estimate
Lines developed 10732
Man-months 5

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.
Man-months: 100 lines/day.

Files

Total files 84  
Source files 36
Other files 48
 
File types 84
Binary Property Files 33
Classes 1
Forms 34
Libraries (Controls) 4
Libraries (Declared) 3
Libraries (Referenced) 6
Modules 1
Project Files 1
Project Workspaces 1
 
Source file last modified Files
Total source files 36
Modified in 1998 36
Modified today 0 0%
Modified in 7 days 0 0%
Modified in 30 days 0 0%
Modified in 365 days 0 0%
Older than 10 years 36 100%

Newest source file is from 25.6.1998. It is 16.6 years old.
Oldest source file is from 4.6.1998. It is 16.7 years old.
Average source file is 16.7 years old.

Before the latest changes of 25.6.1998, the code was changed on 4.6.1998.
The biggest save date was 4.6.1998, when 34 source files were saved.

Source file last modified Files Distribution
Monday 0  
Tuesday 0  
Wednesday 0  
Thursday 36 ********************
Friday 0  
Saturday 0  
Sunday 0  
   
00:00 - 02:59 0  
03:00 - 05:59 0  
06:00 - 08:59 0  
09:00 - 11:59 0  
12:00 - 14:59 0  
15:00 - 17:59 0  
18:00 - 20:59 0  
21:00 - 23:59 36 ********************

Forms and controls

Forms (max 230) 34  
Controls 558

Procedures

Total procedures 459  
Source procedures 459
Binary procedures 0
   
Source procedures 459
Sub 423
Function 29
Declare Sub/Function 7
   
Source procedures 459
Private 374
Public 85
 
Source procedures 459
Dead procedures 9
Live procedures 450

Dead procedures include ones that are called by other dead procedures
and may also include exposed procedures.

Variables and constants

Total Variables Constants
Source 693 516
Binary 0 0
     
Scope Variables Constants
Global 45 49
Module-level 60 465
Local 350 2
Parameters 238  
Total (source) 693 516
     
Dead/Live Variables Constants
Dead 67 12
Live 626 504
Total (source) 693 516

Dead variables/constants may include exposed ones.

Other declarations

Enums 1  
Enum constants 15
Compiler constants 0
Line labels 157
Line numbers 0

Declarations counted in source files only.



Project Analyzer v10.2 VisData v6.0.8175

Design quality report - VisData

Source file size

Size metric Average Minimum Maximum
Source lines/file (LINES) 298 30 2437
Code lines/file (LLOC) 228 22 1791
Procedures/file 12.8 3 67
Kilobytes/file 13.5 2.8 76.1

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 134 30% ******
5-9 115 25% *****
10-14 59 13% ***
15-19 22 5% *
20-39 77 17% ***
40-59 23 5% *
60-79 11 2%  
80-99 4 1%  
100-163 7 2%  
Total procedures 452 100%
 
Longest procedure 163    
Average procedure 16.7    

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

Procedure complexity

Cyclomatic complexity

Complexity Procs % Description
1- 4 368 81% Simple procedure
5-10 54 12% Well structured, stable
11-20 23 5% More complex
21-50 7 2% Complex, alarming
51- 0 0% Error-prone, troublesome
Total 452 100%

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

Average complexity 3.42 CC
Total complexity 1096 TCC = Total number of decisions + 1
Decision density 0.21 DECDENS = CC/LLOC, complexity per a line of code
Bad fix probability 8% 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 1.0

Other procedural complexity values

Average SFOUT 0.97 Structural fan-out
Average DLOOPS 0.16 Depth of looping
Average IFIN 2.24 Informational fan-in
Average IFIOUT 1.56 Informational fan-out

Structural fan-in and internal reuse

SFIN Procs % Distribution
0-1 No reuse 411 90% ******************
2-4 Slight reuse 35 8% **
5-9 Significant reuse 5 1%  
10- High reuse 0 0%  
Average: 1.0

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

Understandability

Comments and whitespace

Logical lines      
Lines of code (LLOC) 8219 77%
Lines of comment (LLOC') 806 8%
Lines of whitespace (LLOW) 1653 15%
Total logical lines (LLINES) 10678 100%
 
Comment types
Full-line comments 806 84%
End-of-line comments 158 16%
All comments 964 100%
 
Comment contents
Meaningful comments (MCOMM) 746 77%
Meaningless comments 218 23%
All comments 964 100%
 
Comment density
MCOMM per code line (MCOMM%) 9%   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 258 57% ***********
1-2 112 25% *****
3-5 52 12% **
6 or more 30 7% *
Total procedures 452 100%
Average MCOMM 1.5

Length of names

Average length of names LEN 8.3  
Procedure names LENP 11.9 (excl. event handlers/implements procs)
Variable names LENV 6.8 (excl. event handler/implements params)
Constant names LENC 7.2 (excl. enum and compiler constants)
Control names 10.4
Type/Enum names 12.3 (incl. enum constants and type fields)

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

Number of names

Total names 1642  
Unique names 978
Name uniqueness ratio UNIQ 60%

Object-orientedness

Object-orientedness of code 78% (executable statements)
Object-orientedness of data 54% (variables)

OO code or data found in: 1 Class and 34 Forms.
Non-OO code or data found in: 1 Module.

Problems

Dead code Problematic Total %
Dead procedures 7 459 2%
Removable code lines in procs 56 7553 1%
Dead variables 66 455 15%
Dead constants 12 516 2%
Dead Enums 0 1 0%
Overall deadness     2%

Dead code counts do not include exposed code.

Problems with declarations Problematic Total %
Missing variable type 0 455 0%
Excess var/const scope 9 971 1%
No var/const scope 511 971 53%
Missing ByVal/ByRef 76 238 32%
Missing function type 2 36 6%
Excess procedure scope 47 459 10%
No procedure scope 76 459 17%

Naming standards Problematic Total %
NameCheck failures 970 2229 44%

Problem statistics

Filter: <Strict - Show all problems>
Problems reported 4805
Lines of code (LLOC) 8219
Source procedures 459
Problems / LLOC 0.6
Problems / procedure 10.5

Quality assessment

Quality (0-10) Level Based on
Complexity 9.2 Cyclomatic complexity
Dead code 9.6 Overall deadness
Internal reuse 2.8 Structural fan-in
Understandability 5.0 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)



Project Analyzer v10.2 VisData v6.0.8175

Dead code statistics - VisData

Procedures

Summary Procedures % LINES LLOC
Dead procedures (certain, not exposed) 7 2% 86 56
Dead procedures (uncertain, exposed) 2 0% 48 27
Live procedures 450 98% 9697 7470
All procedures 459 100% 9831 7553
Dead code by subtype
-Dead 6 1% 82 53
-Dead but exposed 2 0% 48 27
-Dead - KeyPreview = False 1 0% 4 3

Modules

Summary Modules % LINES LLOC
Dead modules 0 0% 0 0
Live modules 36 100% 10732 8219
All modules 36 100% 10732 8219

Variables

Summary Variables %
Dead variables 66 15%
Live variables 389 85%
All variables 455 100%
Dead code by subtype
-Dead 54 12%
-Written only 10 2%
-Read only 2 0%

Constants

Summary Constants %
Dead constants 12 2%
Live constants 504 98%
All constants 516 100%
Dead code by subtype
-Dead 11 2%
-Users dead 1 0%

Parameters

Summary Parameters %
Dead parameters 1 0%
Live parameters 237 100%
All parameters 238 100%
Dead code by subtype
-Dead 1 0%

Enums

Summary Enums %
Dead enums 0 0%
Live enums 1 100%
All enums 1 100%

Enum constants

Summary Enum const %
Dead enum constants 0 0%
Live enum constants 15 100%
All enum constants 15 100%



Project Analyzer v10.2 VisData v6.0.8175

Problem statistics - VisData

Problem Count Type
ADO required for data binding in VB.NET 1 .NET
As New doesn't auto-instantiate if object released in VB.NET 3 .NET
Assigned object not used 1 Logic
Assigned value not used 3 Logic
Assignment to self 3 Func
ByRef parameter read only, consider ByVal 57 Style
ByRef parameter returns a value 5 Style
ByVal/ByRef missing 76 Style
Call statement found 18 Style
Case branch(es) missing for Enum 3 Logic
Case Else missing 19 Logic
Consider short-circuited logic 78 Opt
Consider using Image control 3 Opt
Constant available 2 Opt
Constant declared in code 1 Style
Constant missing type declaration 513 Style
Constant users all dead 1 Dead
Control not enabled 13 Dead
Control not visible 5 Dead
Control unsupported by VB.NET 1 .NET
Cyclomatic complexity exceeds limit 22 Metr
DDE unsupported by VB.NET 1 .NET
Dead constant 11 Dead
Dead parameter 1 Dead
Dead procedure/declaration/event 7 Dead
Dead variable 54 Dead
Default button missing 7 Func
Default control name 7 Style
Delayed error handling 46 Func
Dollar would increase performance 108 Opt
Drag-and-drop requires rewrite for VB.NET 1 .NET
Empty block 14 Logic
Encapsulate non-private variable as property 11 Style
End statement found 2 Func
Error handler missing 268 Func
Event behavior changes in VB.NET 4 .NET
Excess scope 56 Style
Exit statement found 12 Style
Exit Sub|Function|Property found 43 Style
Fixed-length string used 2 Style
Function missing type declaration 2 Style
Global variable found 45 Style
GoTo statement found 10 Style
Hotkey conflict 6 Func
Hotkey missing 76 Func
IIf function found 25 Style
Informat'l complexity exceeds limit 27 Metr
Informat'l fan-in x fan-out exceeds limit 11 Metr
Line too long 3 Style
Lines of code exceed file limit 4 Metr
Lines of code exceed proc. limit 18 Metr
Literal "" found 11 Opt
Local variable not cleared 6 Style
Magic decimal number found 10 Style
Magic hex number found 2 Style
Magic number found 411 Style
Multiple statements on line 1 Style
NameCheck 970 Style
Object variable declared As New 7 Opt
Option Explicit Off 1 Style
Parameter not cleared 1 Style
Parameter with generic type 8 Style
Pass ByRef 13 Style
Possibly twisted tab order 10 Func
Return value discarded 1 Dead
Rewrite Sub as Function 1 Style
ScaleMode must be vbTwips for VB.NET 9 .NET
Scope declaration missing 587 Style
Short name 75 Style
Single-line If..Then statement found 123 Style
Too many uncommented lines 50 Style
Trailing comment found 158 Style
TTF/OTF fonts required by VB.NET 17 .NET
Type unsupported by VB.NET 2 .NET
Uncommented procedure 256 Style
Unicode function is faster 2 Opt
Unreachable code found 1 Logic
Variable clearing violation 2 Style
Variable clearing violation 4 Style
Variable declared in code 268 Style
Variable read before written (along some path) 37 Logic
Variable read, not written 2 Dead
Variable with generic type 10 Style
Variable written, not read 10 Dead
Variable/parameter/constant with type character 18 Style
While loop found 11 Style
     
Type Count  
Optimization 211  
Style 3872  
Functionality 418  
Logic 78  
VB.NET Compatibility 39  
Dead code 105  
Metrics 82  
Total 4805  
Problems/logical code line 0,58  

Filter: <Strict - Show all problems>




Project Analyzer v10.2 VisData v6.0.8175

File dependency tree - VisData

frmMDI
 modVisData  tree deepens
 frmTblStruct  tree deepens
 frmDatabase
   modVisData  tree deepens
   frmMDI  recursive
 frmSQL
   modVisData  tree deepens
   frmDatabase
     modVisData  tree deepens
     frmMDI  recursive
 frmProperty
 frmQuery  tree deepens
 frmAboutBox
 frmODBCLogon  tree deepens
 frmLogin
   modVisData  tree deepens
 frmAttachments
   frmNewAttach
     modVisData  tree deepens
     frmAttachments  recursive
   modVisData  tree deepens
 frmGroupsUsers  tree deepens
 VisDataClass
   modVisData  tree deepens
   frmMDI  recursive
 frmDFD
   modVisData  tree deepens
   VisDataClass
     modVisData  tree deepens
     frmMDI  recursive
 frmCopyStruct
   modVisData  tree deepens
 frmImpExp  tree deepens
 frmReplace
   modVisData  tree deepens

modVisData
 odbc32
 kernel32
 user32
 VisDataClass
   modVisData  recursive
   frmMDI  tree deepens
 frmMDI  tree deepens
 frmDataControl
   modVisData  recursive
   frmDataCtlProp
     modVisData  recursive
 frmDynaSnap  tree deepens
 frmTableObj  tree deepens
 frmDatabase
   modVisData  recursive
   frmMDI  tree deepens
 frmSQL
   modVisData  recursive
   frmDatabase
     modVisData  recursive
     frmMDI  tree deepens
 frmDataGrid
   modVisData  recursive
 frmErrors
   modVisData  recursive
 frmDBPWD
   modVisData  recursive
 frmExpName
   modVisData  recursive
 frmImpExp  tree deepens

VisDataClass
 modVisData  tree deepens
 frmMDI  tree deepens

frmAboutBox

frmAddField
 modVisData  tree deepens
 frmTblStruct  tree deepens

frmAttachments
 frmNewAttach
   modVisData  tree deepens
   frmAttachments  recursive
 modVisData  tree deepens

frmCopyStruct
 modVisData  tree deepens

frmDataControl
 modVisData  tree deepens
 frmDataCtlProp
   modVisData  tree deepens

frmDataGrid
 modVisData  tree deepens

frmDataType
 modVisData  tree deepens

frmDataCtlProp
 modVisData  tree deepens

frmDFD
 modVisData  tree deepens
 VisDataClass
   modVisData  tree deepens
   frmMDI  tree deepens

frmDynaSnap
 frmFindForm
   modVisData  tree deepens
 modVisData  tree deepens
 frmZoom
   modVisData  tree deepens

frmErrors
 modVisData  tree deepens

frmExpName
 modVisData  tree deepens

frmFindForm
 modVisData  tree deepens

frmGroupsUsers
 modVisData  tree deepens
 frmNewUserGroup
   modVisData  tree deepens
   frmGroupsUsers  recursive
 frmNewPassword
   modVisData  tree deepens

frmImpTbls
 modVisData  tree deepens

frmJoin
 frmQuery  tree deepens
 modVisData  tree deepens
 frmMDI  tree deepens

frmDBPWD
 modVisData  tree deepens

frmNewAttach
 modVisData  tree deepens
 frmAttachments
   frmNewAttach  recursive
   modVisData  tree deepens

frmNewPassword
 modVisData  tree deepens

frmNewUserGroup
 modVisData  tree deepens
 frmGroupsUsers  tree deepens

frmQuery
 modVisData  tree deepens
 frmMDI  tree deepens
 frmJoin  tree deepens
 frmSQL
   modVisData  tree deepens
   frmDatabase
     modVisData  tree deepens
     frmMDI  tree deepens

frmReplace
 modVisData  tree deepens

frmSeek
 modVisData  tree deepens

frmSQL
 modVisData  tree deepens
 frmDatabase
   modVisData  tree deepens
   frmMDI  tree deepens

frmTableObj
 frmSeek
   modVisData  tree deepens
 modVisData  tree deepens
 frmZoom
   modVisData  tree deepens
 frmDynaSnap  tree deepens

frmTblStruct
 modVisData  tree deepens
 frmAddField
   modVisData  tree deepens
   frmTblStruct  recursive
 frmAddIndex
   modVisData  tree deepens
   frmTblStruct  recursive

frmZoom
 modVisData  tree deepens

frmImpExp
 frmDataType
   modVisData  tree deepens
 modVisData  tree deepens
 frmMDI  tree deepens
 frmImpTbls
   modVisData  tree deepens
 frmSQL
   modVisData  tree deepens
   frmDatabase
     modVisData  tree deepens
     frmMDI  tree deepens

frmDatabase
 modVisData  tree deepens
 frmMDI  tree deepens

frmAddIndex
 modVisData  tree deepens
 frmTblStruct  tree deepens

frmODBCLogon
 odbc32
 modVisData  tree deepens
 frmMDI  tree deepens

frmProperty

frmLogin
 modVisData  tree deepens



Project Analyzer v10.2 VisData v6.0.8175

©Aivosto Oy -