aws-samples / aws-iot-twinmaker-samples
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 201 units with 3,000 lines of code in units (82.9% of code).
    • 3 very long units (397 lines of code)
    • 6 long units (386 lines of code)
    • 33 medium size units (1,058 lines of code)
    • 51 small units (724 lines of code)
    • 108 very small units (435 lines of code)
13% | 12% | 35% | 24% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py9% | 10% | 36% | 27% | 16%
ts37% | 29% | 29% | 3% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
modules/insights61% | 10% | 15% | 9% | 2%
libs/deploy_utils15% | 10% | 30% | 23% | 19%
modules/sitewise0% | 16% | 41% | 35% | 6%
modules/snowflake0% | 50% | 22% | 25% | 1%
workspaces/cookiefactory0% | 51% | 20% | 25% | 1%
modules/s30% | 0% | 55% | 28% | 15%
modules/timestream_telemetry0% | 0% | 52% | 17% | 29%
libs/udq_helper_utils0% | 0% | 45% | 0% | 54%
modules/grafana0% | 0% | 64% | 33% | 2%
libs/connector_utils0% | 0% | 0% | 57% | 42%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in src/modules/insights/install_insights_module.py
148 26 0
constructor()
in src/modules/insights/cdk/lib/iot-twin-maker-kda-stack.ts
147 1 3
def create_sitewise_camera_asset_model()
in src/libs/deploy_utils/VideoUtils.py
102 1 1
def main()
in src/modules/snowflake/deploy-utils/create_snowflake_connector.py
74 5 0
def upload_video()
in src/libs/deploy_utils/VideoUtils.py
70 14 4
def main()
in src/workspaces/cookiefactory/setup_content/__main__.py
70 14 0
constructor()
in src/modules/sitewise/cdk/lib/sitewise-stack.ts
67 1 3
def main()
in src/modules/sitewise/lib/patch_sitewise_content.py
54 6 0
private createAnomalyDetectionEndpoint()
in src/modules/insights/cdk/lib/iot-twin-maker-sagemaker-stack.ts
51 1 3
def process_query()
in src/libs/udq_helper_utils/udq_utils/udq_models.py
49 15 2
def delete_workspace_role_and_bucket()
in src/libs/deploy_utils/WorkspaceUtils.py
48 8 1
private createSimulationEndpoint()
in src/modules/insights/cdk/lib/iot-twin-maker-sagemaker-stack.ts
48 1 4
def main()
in src/modules/s3/deploy-utils/create_s3_document_connector.py
47 4 0
constructor()
in src/modules/timestream_telemetry/cdk/lib/timestream_telemetry_lambdas-stack.ts
44 2 3
def main()
in src/modules/s3/deploy-utils/patch_document_content.py
40 3 0
def create_update_entity()
in src/modules/sitewise/sync-connector-lambda/importer.py
39 9 3
def __init__()
in src/libs/udq_helper_utils/udq_utils/udq_models.py
38 14 2
def import_csv()
in src/modules/timestream_telemetry/lib/TimestreamTelemetryUtils.py
38 6 3
def get_data_set()
in src/modules/sitewise/lib/util/SiteWiseTelemetryUtils.py
38 5 2
def main()
in src/modules/grafana/cleanup_grafana_dashboard_role.py
36 6 0