aws-samples / dynamically-adjust-aws-xray-sampling-rules
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 12 units with 90 lines of code in units (30.9% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 0 medium size units (0 lines of code)
    • 2 small units (31 lines of code)
    • 10 very small units (59 lines of code)
0% | 0% | 0% | 34% | 65%
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% | 0% | 34% | 65%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
api0% | 0% | 0% | 68% | 32%
custom_resource0% | 0% | 0% | 31% | 68%
xray_rule_adjuster0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 12 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in api/handler.py
17 3 2
def create_configuration()
in custom_resource/handler.py
14 1 1
def update()
in custom_resource/handler.py
9 3 2
8 3 0
def adjust_sampling_rate()
in xray_rule_adjuster/handler.py
8 1 2
6 1 1
def deserialize_sampling_rule_name()
in custom_resource/handler.py
6 2 1
def lambda_handler()
in xray_rule_adjuster/handler.py
6 3 2
def get_alarm_state()
in xray_rule_adjuster/handler.py
6 2 1
def create()
in custom_resource/handler.py
5 3 2
def delete()
in custom_resource/handler.py
3 2 2
def lambda_handler()
in custom_resource/handler.py
2 1 2