awslabs / aws-embedded-metrics-python
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 76 units with 406 lines of code in units (51.3% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (53 lines of code)
    • 3 medium size units (75 lines of code)
    • 5 small units (69 lines of code)
    • 67 very small units (209 lines of code)
0% | 13% | 18% | 16% | 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% | 13% | 18% | 16% | 51%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
aws_embedded_metrics/serializers0% | 98% | 0% | 0% | 1%
aws_embedded_metrics/metric_scope0% | 0% | 100% | 0% | 0%
aws_embedded_metrics/logger0% | 0% | 22% | 0% | 77%
aws_embedded_metrics/sinks0% | 0% | 21% | 43% | 34%
aws_embedded_metrics/config0% | 0% | 0% | 67% | 32%
aws_embedded_metrics/environment0% | 0% | 0% | 0% | 100%
aws_embedded_metrics0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def serialize()
in aws_embedded_metrics/serializers/log_serializer.py
53 14 1
def metric_scope()
in aws_embedded_metrics/metric_scope/__init__.py
28 6 1
def add_stack_trace()
in aws_embedded_metrics/logger/metrics_logger.py
25 5 4
def send_message()
in aws_embedded_metrics/sinks/tcp_client.py
22 8 3
def connect()
in aws_embedded_metrics/sinks/tcp_client.py
19 5 1
def get_configuration()
in aws_embedded_metrics/config/environment_configuration_provider.py
13 1 1
def accept()
in aws_embedded_metrics/sinks/agent_sink.py
13 3 2
def __init__()
in aws_embedded_metrics/config/configuration.py
12 1 0
def get_endpoint()
in aws_embedded_metrics/sinks/agent_sink.py
12 6 0
def get_dimensions()
in aws_embedded_metrics/logger/metrics_context.py
10 4 1
def create_copy_with_context()
in aws_embedded_metrics/logger/metrics_context.py
9 2 1
def configure_context()
in aws_embedded_metrics/environment/lambda_environment.py
8 3 2
def __configureContextForEnvironment()
in aws_embedded_metrics/logger/metrics_logger.py
8 3 2
def configure_context()
in aws_embedded_metrics/environment/ec2_environment.py
7 2 2
def __init__()
in aws_embedded_metrics/logger/metrics_context.py
6 1 0
def put_metric()
in aws_embedded_metrics/logger/metrics_context.py
6 3 4
def __get_env_var()
in aws_embedded_metrics/config/environment_configuration_provider.py
5 2 1
def __get_bool_env_var()
in aws_embedded_metrics/config/environment_configuration_provider.py
5 2 1
def get_socket_client()
in aws_embedded_metrics/sinks/agent_sink.py
5 2 1
def __init__()
in aws_embedded_metrics/sinks/agent_sink.py
5 1 4