aws-samples / software-composition-analysis
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 14 units with 194 lines of code in units (42.3% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 5 medium size units (121 lines of code)
    • 3 small units (38 lines of code)
    • 6 very small units (35 lines of code)
0% | 0% | 62% | 19% | 18%
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% | 62% | 19% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/trigger-changed-files0% | 0% | 80% | 0% | 19%
src/reqfile-to-artifact0% | 0% | 42% | 37% | 20%
iac/iac/stacks0% | 0% | 100% | 0% | 0%
iac/iac/constructs0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 14 longest units
Unit# linesMcCabe index# params
def __init__()
in iac/iac/stacks/stack.py
28 1 4
def lambda_handler()
in src/trigger-changed-files/trigger-changed-files.py
27 8 2
def get_file_differences()
in src/trigger-changed-files/trigger-changed-files.py
23 4 3
def lambda_handler()
in src/reqfile-to-artifact/reqfile-to-artifact.py
22 3 2
def get_package_version()
in src/reqfile-to-artifact/reqfile-to-artifact.py
21 5 3
def get_packages_list()
in src/reqfile-to-artifact/reqfile-to-artifact.py
14 3 2
def get_package_names_and_versions()
in src/reqfile-to-artifact/reqfile-to-artifact.py
12 3 1
def final_missing_list()
in src/reqfile-to-artifact/reqfile-to-artifact.py
12 4 2
def trigger_cb()
in src/reqfile-to-artifact/reqfile-to-artifact.py
10 1 3
def upload_file()
in src/reqfile-to-artifact/reqfile-to-artifact.py
8 3 3
def get_last_commit_log()
in src/trigger-changed-files/trigger-changed-files.py
6 1 2
def get_last_commit_id()
in src/trigger-changed-files/trigger-changed-files.py
6 1 2
def get_latest_version_number()
in src/reqfile-to-artifact/reqfile-to-artifact.py
3 1 1
def __init__()
in iac/iac/constructs/ci.py
2 1 0