microsoft / OMS-Agent-for-Linux
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 923 units with 13,553 lines of code in units (75.0% of code).
    • 1 very complex units (187 lines of code)
    • 3 complex units (277 lines of code)
    • 57 medium complex units (3,173 lines of code)
    • 104 simple units (2,953 lines of code)
    • 758 very simple units (6,963 lines of code)
1% | 2% | 23% | 21% | 51%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
rb1% | 2% | 22% | 18% | 54%
py0% | 0% | 24% | 33% | 41%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
source/code/plugins1% | 2% | 22% | 18% | 54%
source/code/troubleshooter/modules/install0% | 0% | 48% | 11% | 40%
source/code/troubleshooter/modules0% | 0% | 27% | 24% | 48%
source/code/troubleshooter/modules/connect0% | 0% | 61% | 0% | 38%
source/code/troubleshooter/modules/syslog_tst0% | 0% | 32% | 52% | 15%
source/code/troubleshooter/modules/high_cpu_mem0% | 0% | 26% | 55% | 17%
source/code/troubleshooter/modules/heartbeat0% | 0% | 35% | 55% | 8%
source/code/troubleshooter/modules/log_collector0% | 0% | 5% | 33% | 60%
tools/LogCollector/source0% | 0% | 5% | 33% | 60%
source/code/troubleshooter/modules/custom_logs0% | 0% | 22% | 77% | 0%
installer/scripts0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
self.getprotectionstatus
in source/code/plugins/collectmcafeeinfo.rb
187 71 1
getOSShortName
in source/code/plugins/patch_management_lib.rb
76 33 2
load_configuration
in source/code/plugins/oms_configuration.rb
113 29 3
transform_data
in source/code/plugins/mongostat_lib.rb
88 28 1
def get_data()
in source/code/troubleshooter/modules/install/check_files.py
62 25 5
npmd_reader
in source/code/plugins/in_npmd_server.rb
62 24 0
receive
in source/code/plugins/statsd_lib.rb
205 24 1
get_logger
in source/code/plugins/agent_common.rb
30 23 1
get_telemetry_data
in source/code/plugins/agent_topology_request_script.rb
49 23 3
create_blob_put_request
in source/code/plugins/out_oms_blob.rb
167 23 4
apply_request_intervals
in source/code/plugins/agent_maintenance_script.rb
93 20 1
def check_log_analytics_endpts()
in source/code/troubleshooter/modules/connect/check_endpts.py
50 20 0
def run_troubleshooter()
in source/code/troubleshooter/modules/main.py
95 19 0
run_job_and_wait
in source/code/plugins/oms_common.rb
80 18 1
shouldUploadNetworkAgentInfo
in source/code/plugins/in_npmd_server.rb
37 17 1
IsDiagSupported
in source/code/plugins/oms_diag_lib.rb
48 17 1
def check_installation()
in source/code/troubleshooter/modules/install/install.py
56 17 3
is_valid_dataitem
in source/code/plugins/in_npmd_server.rb
34 16 1
def check_heartbeat()
in source/code/troubleshooter/modules/heartbeat/heartbeat.py
43 16 2
def update_geninfo_all()
in source/code/troubleshooter/modules/helpers.py
35 16 0