microsoft / Docker-Provider
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 744 units with 15,356 lines of code in units (57.3% of code).
    • 25 very long units (3,893 lines of code)
    • 36 long units (2,613 lines of code)
    • 144 medium size units (4,562 lines of code)
    • 162 small units (2,400 lines of code)
    • 377 very small units (1,888 lines of code)
25% | 17% | 29% | 15% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rb22% | 16% | 30% | 17% | 12%
go57% | 13% | 16% | 7% | 4%
cs0% | 72% | 22% | 3% | 1%
py0% | 11% | 45% | 16% | 26%
cpp0% | 0% | 94% | 0% | 5%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/plugins28% | 16% | 28% | 15% | 11%
build/common44% | 22% | 14% | 13% | 5%
build/windows0% | 34% | 36% | 15% | 13%
build/linux0% | 10% | 45% | 19% | 24%
source/toml-parser0% | 0% | 0% | 43% | 57%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func PostDataHelper()
in source/plugins/go/src/oms.go
311 55 1
enumerate
in source/plugins/ruby/in_kube_nodes.rb
285 113 0
func InitializePlugin()
in source/plugins/go/src/oms.go
236 46 2
func flushKubeMonAgentEventRecords()
in source/plugins/go/src/oms.go
227 37 0
populateSettingValuesFromConfigMap
in build/common/installer/scripts/tomlparser-prom-customconfig.rb
207 103 1
getContainerResourceRequestsAndLimits
in source/plugins/ruby/KubernetesApiClient.rb
200 52 5
parse_and_emit_records
in source/plugins/ruby/in_kube_podinventory.rb
166 78 4
func PostTelegrafMetricsToLA()
in source/plugins/go/src/oms.go
157 31 1
getPodInventoryRecords
in source/plugins/ruby/in_kube_podinventory.rb
157 45 3
filter_stream
in source/plugins/ruby/filter_health_model_builder.rb
153 25 2
get_records
in source/plugins/ruby/health/health_container_cpu_memory_aggregator.rb
141 16 0
func SendContainerLogPluginMetrics()
in source/plugins/go/src/telemetry.go
134 23 1
update_state
in source/plugins/ruby/health/health_monitor_state.rb
132 24 0
getContainerInventoryRecords
in source/plugins/ruby/kubernetes_container_inventory.rb
131 39 4
enumerate
in source/plugins/ruby/in_kube_podinventory.rb
127 33 1
populateSettingValuesFromConfigMap
in build/common/installer/scripts/tomlparser.rb
117 86 1
enumerate
in source/plugins/ruby/in_kubestate_hpa.rb
117 35 0
getMetricNumericValue
in source/plugins/ruby/KubernetesApiClient.rb
116 37 2
filterPVInsightsMetrics
in source/plugins/ruby/filter_cadvisor2mdm.rb
114 33 1
enumerate
in source/plugins/ruby/in_kubestate_deployments.rb
114 34 0