microsoft / ethr
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 252 units with 3,385 lines of code in units (79.5% of code).
    • 1 very long units (180 lines of code)
    • 9 long units (551 lines of code)
    • 36 medium size units (1,115 lines of code)
    • 47 small units (680 lines of code)
    • 159 very small units (859 lines of code)
5% | 16% | 32% | 20% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go5% | 16% | 32% | 20% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT5% | 16% | 32% | 20% | 25%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func main()
in ethr.go
180 46 0
76 19 2
func icmpRecvMsg()
in client.go
72 21 7
64 9 0
func()
in serverui.go
62 7 1
func runTest()
in client.go
58 20 1
56 11 3
55 1 0
func getTestResults()
in serverui.go
55 24 3
53 8 3
func tcpProbe()
in client.go
50 8 4
50 11 1
48 8 1
46 8 6
func runClient()
in client.go
45 10 4
45 10 1
43 7 3
42 8 3
func icmpSendMsg()
in client.go
37 6 6
func getNetDevStats()
in plt_windows.go
37 6 1