microsoft / OMS-Agent-for-Linux
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 923 units with 13,553 lines of code in units (75.0% of code).
    • 7 very long units (1,051 lines of code)
    • 32 long units (2,123 lines of code)
    • 145 medium size units (4,454 lines of code)
    • 204 small units (3,026 lines of code)
    • 535 very small units (2,899 lines of code)
7% | 15% | 32% | 22% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rb10% | 18% | 28% | 20% | 22%
py0% | 6% | 47% | 28% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/code/plugins10% | 18% | 28% | 20% | 22%
source/code/troubleshooter/modules/install0% | 25% | 29% | 30% | 14%
source/code/troubleshooter/modules0% | 16% | 41% | 35% | 6%
source/code/troubleshooter/modules/high_cpu_mem0% | 0% | 74% | 19% | 6%
source/code/troubleshooter/modules/log_collector0% | 0% | 30% | 34% | 35%
tools/LogCollector/source0% | 0% | 30% | 34% | 35%
source/code/troubleshooter/modules/heartbeat0% | 0% | 85% | 5% | 8%
source/code/troubleshooter/modules/connect0% | 0% | 85% | 8% | 5%
source/code/troubleshooter/modules/syslog_tst0% | 0% | 55% | 40% | 3%
source/code/troubleshooter/modules/custom_logs0% | 0% | 100% | 0% | 0%
installer/scripts0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
receive
in source/code/plugins/statsd_lib.rb
205 24 1
self.getprotectionstatus
in source/code/plugins/collectmcafeeinfo.rb
187 71 1
create_blob_put_request
in source/code/plugins/out_oms_blob.rb
167 23 4
get_server_stats
in source/code/plugins/mysql_workload_lib.rb
144 11 0
transform_and_wrap
in source/code/plugins/security_baseline_lib.rb
133 12 3
load_configuration
in source/code/plugins/oms_configuration.rb
113 29 3
discover
in source/code/plugins/in_wlm_discovery.rb
102 13 0
def run_troubleshooter()
in source/code/troubleshooter/modules/main.py
95 19 0
apply_request_intervals
in source/code/plugins/agent_maintenance_script.rb
93 20 1
transform_data
in source/code/plugins/mongostat_lib.rb
88 28 1
initialize
in source/code/plugins/wlm_ad_pe_lib.rb
87 10 2
write
in source/code/plugins/out_oms_changetracking_file.rb
82 5 1
run_job_and_wait
in source/code/plugins/oms_common.rb
80 18 1
create_secure_http
in source/code/plugins/oms_common.rb
77 15 2
getOSShortName
in source/code/plugins/patch_management_lib.rb
76 33 2
transform_and_wrap
in source/code/plugins/process_investigator_lib.rb
72 11 1
self.createERElements
in source/code/plugins/npmd_config_lib.rb
70 12 1
self.push_qos_event
in source/code/plugins/agent_telemetry_script.rb
68 14 7
transform_and_wrap
in source/code/plugins/antimalware_lib.rb
68 4 3
safe_dump_simple_hash_array
in source/code/plugins/oms_common.rb
68 12 1