aws-samples / ecsdemo-amp
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 6 units with 151 lines of code in units (50.2% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (71 lines of code)
    • 1 medium size units (43 lines of code)
    • 2 small units (31 lines of code)
    • 2 very small units (6 lines of code)
0% | 47% | 28% | 20% | 3%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 100% | 0% | 0% | 0%
go0% | 0% | 53% | 38% | 7%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cdk0% | 100% | 0% | 0% | 0%
prometheus0% | 0% | 53% | 38% | 7%
Alternative Visuals
Longest Units
Top 6 longest units
Unit# linesMcCabe index# params
def __init__()
in cdk/app.py
71 1 4
func()
in prometheus/metrics_collector.go
43 2 1
func main()
in prometheus/main.go
16 1 0
func()
in prometheus/metrics_collector.go
15 4 1
func newMetricCollector()
in prometheus/metrics_collector.go
3 1 1
func healthCheckHandler()
in prometheus/main.go
3 1 2