Code Stats

time to read 73 min | 14600 words

I run Source Monitor* on my system, trying to get an impartial idea some idea of how big is the damage, it turns out to be pretty good, actually.

General stats:

Files

719

Lines

59,626

Statements

25,047

Percent Comment Lines

5.5

Percent Documentation Lines

8.2

Classes, Interfaces, Structs

888

Methods per Class

5.43

Calls per Method

2

Statements per Method

2.61

Name of Most Complex Method

Week.getIndexer()

Maximum Complexity

15

Maximum Block Depth

6

Average Block Depth

1.77

Average Complexity

1.37

Longest Method

151

Longest Method Complexity

1

 

Method complexity stats:

0 – 1

3827

2 – 3

574

4 – 5

120

6 – 7

37

8 – 9

19

10 – 11

5

12 – 13

4

14 – 15

3

> 16

0

Average

Total     

 1.37

4589

I can tolerate 11 methods out of 4.5 thousands being moderately complex, especially since those methods are usually about converting enums using simple switch/case statement.

Longest Method Stats:

Name

Setup Mock Resources

Complexity

1

Statements

151

Max Depth

2

Calls

155

This one is a thorn in my hide, it is basically registerring 90% of the resources in the application (which are stored in a DB) inside a hash table so I can use the resources without hitting the DB when testing. It is generated code, but it still bugs me.

Most Complex Method Stats:

Name

Week. getIndexer()

Complexity

15

Statements

14

Max depth

4

Calls

7

 Also, is it scary that I have 45 methods whose name exceed 30 characters? 14 of those exceed 40 characters, and one (test method) is a whopping 103 characters long.

* After using Source Monitor I exported to Excel and started playing with the data, it does not produce this tables, unfortantely.