awslabs / fleetiq-adapter-for-agones
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 61 units with 388 lines of code in units (38.2% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (56 lines of code)
    • 2 medium size units (68 lines of code)
    • 3 small units (45 lines of code)
    • 55 very small units (219 lines of code)
0% | 14% | 17% | 11% | 56%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 17% | 10% | 4% | 68%
go0% | 0% | 52% | 47% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
gamelift-daemon/src0% | 45% | 26% | 0% | 28%
pubsub/src0% | 0% | 69% | 30% | 0%
pubsub/src/configmap0% | 0% | 0% | 100% | 0%
gamelift-daemon/src/ec2_metadata0% | 0% | 0% | 6% | 93%
pubsub/app0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def initialize_game_server()
in gamelift-daemon/src/main.py
56 5 3
func publish()
in pubsub/src/main.go
36 6 1
def drain_pods()
in gamelift-daemon/src/main.py
32 5 0
func CanRead()
in pubsub/src/configmap/configmap.go
16 4 0
func main()
in pubsub/src/main.go
16 4 0
def _ensure_token_is_fresh()
in gamelift-daemon/src/ec2_metadata/ec2_metadata.py
13 3 1
def main()
in gamelift-daemon/src/main.py
10 2 2
def is_healthy()
in gamelift-daemon/src/main.py
9 1 1
def sigterm_handler()
in gamelift-daemon/src/main.py
9 2 2
def ipv4_associations()
in gamelift-daemon/src/ec2_metadata/ec2_metadata.py
8 2 1
def spot_instance_action()
in gamelift-daemon/src/ec2_metadata/ec2_metadata.py
7 5 1
def subnet_ipv6_cidr_blocks()
in gamelift-daemon/src/ec2_metadata/ec2_metadata.py
7 2 1
def termination_handler()
in gamelift-daemon/src/main.py
7 3 2
def _get_url()
in gamelift-daemon/src/ec2_metadata/ec2_metadata.py
6 3 3
def __init__()
in gamelift-daemon/src/ec2_metadata/ec2_metadata.py
6 2 3
def __eq__()
in gamelift-daemon/src/ec2_metadata/ec2_metadata.py
6 3 2
def __init__()
in gamelift-daemon/src/ec2_metadata/ec2_metadata.py
5 2 2
def iam_info()
in gamelift-daemon/src/ec2_metadata/ec2_metadata.py
5 2 1
def instance_profile_arn()
in gamelift-daemon/src/ec2_metadata/ec2_metadata.py
5 2 1
def instance_profile_id()
in gamelift-daemon/src/ec2_metadata/ec2_metadata.py
5 2 1