awslabs / scale-out-computing-on-aws
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 279 units with 8,632 lines of code in units (26.1% of code).
    • 11 very long units (1,860 lines of code)
    • 30 long units (2,095 lines of code)
    • 101 medium size units (3,269 lines of code)
    • 72 small units (1,058 lines of code)
    • 65 very small units (350 lines of code)
21% | 24% | 37% | 12% | 4%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py21% | 24% | 37% | 12% | 4%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/soca/cluster_web_ui/api27% | 22% | 41% | 7% | 1%
source/soca/cluster_manager40% | 15% | 26% | 10% | 7%
installer/resources/src27% | 37% | 27% | 6% | <1%
source/soca/cluster_web_ui/scheduled_tasks23% | 41% | 29% | 0% | 5%
source/soca/cluster_web_ui/views0% | 28% | 40% | 26% | 4%
source/soca/cluster_web_ui0% | 17% | 37% | 27% | 17%
source/soca/cluster_analytics0% | 0% | 68% | 0% | 31%
installer/resources/functions/SolutionMetricsLambda0% | 0% | 100% | 0% | 0%
installer/resources/functions/CreateELBSSLCertificate0% | 0% | 100% | 0% | 0%
installer/resources/functions/GetESPrivateIPLambda0% | 0% | 100% | 0% | 0%
source/soca/cluster_manager/utilities0% | 0% | 60% | 40% | 0%
installer/resources/functions/EFSThroughputLambda0% | 0% | 100% | 0% | 0%
installer/resources/functions/TagEC2ResourceLambda0% | 0% | 60% | 39% | 0%
source/soca/cluster_hooks/queuejob0% | 0% | 42% | 57% | 0%
installer/resources/functions/ResetDSPassword0% | 0% | 100% | 0% | 0%
source/soca/cluster_hooks0% | 0% | 52% | 47% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in source/soca/cluster_manager/add_nodes.py
285 25 1
def check_config()
in source/soca/cluster_manager/add_nodes.py
266 114 1
def post()
in source/soca/cluster_web_ui/api/v1/dcv/create_windows_desktop.py
206 47 2
def get_install_parameters()
in installer/resources/src/install_soca.py
196 57 0
def post()
in source/soca/cluster_web_ui/api/v1/dcv/create_linux_desktop.py
190 27 2
def validate_sg_rules()
in installer/resources/src/find_existing_resources.py
150 62 3
def get()
in source/soca/cluster_web_ui/api/v1/dcv/list_desktops.py
137 31 1
def post()
in source/soca/cluster_web_ui/api/v1/ldap/activedirectory/user.py
118 26 1
def post()
in source/soca/cluster_web_ui/api/v1/ldap/openldap/user.py
105 22 1
def windows_auto_stop_instance()
in source/soca/cluster_web_ui/scheduled_tasks/manage_dcv_instances_lifecycle.py
104 25 1
def storage()
in installer/resources/src/cdk_construct.py
103 30 1
def linux_auto_stop_instance()
in source/soca/cluster_web_ui/scheduled_tasks/manage_dcv_instances_lifecycle.py
98 25 1
def secretsmanager()
in installer/resources/src/cdk_construct.py
89 15 1
def user_has_permission()
in source/soca/cluster_web_ui/views/my_files.py
87 29 3
def get_all_compute_instances()
in source/soca/cluster_manager/nodes_manager.py
86 22 1
def retrieve_host()
in source/soca/cluster_web_ui/scheduled_tasks/manage_dcv_instances_lifecycle.py
85 14 2
def post()
in source/soca/cluster_web_ui/api/v1/ldap/activedirectory/group.py
83 18 1
def create_vpc_endpoints()
in installer/resources/src/cdk_construct.py
82 13 1
def scheduler()
in installer/resources/src/cdk_construct.py
82 18 1
def index()
in source/soca/cluster_web_ui/views/my_files.py
81 22 0