aws / chalice
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 1,229 units with 10,806 lines of code in units (82.5% of code).
    • 2 very long units (237 lines of code)
    • 13 long units (850 lines of code)
    • 85 medium size units (2,534 lines of code)
    • 215 small units (3,026 lines of code)
    • 914 very small units (4,159 lines of code)
2% | 7% | 23% | 28% | 38%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py2% | 8% | 23% | 28% | 37%
pyi0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
chalice/deploy6% | 15% | 22% | 24% | 31%
chalice0% | 4% | 24% | 28% | 42%
chalice/cli0% | 0% | 26% | 42% | 31%
chalice/cdk0% | 0% | 63% | 0% | 36%
chalice/vendored/botocore0% | 0% | 24% | 44% | 31%
chalice/templates/6001-cdk-ddb0% | 0% | 0% | 59% | 40%
chalice/cli/filewatch0% | 0% | 0% | 27% | 72%
chalice/api0% | 0% | 0% | 100% | 0%
ROOT0% | 0% | 0% | 0% | 100%
chalice/templates/0007-lambda-only0% | 0% | 0% | 0% | 100%
chalice/templates/0002-s3-event-handler0% | 0% | 0% | 0% | 100%
chalice/templates/0009-legacy0% | 0% | 0% | 0% | 100%
chalice/templates/0000-rest-api0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def _plan_restapi()
in chalice/deploy/planner.py
120 2 2
def _plan_websocketapi()
in chalice/deploy/planner.py
117 2 2
def _plan_lambdafunction()
in chalice/deploy/planner.py
98 2 2
def _add_domainname_plan()
in chalice/deploy/planner.py
83 3 3
def _plan_managediamrole()
in chalice/deploy/planner.py
76 2 2
def _add_apimapping_plan()
in chalice/deploy/planner.py
69 8 3
def _plan_sqseventsource()
in chalice/deploy/planner.py
68 3 2
def _generate_restapi()
in chalice/package.py
63 6 3
def _plan_snslambdasubscription()
in chalice/deploy/planner.py
60 5 2
def _create_beta_stage()
in chalice/pipeline.py
60 1 1
def _plan_kinesiseventsource()
in chalice/deploy/planner.py
57 2 2
def _create_rest_api_model()
in chalice/deploy/appgraph.py
57 11 5
def authorize()
in chalice/local.py
54 12 4
def _generate_restapi()
in chalice/package.py
53 3 3
52 9 3
def create_build_stage()
in chalice/deploy/deployer.py
47 2 4
def _create_lambda_event_resources()
in chalice/deploy/appgraph.py
46 9 4
def _generate_lambdafunction()
in chalice/package.py
46 10 3
def _plan_dynamodbeventsource()
in chalice/deploy/planner.py
44 2 2
def _generate_lambdafunction()
in chalice/package.py
44 9 3