awslabs / aws-codepipeline-governance
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 18 units with 304 lines of code in units (26.7% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 7 medium size units (192 lines of code)
    • 5 small units (75 lines of code)
    • 6 very small units (37 lines of code)
0% | 0% | 63% | 24% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 63% | 24% | 12%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 0% | 63% | 24% | 12%
Alternative Visuals
Longest Units
Top 18 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in src/main.py
42 6 2
def scan_for_stage()
in src/helper.py
31 8 2
30 12 1
25 2 4
def boto3_client()
in src/client_session_helper.py
22 6 5
def boto3_session()
in src/client_session_helper.py
21 6 3
def scan_dynamodb()
in src/dynamodb_helper.py
21 7 4
def s3_download_file()
in src/s3_helper.py
20 4 4
18 8 2
def scan_for_action()
in src/helper.py
14 7 2
def get_user_params()
in src/helper.py
12 5 2
11 5 2
def assume_role()
in src/sts_helper.py
9 1 3
def put_job_failure()
in src/cp_helper.py
8 1 3
def cleanup_temp()
in src/helper.py
7 3 1
def __init__()
in src/custom_logging.py
6 1 1
def put_job_success()
in src/cp_helper.py
5 1 3
def logger()
in src/custom_logging.py
2 1 1