awslabs / aws-serverless-metrics-publisher
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 18 units with 197 lines of code in units (62.7% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 4 medium size units (124 lines of code)
    • 4 small units (48 lines of code)
    • 10 very small units (25 lines of code)
0% | 0% | 62% | 24% | 12%
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% | 62% | 24% | 12%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
metricpublisher0% | 0% | 62% | 24% | 12%
Alternative Visuals
Longest Units
Top 18 longest units
Unit# linesMcCabe index# params
def metric_publisher()
in metricpublisher/publisher_handler.py
48 7 2
def format_metric()
in metricpublisher/publisher_handler.py
27 7 1
def unformat_metric()
in metricpublisher/publisher_handler.py
27 7 1
def log_event()
in metricpublisher/logger_handler.py
22 2 2
def _load_json_schema()
in metricpublisher/schema.py
13 2 1
def _error_response()
in metricpublisher/publisher_handler.py
12 2 1
def _error_response()
in metricpublisher/logger_handler.py
12 2 1
def batch_metrics()
in metricpublisher/publisher_handler.py
11 4 1
def convert_batch_to_event()
in metricpublisher/publisher_handler.py
6 2 1
def _validate()
in metricpublisher/schema.py
3 1 2
def get_log_group_name()
in metricpublisher/publisher_handler.py
2 1 0
def get_table_name()
in metricpublisher/publisher_handler.py
2 1 0
def get_namespace()
in metricpublisher/publisher_handler.py
2 1 0
def get_current_time()
in metricpublisher/publisher_handler.py
2 1 0
def validate_log_event_request()
in metricpublisher/schema.py
2 1 1
def get_log_group_name()
in metricpublisher/logger_handler.py
2 1 0
def get_namespace()
in metricpublisher/logger_handler.py
2 1 0
def get_current_time()
in metricpublisher/logger_handler.py
2 1 0