awslabs / aws-embedded-metrics-python
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 76 units with 406 lines of code in units (51.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (53 lines of code)
    • 3 simple units (62 lines of code)
    • 72 very simple units (291 lines of code)
0% | 0% | 13% | 15% | 71%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
py0% | 0% | 13% | 15% | 71%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
aws_embedded_metrics/serializers0% | 0% | 98% | 0% | 1%
aws_embedded_metrics/sinks0% | 0% | 0% | 33% | 66%
aws_embedded_metrics/metric_scope0% | 0% | 0% | 100% | 0%
aws_embedded_metrics/logger0% | 0% | 0% | 0% | 100%
aws_embedded_metrics/environment0% | 0% | 0% | 0% | 100%
aws_embedded_metrics/config0% | 0% | 0% | 0% | 100%
aws_embedded_metrics0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def serialize()
in aws_embedded_metrics/serializers/log_serializer.py
53 14 1
def send_message()
in aws_embedded_metrics/sinks/tcp_client.py
22 8 3
def metric_scope()
in aws_embedded_metrics/metric_scope/__init__.py
28 6 1
def get_endpoint()
in aws_embedded_metrics/sinks/agent_sink.py
12 6 0
def add_stack_trace()
in aws_embedded_metrics/logger/metrics_logger.py
25 5 4
def connect()
in aws_embedded_metrics/sinks/tcp_client.py
19 5 1
def get_dimensions()
in aws_embedded_metrics/logger/metrics_context.py
10 4 1
def configure_context()
in aws_embedded_metrics/environment/lambda_environment.py
8 3 2
def put_metric()
in aws_embedded_metrics/logger/metrics_context.py
6 3 4
def __configureContextForEnvironment()
in aws_embedded_metrics/logger/metrics_logger.py
8 3 2
def accept()
in aws_embedded_metrics/sinks/agent_sink.py
13 3 2
def accept()
in aws_embedded_metrics/sinks/stdout_sink.py
4 3 2
def get_name()
in aws_embedded_metrics/environment/ec2_environment.py
2 2 1
def get_type()
in aws_embedded_metrics/environment/ec2_environment.py
4 2 1
def get_log_group_name()
in aws_embedded_metrics/environment/ec2_environment.py
2 2 1
def configure_context()
in aws_embedded_metrics/environment/ec2_environment.py
7 2 2
def get_sink()
in aws_embedded_metrics/environment/ec2_environment.py
4 2 1
def get_env()
in aws_embedded_metrics/environment/lambda_environment.py
4 2 1
def get_name()
in aws_embedded_metrics/environment/default_environment.py
2 2 1
def get_type()
in aws_embedded_metrics/environment/default_environment.py
2 2 1