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 for the 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 number of physical source lines
Total size
| Source lines (LINES) |
10732 |
|
| |
|
| Logical lines of code LLOC |
8219 |
77% |
| Logical lines of comment LLOC' |
806 |
8% |
| Lines of whitespace LLOW |
1653 |
15% |
| Total logical lines LLINES |
10678 |
100% |
| |
|
| Source size |
486 |
kB |
| Binary property (frx) files |
29 |
kB |
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.
Files
| Total files |
84 |
|
| Source files |
36 |
| Other files |
48 |
| |
| File types |
| Module |
1 |
| Forms |
34 |
| Class |
1 |
| Libraries (Declared) |
3 |
| Binary Property Files |
33 |
| Libraries (Controls) |
4 |
| Libraries (Referenced) |
6 |
| Project Workspace |
1 |
| Project File |
1 |
| |
| Source file ages |
| Oldest |
4.6.98 |
VISDATA.BAS |
| Newest |
25.6.98 |
VDMDI.FRM |
| Modified today |
0 |
0% |
| Modified in 7 days |
0 |
0% |
| Modified in 30 days |
0 |
0% |
| Modified in 365 days |
0 |
0% |
| Older than 365 days |
36 |
100% |
| |
|
|
| Source file last modified |
Files |
|
| 1998 |
36 |
| Total source files |
36 |
Average source file age is 12.4 years
Forms and controls
| Forms |
34 |
(max 230) |
| 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 ones
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
In source files
| Enums |
1 |
| Enum constants |
15 |
Project Analyzer v10 VisData v6.0.8175
Design quality report - VisData
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 |
452 |
100% |
| |
| Longest procedure |
163 |
|
|
| Average procedure |
16.7 |
|
|
Procedure length is measured by logical lines of code (LLOC).
Comments and whitespace are not counted.
Source file sizes
Average source file size
| Average length |
298 |
LINES |
|
| Average kilobytes |
13.5 |
kB |
Smallest and largest source files
| Longest file |
2437 |
LINES |
VISDATA.BAS |
| Shortest file |
30 |
LINES |
EXPNAME.FRM |
| |
|
|
| Largest file |
76.1 |
kB |
VISDATA.BAS |
| Smallest file |
2.8 |
kB |
ERRORS.FRM |
Line counts in this section are physical line counts (LINES).
Complexity
Cyclomatic complexity
| Complexity |
Procs |
% |
Distribution |
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 range: 1-10
| Average complexity |
3.42 |
|
| Decision density |
0.21 |
DECDENS=CC/LLOC, complexity per a line of code |
| Total complexity |
1096 |
TCC = total number of decisions + 1 |
Depth of conditional nesting
DCOND = Maximum nested conditional statements in procedure.
| Recommended maximum |
5 |
|
| Actual maximum |
5 |
| Too high (DCOND > 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 |
| Average IC1 |
420 |
Informational complexity |
Understandability
Comments and whitespace
| Logical lines of code LLOC |
8219 |
77% |
|
| Logical 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 per procedure
| MCOMM |
Procs |
% |
Distribution |
| 0 |
258 |
57% |
*********** |
| 1-2 |
112 |
25% |
***** |
| 3-5 |
52 |
12% |
** |
| 6 or more |
30 |
7% |
* |
| Total |
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 |
| Control names |
10.4 |
| Type/Enum names |
12.3 |
(incl. enum constants and type fields) |
| 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% |
Structural fan-in and 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.
Problems
Dead code
| |
Problematic |
Total |
% |
| Dead procedures |
9 |
459 |
2% |
| Removable code lines in procs |
83 |
7553 |
1% |
| Dead variables |
66 |
455 |
15% |
| Dead constants |
12 |
516 |
2% |
| Dead Enums |
0 |
1 |
0% |
Dead code counts may 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 |
0 |
2229 |
0% |
Problem statistics
Filter: <Strict - Show all problems>
| Problems reported |
3860 |
| Lines of code (LLOC) |
8219 |
| Source procedures |
459 |
| Problems / LLOC |
0.5 |
| Problems / procedure |
8.4 |
Project Analyzer v10 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 constants |
% |
| Dead enum constants |
0 |
0% |
| Live enum constants |
15 |
100% |
| All enum constants |
15 |
100% |
Project Analyzer v10 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 |
| 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 |
76 |
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 |
| 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 |
2928 |
| Functionality |
418 |
| Logic |
77 |
| VB.NET Compatibility |
39 |
| Dead code |
105 |
| Metrics |
82 |
| ===== |
===== |
| Total |
3860 |
| Problems/logical code line |
0,47 |
Filter: <Strict - Show all problems>
Project Analyzer v10 VisData v6.0.8175
File dependency tree - VisData
VDMDI.FRM
-> VISDATA.BAS >>tree deepens
-> TBLSTRU.FRM >>tree deepens
-> Database.frm
-- VISDATA.BAS >>tree deepens
-- VDMDI.FRM << recursive
-> SQL.FRM
-- VISDATA.BAS >>tree deepens
-- Database.frm
-> VISDATA.BAS >>tree deepens
-> VDMDI.FRM << recursive
-> Property.frm
-> QUERY.FRM >>tree deepens
-> ABOUTBOX.FRM
-> ODBCLogn.Frm >>tree deepens
-> Loginfrm.frm
-- VISDATA.BAS >>tree deepens
-> ATTACH.FRM
-- NEWATTCH.FRM
-> VISDATA.BAS >>tree deepens
-> ATTACH.FRM << recursive
-- VISDATA.BAS >>tree deepens
-> GRPSUSRS.FRM >>tree deepens
-> VDCLASS.CLS
-- VISDATA.BAS >>tree deepens
-- VDMDI.FRM << recursive
-> DFD.FRM
-- VISDATA.BAS >>tree deepens
-- VDCLASS.CLS
-> VISDATA.BAS >>tree deepens
-> VDMDI.FRM << recursive
-> CPYSTRU.FRM
-- VISDATA.BAS >>tree deepens
-> VBIMEX.FRM >>tree deepens
-> REPLACE.FRM
-- VISDATA.BAS >>tree deepens
VISDATA.BAS
-> ODBC32.DLL
-> kernel32.dll
-> user32.dll
-> VDCLASS.CLS
-- VISDATA.BAS << recursive
-- VDMDI.FRM >>tree deepens
-> VDMDI.FRM >>tree deepens
-> DATAFORM.FRM
-- VISDATA.BAS << recursive
-- DCPROP.FRM
-> VISDATA.BAS << recursive
-> DYNASNAP.FRM >>tree deepens
-> TABLEOBJ.FRM >>tree deepens
-> Database.frm
-- VISDATA.BAS << recursive
-- VDMDI.FRM >>tree deepens
-> SQL.FRM
-- VISDATA.BAS << recursive
-- Database.frm
-> VISDATA.BAS << recursive
-> VDMDI.FRM >>tree deepens
-> DATAGRID.FRM
-- VISDATA.BAS << recursive
-> ERRORS.FRM
-- VISDATA.BAS << recursive
-> DBPwd.FRM
-- VISDATA.BAS << recursive
-> EXPNAME.FRM
-- VISDATA.BAS << recursive
-> VBIMEX.FRM >>tree deepens
VDCLASS.CLS
-> VISDATA.BAS >>tree deepens
-> VDMDI.FRM >>tree deepens
ABOUTBOX.FRM
ADDFIELD.FRM
-> VISDATA.BAS >>tree deepens
-> TBLSTRU.FRM >>tree deepens
ATTACH.FRM
-> NEWATTCH.FRM
-- VISDATA.BAS >>tree deepens
-- ATTACH.FRM << recursive
-> VISDATA.BAS >>tree deepens
CPYSTRU.FRM
-> VISDATA.BAS >>tree deepens
DATAFORM.FRM
-> VISDATA.BAS >>tree deepens
-> DCPROP.FRM
-- VISDATA.BAS >>tree deepens
DATAGRID.FRM
-> VISDATA.BAS >>tree deepens
DATATYPE.FRM
-> VISDATA.BAS >>tree deepens
DCPROP.FRM
-> VISDATA.BAS >>tree deepens
DFD.FRM
-> VISDATA.BAS >>tree deepens
-> VDCLASS.CLS
-- VISDATA.BAS >>tree deepens
-- VDMDI.FRM >>tree deepens
DYNASNAP.FRM
-> FIND.FRM
-- VISDATA.BAS >>tree deepens
-> VISDATA.BAS >>tree deepens
-> ZOOM.FRM
-- VISDATA.BAS >>tree deepens
ERRORS.FRM
-> VISDATA.BAS >>tree deepens
EXPNAME.FRM
-> VISDATA.BAS >>tree deepens
FIND.FRM
-> VISDATA.BAS >>tree deepens
GRPSUSRS.FRM
-> VISDATA.BAS >>tree deepens
-> NEWUG.FRM
-- VISDATA.BAS >>tree deepens
-- GRPSUSRS.FRM << recursive
-> NEWPW.FRM
-- VISDATA.BAS >>tree deepens
IMPTBLS.FRM
-> VISDATA.BAS >>tree deepens
JOIN.FRM
-> QUERY.FRM >>tree deepens
-> VISDATA.BAS >>tree deepens
-> VDMDI.FRM >>tree deepens
DBPwd.FRM
-> VISDATA.BAS >>tree deepens
NEWATTCH.FRM
-> VISDATA.BAS >>tree deepens
-> ATTACH.FRM
-- NEWATTCH.FRM << recursive
-- VISDATA.BAS >>tree deepens
NEWPW.FRM
-> VISDATA.BAS >>tree deepens
NEWUG.FRM
-> VISDATA.BAS >>tree deepens
-> GRPSUSRS.FRM >>tree deepens
QUERY.FRM
-> VISDATA.BAS >>tree deepens
-> VDMDI.FRM >>tree deepens
-> JOIN.FRM >>tree deepens
-> SQL.FRM
-- VISDATA.BAS >>tree deepens
-- Database.frm
-> VISDATA.BAS >>tree deepens
-> VDMDI.FRM >>tree deepens
REPLACE.FRM
-> VISDATA.BAS >>tree deepens
SEEK.FRM
-> VISDATA.BAS >>tree deepens
SQL.FRM
-> VISDATA.BAS >>tree deepens
-> Database.frm
-- VISDATA.BAS >>tree deepens
-- VDMDI.FRM >>tree deepens
TABLEOBJ.FRM
-> SEEK.FRM
-- VISDATA.BAS >>tree deepens
-> VISDATA.BAS >>tree deepens
-> ZOOM.FRM
-- VISDATA.BAS >>tree deepens
-> DYNASNAP.FRM >>tree deepens
TBLSTRU.FRM
-> VISDATA.BAS >>tree deepens
-> ADDFIELD.FRM
-- VISDATA.BAS >>tree deepens
-- TBLSTRU.FRM << recursive
-> Addindex.frm
-- VISDATA.BAS >>tree deepens
-- TBLSTRU.FRM << recursive
ZOOM.FRM
-> VISDATA.BAS >>tree deepens
VBIMEX.FRM
-> DATATYPE.FRM
-- VISDATA.BAS >>tree deepens
-> VISDATA.BAS >>tree deepens
-> VDMDI.FRM >>tree deepens
-> IMPTBLS.FRM
-- VISDATA.BAS >>tree deepens
-> SQL.FRM
-- VISDATA.BAS >>tree deepens
-- Database.frm
-> VISDATA.BAS >>tree deepens
-> VDMDI.FRM >>tree deepens
Database.frm
-> VISDATA.BAS >>tree deepens
-> VDMDI.FRM >>tree deepens
Addindex.frm
-> VISDATA.BAS >>tree deepens
-> TBLSTRU.FRM >>tree deepens
ODBCLogn.Frm
-> ODBC32.DLL
-> VISDATA.BAS >>tree deepens
-> VDMDI.FRM >>tree deepens
Property.frm
Loginfrm.frm
-> VISDATA.BAS >>tree deepens
Project Analyzer v10 VisData v6.0.8175
©Aivosto Oy
-
|