aws-cloudformation / rain
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 260 units with 3,887 lines of code in units (4.2% of code).
    • 1 very long units (120 lines of code)
    • 12 long units (679 lines of code)
    • 44 medium size units (1,362 lines of code)
    • 64 small units (955 lines of code)
    • 139 very small units (771 lines of code)
3% | 17% | 35% | 24% | 19%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go3% | 17% | 35% | 24% | 19%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
internal/ui38% | 19% | 29% | 0% | 13%
internal/aws0% | 28% | 13% | 32% | 25%
cft/build0% | 45% | 35% | 8% | 9%
internal/cmd0% | 10% | 52% | 20% | 17%
internal/s11n0% | 31% | 51% | 7% | 9%
cft0% | 87% | 0% | 0% | 12%
cft/graph0% | 28% | 22% | 34% | 15%
cft/format0% | 24% | 53% | 19% | 2%
cft/pkg0% | 0% | 44% | 38% | 16%
cft/spec0% | 0% | 58% | 23% | 17%
cft/parse0% | 0% | 58% | 10% | 31%
cft/diff0% | 0% | 12% | 47% | 39%
internal/console0% | 0% | 14% | 44% | 41%
internal/node0% | 0% | 100% | 0% | 0%
cmd/aws-console0% | 0% | 0% | 0% | 100%
internal/config0% | 0% | 0% | 0% | 100%
cmd/cfn-format0% | 0% | 0% | 0% | 100%
cmd/rain0% | 0% | 0% | 0% | 100%
cmd/cfn-skeleton0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func stackResourceStatuses()
in internal/ui/stack.go
120 31 1
func CreateBucket()
in internal/aws/s3/s3.go
66 5 1
func getParameters()
in internal/cmd/deploy/util.go
65 17 4
func GetStackSummary()
in internal/ui/stack.go
60 16 2
func matchPath()
in internal/s11n/match.go
58 22 3
func ExecuteChangeSet()
in internal/aws/cfn/mock.go
58 4 3
func()
in cft/comments.go
56 14 1
func CreateChangeSet()
in internal/aws/cfn/cfn.go
54 10 4
func findRefs()
in cft/graph/util.go
54 16 1
func()
in cft/build/cfn.go
53 11 1
func formatNode()
in cft/format/transform.go
53 15 1
func GetChangeSet()
in internal/aws/cfn/mock.go
51 3 2
func()
in cft/build/build.go
51 16 1
func printGraph()
in internal/cmd/tree/util.go
50 21 2
func()
in cft/build/build.go
49 13 1
func getLogs()
in internal/cmd/logs/util.go
48 15 2
func zipPath()
in cft/pkg/util.go
48 10 1
func WaitForStackToSettle()
in internal/ui/stack.go
44 8 1
func checkIntegrity()
in cft/spec/internal/main.go
44 17 1
func New()
in cft/graph/graph.go
43 14 1