awslabs / aws-support-tools
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 139 units with 3,839 lines of code in units (50.2% of code).
    • 7 very long units (1,616 lines of code)
    • 6 long units (393 lines of code)
    • 27 medium size units (881 lines of code)
    • 40 small units (593 lines of code)
    • 59 very small units (356 lines of code)
42% | 10% | 22% | 15% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py49% | 8% | 21% | 10% | 9%
c20% | 16% | 22% | 30% | 10%
js0% | 0% | 69% | 30% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
WAF87% | 0% | 7% | 1% | 3%
MWAA36% | 6% | 35% | 16% | 5%
DataPipeline95% | 0% | 0% | 0% | 4%
OpsWorks20% | 16% | 22% | 30% | 10%
Connect100% | 0% | 0% | 0% | 0%
EC20% | 23% | 42% | 3% | 30%
Cognito0% | 69% | 30% | 0% | 0%
SES0% | 29% | 28% | 31% | 11%
Lambda0% | 0% | 41% | 36% | 22%
SNS0% | 0% | 33% | 46% | 19%
Elasticsearch Service0% | 0% | 100% | 0% | 0%
APIGateway0% | 0% | 0% | 80% | 19%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def check_iam_permissions()
in MWAA/verify_env/verify_env.py
307 12 2
def getAssociatedResources()
in WAF/WAF-Enhanced-Replicator/wafget.py
305 12 6
def getWaf()
in WAF/WAF-Enhanced-Replicator/wafget.py
298 9 1
def crawlConditions()
in WAF/WAF-Enhanced-Replicator/wafget.py
232 26 4
def parse()
in DataPipeline/WriteToAnySchemaInRedshiftFromRds/mysql_to_redshift_tablename_noquotes.py
185 3 6
int main()
in OpsWorks/sample-cookbooks/cpulimit-ruby/files/default/cpulimit-master/src/cpulimit.c
180 41 2
def lambda_handler()
in Connect/DynamicOutboundCallerID/lambda_function.py
109 19 2
void limit_process()
in OpsWorks/sample-cookbooks/cpulimit-ruby/files/default/cpulimit-master/src/cpulimit.c
86 22 3
def configure()
in EC2/QuickInstanceEC2/qi.py
80 35 0
def main()
in Cognito/identity-pool-integrator-onelogin/identitypool_integrator_onelogin.py
65 8 0
void update_process_group()
in OpsWorks/sample-cookbooks/cpulimit-ruby/files/default/cpulimit-master/src/process_group.c
58 7 1
def lambda_handler()
in SES/SESMailer/ses_mailer.py
53 13 2
def check_connectivity_to_dep_services()
in MWAA/verify_env/verify_env.py
51 2 5
def check_log_groups()
in MWAA/verify_env/verify_env.py
50 3 4
def check_service_vpc_endpoints()
in MWAA/verify_env/verify_env.py
48 5 2
def lambda_handler()
in Lambda/Functions/TagEC2Dependencies/tag_ec2_dependencies.py
42 13 2
def check_security_groups()
in MWAA/verify_env/verify_env.py
41 9 2
def getHomeConfig()
in WAF/WAF-Enhanced-Replicator/waffun.py
41 10 0
int get_next_process()
in OpsWorks/sample-cookbooks/cpulimit-ruby/files/default/cpulimit-master/src/process_iterator_freebsd.c
40 12 2
int get_next_process()
in OpsWorks/sample-cookbooks/cpulimit-ruby/files/default/cpulimit-master/src/process_iterator_apple.c
39 14 2