aws-samples / multi-branch-cdk-pipelines
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 10 units with 291 lines of code in units (72.0% of code).
    • 1 very long units (111 lines of code)
    • 1 long units (83 lines of code)
    • 2 medium size units (70 lines of code)
    • 0 small units (0 lines of code)
    • 6 very small units (27 lines of code)
38% | 28% | 24% | 0% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py38% | 28% | 24% | 0% | 9%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cicd100% | 0% | 0% | 0% | 0%
cicd/iam0% | 100% | 0% | 0% | 0%
cicd/code0% | 0% | 94% | 0% | 5%
src/s3trigger0% | 0% | 0% | 0% | 100%
src0% | 0% | 0% | 0% | 100%
src/lambda0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 10 longest units
Unit# linesMcCabe index# params
def __init__()
in cicd/pipeline_stack.py
111 5 5
def __init__()
in cicd/iam/iam_stack.py
83 4 9
def handler()
in cicd/code/destroy_branch.py
35 3 2
def handler()
in cicd/code/create_branch.py
35 3 2
def __init__()
in src/s3trigger/s3trigger_stack.py
9 3 4
def main()
in src/lambda/lambda-handler.py
6 1 2
def __init__()
in src/application_stage.py
5 1 5
def __init__()
in src/application_stage.py
3 1 5
def generate_build_spec()
in cicd/code/destroy_branch.py
2 1 1
def generate_build_spec()
in cicd/code/create_branch.py
2 1 1