aws / amazon-ecs-agent
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 4,862 units with 39,629 lines of code in units (77.5% of code).
    • 1 very long units (183 lines of code)
    • 37 long units (2,409 lines of code)
    • 349 medium size units (10,333 lines of code)
    • 632 small units (9,189 lines of code)
    • 3,843 very small units (17,515 lines of code)
<1% | 6% | 26% | 23% | 44%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go<1% | 6% | 26% | 23% | 44%
c0% | 0% | 0% | 69% | 30%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
agent/engine3% | 10% | 36% | 22% | 26%
agent/api0% | 6% | 29% | 26% | 37%
agent/app0% | 15% | 31% | 25% | 26%
agent/acs0% | 11% | 23% | 18% | 46%
agent/dockerclient0% | 8% | 23% | 27% | 40%
agent/config0% | 14% | 30% | 37% | 17%
agent/handlers0% | 8% | 50% | 30% | 11%
agent/ecs_client0% | 2% | 4% | 15% | 77%
agent/taskresource0% | 2% | 25% | 18% | 53%
agent/stats0% | 8% | 47% | 20% | 23%
agent/wsclient0% | 11% | 26% | 17% | 44%
agent/tcs0% | 5% | 20% | 31% | 42%
misc/netkitten0% | 100% | 0% | 0% | 0%
agent/eni0% | 0% | 40% | 17% | 41%
agent/logger0% | 0% | 39% | 18% | 41%
agent/utils0% | 0% | 26% | 18% | 54%
agent/ecscni0% | 0% | 32% | 24% | 43%
agent/eventhandler0% | 0% | 42% | 37% | 20%
agent/statemanager0% | 0% | 43% | 29% | 27%
agent/gogenerate0% | 0% | 79% | 10% | 10%
agent/containermetadata0% | 0% | 27% | 34% | 37%
agent/metrics0% | 0% | 34% | 35% | 29%
agent/sighandlers0% | 0% | 67% | 29% | 2%
agent/asm0% | 0% | 6% | 26% | 67%
agent/ec20% | 0% | 10% | 2% | 86%
agent/ecr0% | 0% | 10% | 15% | 73%
agent/gpu0% | 0% | 14% | 16% | 68%
agent/data0% | 0% | 0% | 41% | 58%
agent/credentials0% | 0% | 0% | 49% | 50%
agent/doctor0% | 0% | 0% | 33% | 66%
agent/httpclient0% | 0% | 0% | 45% | 54%
agent/ssm0% | 0% | 0% | 49% | 50%
agent/s30% | 0% | 0% | 43% | 56%
agent/fsx0% | 0% | 0% | 47% | 52%
agent/async0% | 0% | 0% | 24% | 75%
agent/eventstream0% | 0% | 0% | 38% | 61%
misc/pause-container0% | 0% | 0% | 69% | 30%
misc/gremlin0% | 0% | 0% | 40% | 59%
agent/version0% | 0% | 0% | 45% | 54%
misc/exec-command-agent-test0% | 0% | 0% | 0% | 100%
agent0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in agent/engine/docker_task_engine.go
183 44 1
func()
in agent/app/agent.go
96 20 1
func()
in agent/acs/handler/acs_handler.go
92 7 1
func()
in agent/engine/docker_task_engine.go
92 23 1
func()
in agent/dockerclient/dockerapi/docker_client.go
84 14 1
func environmentConfig()
in agent/config/config.go
83 2 0
func()
in agent/dockerclient/dockerapi/docker_client.go
83 16 1
func()
in agent/engine/task_manager.go
77 13 1
func()
in agent/ecs_client/model/ecs/api.go
72 28 1
func()
in agent/acs/handler/payload_handler.go
71 14 1
func NewContainerResponse()
in agent/handlers/v2/response.go
71 10 3
func()
in agent/taskresource/firelens/firelensconfig_unix.go
69 14 1
func()
in agent/engine/task_manager.go
67 13 1
func()
in agent/stats/engine.go
67 17 1
func newAgent()
in agent/app/agent.go
66 9 2
func()
in agent/wsclient/client.go
65 11 1
func()
in agent/engine/docker_task_engine.go
65 14 1
func()
in agent/engine/task_manager.go
65 7 1
func DefaultConfig()
in agent/config/config_windows.go
63 1 0
func()
in agent/acs/update_handler/updater.go
63 9 1