awslabs / aws-greengrass-labs-component-for-home-assistant
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 21 units with 328 lines of code in units (65.5% of code).
    • 1 very long units (142 lines of code)
    • 0 long units (0 lines of code)
    • 1 medium size units (22 lines of code)
    • 6 small units (97 lines of code)
    • 13 very small units (67 lines of code)
43% | 0% | 6% | 29% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts89% | 0% | 0% | 0% | 10%
py0% | 0% | 13% | 57% | 29%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cicd/lib89% | 0% | 0% | 0% | 10%
libs0% | 0% | 44% | 0% | 55%
ROOT0% | 0% | 0% | 84% | 15%
artifacts0% | 0% | 0% | 69% | 30%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in cicd/lib/cicd-stack.ts
142 2 3
def put()
in libs/secret.py
22 4 2
def update_deployment_components()
in deploy_component_version.py
19 3 1
def get_secret()
in artifacts/secret.py
18 2 1
def wait_for_deployment_to_finish()
in deploy_component_version.py
18 6 1
def get_deployment_components()
in deploy_component_version.py
17 6 1
def create_recipe()
in gdk_build.py
13 1 0
def create_deployment()
in deploy_component_version.py
12 2 2
private getContext()
in cicd/lib/cicd-stack.ts
10 1 0
def create_files_from_secret()
in artifacts/install.py
8 3 0
def get()
in libs/secret.py
8 2 1
def get_newest_component_version()
in deploy_component_version.py
8 2 1
def exists()
in libs/secret.py
7 4 1
private getContextVariable()
in cicd/lib/cicd-stack.ts
7 2 2
def create_artifacts()
in gdk_build.py
5 1 0
def __init__()
in libs/gdk_config.py
4 1 1
def __init__()
in libs/secret.py
2 1 2
def name()
in libs/gdk_config.py
2 1 1
def version()
in libs/gdk_config.py
2 1 1
def region()
in libs/gdk_config.py
2 1 1