awslabs / aws-servicebroker
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 832 units with 8,262 lines of code in units (27.9% of code).
    • 11 very long units (1,310 lines of code)
    • 12 long units (798 lines of code)
    • 56 medium size units (1,660 lines of code)
    • 142 small units (2,020 lines of code)
    • 611 very small units (2,474 lines of code)
15% | 9% | 20% | 24% | 29%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py16% | 5% | 16% | 25% | 34%
go12% | 23% | 31% | 19% | 12%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pkg/broker14% | 24% | 33% | 14% | 13%
sample-apps/rds5% | 8% | 15% | 28% | 42%
sample-apps/route5358% | 0% | 11% | 15% | 15%
sample-apps/elasticache64% | 0% | 0% | 12% | 22%
sample-apps/dynamodb62% | 0% | 0% | 13% | 24%
sample-apps/s363% | 0% | 0% | 11% | 25%
sample-apps/emr56% | 0% | 15% | 5% | 22%
sample-apps/redshift55% | 0% | 11% | 10% | 21%
sample-apps/sqs49% | 0% | 11% | 23% | 16%
cmd/servicebroker0% | 62% | 0% | 26% | 10%
templates/lex0% | 0% | 72% | 18% | 8%
pkg/dynamodbadapter0% | 0% | 41% | 55% | 3%
functions/lex_custom_slot_type0% | 0% | 62% | 28% | 10%
functions/lex_intent0% | 0% | 62% | 28% | 10%
functions/lex_bot0% | 0% | 58% | 30% | 10%
functions/iam_service_linked_role0% | 0% | 52% | 27% | 20%
sample-apps/sns0% | 0% | 0% | 58% | 41%
functions/generate_password0% | 0% | 0% | 100% | 0%
functions/get_cidrs0% | 0% | 0% | 66% | 33%
functions/get_emrcidrs0% | 0% | 0% | 66% | 33%
functions/generate_emrname0% | 0% | 0% | 76% | 23%
functions/generate_dbname0% | 0% | 0% | 76% | 23%
functions/get_azs0% | 0% | 0% | 69% | 30%
pkg/serviceinstance0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def test_method()
in sample-apps/route53/sample-app/src/app.py
141 17 0
def test_method()
in sample-apps/elasticache/sample-app/src/app.py
131 17 0
def test_method()
in sample-apps/dynamodb/sample-app/src/app.py
127 15 0
def test_method()
in sample-apps/s3/sample-app/src/app.py
123 15 0
func()
in pkg/broker/api.go
117 19 1
def test_method()
in sample-apps/redshift/sample-app/src/app.py
117 15 0
def test_method()
in sample-apps/emr/sample-app/src/app.py
117 19 0
def test_method()
in sample-apps/rds/sample-app/src/app.py
117 15 0
func()
in pkg/broker/awsbroker.go
110 25 1
def __init__()
in sample-apps/rds/sample-app/src/pymysql/connections.py
109 44 31
def test_method()
in sample-apps/sqs/sample-app/src/app.py
101 17 0
func()
in pkg/broker/api.go
100 19 1
func()
in pkg/broker/api.go
82 17 1
func()
in pkg/broker/api.go
75 16 1
def run()
in sample-apps/rds/sample-app/src/bottle.py
68 28 10
func NewAWSBroker()
in pkg/broker/awsbroker.go
67 4 7
func runWithContext()
in cmd/servicebroker/main.go
63 16 1
def add()
in sample-apps/rds/sample-app/src/bottle.py
61 19 5
def connect()
in sample-apps/rds/sample-app/src/pymysql/connections.py
61 19 2
def static_file()
in sample-apps/rds/sample-app/src/bottle.py
60 20 5