awslabs / yesiscan
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 133 units with 1,711 lines of code in units (81.7% of code).
    • 3 very long units (371 lines of code)
    • 5 long units (338 lines of code)
    • 10 medium size units (311 lines of code)
    • 23 small units (315 lines of code)
    • 92 very small units (376 lines of code)
21% | 19% | 18% | 18% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go21% | 19% | 18% | 18% | 21%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
iterator35% | 18% | 27% | 14% | 3%
lib35% | 46% | 0% | 14% | 3%
cmd/yesiscan69% | 0% | 15% | 9% | 5%
backend0% | 79% | 0% | 14% | 6%
parser0% | 0% | 94% | 0% | 6%
util0% | 0% | 77% | 0% | 22%
interfaces0% | 0% | 58% | 39% | 1%
util/safepath0% | 0% | 6% | 29% | 64%
util/licenses0% | 0% | 32% | 32% | 35%
util/errwrap0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in iterator/git.go
160 32 1
func()
in lib/lib.go
109 22 1
func Main()
in cmd/yesiscan/main.go
102 17 5
func()
in lib/lib.go
84 19 1
func()
in iterator/fs.go
84 25 1
func SimpleResults()
in lib/results.go
59 11 2
func()
in backend/spdxclassifier.go
58 11 1
func()
in backend/licenseclassifier.go
53 13 1
func()
in parser/parser.go
47 7 1
func()
in iterator/fs.go
45 10 1
func smartGithubURI()
in util/util.go
34 8 1
func MergeResultSets()
in interfaces/interfaces.go
30 11 2
func()
in iterator/git.go
29 13 1
func SkipPath()
in iterator/iterator.go
28 10 2
func ParseIntoPath()
in util/safepath/safepath.go
26 8 2
func decode()
in util/licenses/licenses.go
25 7 0
func getCommitFromRef()
in iterator/git.go
24 7 2
func main()
in cmd/yesiscan/main.go
23 4 0
func()
in lib/lib.go
20 8 1
func()
in interfaces/interfaces.go
20 8 1