aws-cloudformation / cloudformation-cli-go-plugin
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 139 units with 1,552 lines of code in units (72.0% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (184 lines of code)
    • 15 medium size units (444 lines of code)
    • 31 small units (441 lines of code)
    • 90 very small units (483 lines of code)
0% | 11% | 28% | 28% | 31%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 9% | 30% | 28% | 31%
py0% | 25% | 17% | 28% | 28%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
python/rpdk0% | 26% | 18% | 29% | 26%
cfn/encoding0% | 17% | 18% | 46% | 18%
cfn0% | 28% | 15% | 27% | 28%
cfn/scheduler0% | 0% | 69% | 11% | 19%
cfn/callback0% | 0% | 43% | 27% | 28%
cfn/logging0% | 0% | 53% | 13% | 33%
cfn/metrics0% | 0% | 36% | 16% | 47%
cfn/cfnerr0% | 0% | 0% | 25% | 74%
cfn/handler0% | 0% | 0% | 26% | 73%
cfn/credentials0% | 0% | 0% | 36% | 63%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def init()
in python/rpdk/go/codegen.py
64 2 2
func Stringify()
in cfn/encoding/stringify.go
63 20 1
57 8 1
func()
in cfn/scheduler/scheduler_notag.go
44 7 1
func()
in cfn/scheduler/scheduler.go
44 7 1
def generate()
in python/rpdk/go/codegen.py
44 7 2
func()
in cfn/callback/callback.go
34 7 1
func newResponse()
in cfn/response.go
31 6 2
func NewCloudWatchLogsProvider()
in cfn/logging/cloudwatchlogs.go
30 8 2
func()
in cfn/scheduler/scheduler_notag.go
30 5 1
func()
in cfn/scheduler/scheduler.go
30 5 1
func()
in cfn/metrics/publisher.go
26 3 1
func convertType()
in cfn/encoding/unstringify.go
25 9 2
func()
in cfn/logging/cloudwatchlogs.go
22 3 1
func TranslateErrorCode()
in cfn/callback/callback_notag.go
21 2 1
func TranslateErrorCode()
in cfn/callback/callback.go
21 2 1
func convertInt()
in cfn/encoding/unstringify.go
21 6 2
func convertFloat64()
in cfn/encoding/unstringify.go
21 6 2
func()
in cfn/callback/callback_notag.go
20 5 1
func Unstringify()
in cfn/encoding/unstringify.go
20 6 2