aws / amazon-codeguru-profiler-python-agent
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 268 units with 1,821 lines of code in units (81.5% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 10 medium size units (300 lines of code)
    • 43 small units (581 lines of code)
    • 215 very small units (940 lines of code)
0% | 0% | 16% | 31% | 51%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 16% | 31% | 51%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
codeguru_profiler_agent0% | 0% | 19% | 42% | 37%
codeguru_profiler_agent/sdk_reporter0% | 0% | 25% | 30% | 43%
codeguru_profiler_agent/agent_metadata0% | 0% | 17% | 14% | 68%
codeguru_profiler_agent/reporter0% | 0% | 21% | 34% | 44%
codeguru_profiler_agent/aws_lambda0% | 0% | 22% | 27% | 50%
codeguru_profiler_agent/model0% | 0% | 13% | 7% | 79%
ROOT0% | 0% | 0% | 60% | 39%
codeguru_profiler_agent/utils0% | 0% | 0% | 29% | 70%
codeguru_profiler_agent/metrics0% | 0% | 0% | 43% | 56%
codeguru_profiler_agent/file_reporter0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in codeguru_profiler_agent/__main__.py
50 7 3
def __init__()
in codeguru_profiler_agent/profiler.py
45 9 5
def refresh_configuration()
in codeguru_profiler_agent/sdk_reporter/sdk_reporter.py
32 8 1
def build_profiler()
in codeguru_profiler_agent/profiler_builder.py
31 8 8
def report()
in codeguru_profiler_agent/sdk_reporter/sdk_reporter.py
29 5 2
def serialize_to_json()
in codeguru_profiler_agent/agent_metadata/agent_metadata.py
26 3 8
def get_metadata_for_configure_agent_call()
in codeguru_profiler_agent/agent_metadata/aws_lambda.py
24 7 2
def _get_new_config()
in codeguru_profiler_agent/reporter/agent_configuration.py
21 1 2
def __init__()
in codeguru_profiler_agent/model/profile.py
21 1 7
def with_lambda_profiler()
in codeguru_profiler_agent/aws_lambda/profiler_decorator.py
21 4 3
def with_timer()
in codeguru_profiler_agent/metrics/with_timer.py
20 4 2
def main()
in release_layer.py
20 4 0
def _report_profile()
in codeguru_profiler_agent/local_aggregator.py
18 3 2
def _set_default_environment()
in codeguru_profiler_agent/profiler.py
18 1 1
def _get_region_or_default()
in codeguru_profiler_agent/codeguru_client_builder.py
18 10 1
def is_sampling_cpu_usage_limit_reached()
in codeguru_profiler_agent/profiler_disabler.py
17 4 2
def __init__()
in codeguru_profiler_agent/utils/scheduler.py
16 4 4
16 4 4
def increment_sdk_error()
in codeguru_profiler_agent/agent_metadata/agent_debug_info.py
15 6 2
def is_overall_cpu_usage_limit_reached()
in codeguru_profiler_agent/profiler_disabler.py
15 5 2