microsoft / OMS-Agent-for-Linux
Duplication

Places in code with 6 or more lines that are exactly the same.

Intro
  • For duplication, we look at places in code where there are 6 or more lines of code that are exactly the same.
  • Before duplication is calculated, the code is cleaned to remove empty lines, comments, and frequently duplicated constructs such as imports.
  • You should aim at having as little as possible (<5%) of duplicated code as high-level of duplication can lead to maintenance difficulties, poor factoring, and logical contradictions.
Learn more...
Duplication Overall
  • 20% duplication:
    • 17,759 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 3,655 duplicated lines
  • 266 duplicates
system20% (3,655 lines)
Duplication per Extension
py47% (2,002 lines)
rb13% (1,615 lines)
cpp4% (26 lines)
ps12% (12 lines)
Duplication per Component (primary)
source/code/plugins12% (1,641 lines)
source/code/troubleshooter/modules/log_collector100% (953 lines)
tools/LogCollector/source100% (953 lines)
source/code/troubleshooter/modules/custom_logs17% (23 lines)
source/code/troubleshooter/modules/syslog_tst8% (23 lines)
source/code/troubleshooter/modules/high_cpu_mem7% (23 lines)
source/code/troubleshooter/modules1% (15 lines)
tools/OMIcheck2% (12 lines)
source/code/troubleshooter/modules/connect3% (6 lines)
source/code/troubleshooter/modules/heartbeat2% (6 lines)
installer/scripts0% (0 lines)
source/code/troubleshooter/modules/install0% (0 lines)
source/ext/patches/fluentd0% (0 lines)

Duplication Between Components (50+ lines)

G source/code/troubleshooter/modules/log_collector source/code/troubleshooter/modules/log_collector tools/LogCollector/source tools/LogCollector/source source/code/troubleshooter/modules/log_collector--tools/LogCollector/source 1906

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 20 longest duplicates.
See data for all 266 duplicates...
Size#FoldersFilesLinesCode
647 x 2 source/code/troubleshooter/modules/log_collector
tools/LogCollector/source
omslinux_agentlog.py
omslinux_agentlog.py
1:723 (100%)
1:723 (100%)
view
306 x 2 source/code/troubleshooter/modules/log_collector
tools/LogCollector/source
update_mgmt_health_check.py
update_mgmt_health_check.py
22:401 (100%)
22:401 (100%)
view
52 x 2 source/code/plugins
source/code/plugins
out_oms.rb
out_oms_changetracking_file.rb
145:217 (31%)
536:610 (10%)
view
23 x 2 source/code/troubleshooter/modules/custom_logs
source/code/troubleshooter/modules/high_cpu_mem
custom_logs.py
high_cpu_mem.py
34:63 (47%)
19:48 (51%)
view
23 x 2 source/code/troubleshooter/modules/high_cpu_mem
source/code/troubleshooter/modules/syslog_tst
high_cpu_mem.py
syslog.py
19:48 (51%)
17:46 (45%)
view
23 x 2 source/code/troubleshooter/modules/custom_logs
source/code/troubleshooter/modules/syslog_tst
custom_logs.py
syslog.py
34:63 (47%)
17:46 (45%)
view
22 x 2 source/code/plugins
source/code/plugins
filter_syslog.rb
filter_syslog_security.rb
11:40 (29%)
13:42 (31%)
view
22 x 2 source/code/plugins
source/code/plugins
in_oms_omi.rb
in_wlm_oms_omi.rb
28:51 (34%)
29:52 (36%)
view
18 x 2 source/code/plugins
source/code/plugins
in_oms_omi.rb
in_wlm_oms_omi.rb
57:77 (28%)
54:74 (29%)
view
18 x 2 source/code/plugins
source/code/plugins
out_oms.rb
out_oms_changetracking_file.rb
99:118 (11%)
505:524 (3%)
view
17 x 2 source/code/plugins
source/code/plugins
oms_omi_lib.rb
wlm_oms_omi_lib.rb
141:161 (11%)
71:91 (19%)
view
17 x 2 source/code/plugins
source/code/plugins
in_heartbeat_request.rb
in_omi.rb
47:64 (21%)
42:59 (25%)
view
17 x 2 source/code/plugins
source/code/plugins
in_heartbeat_request.rb
in_omi.rb
74:93 (21%)
61:81 (25%)
view
16 x 2 source/code/plugins
source/code/plugins
oms_common.rb
out_oms_blob.rb
725:743 (1%)
72:90 (5%)
view
15 x 2 source/code/troubleshooter/modules
tools/LogCollector/source
main.py
omslinux_agentlog.py
16:35 (8%)
27:48 (2%)
view
15 x 2 source/code/troubleshooter/modules/log_collector
source/code/troubleshooter/modules
omslinux_agentlog.py
main.py
27:48 (2%)
16:35 (8%)
view
14 x 2 source/code/plugins
source/code/plugins
npmd_config_lib.rb
npmd_config_lib.rb
1015:1028 (1%)
1047:1060 (1%)
view
13 x 2 source/code/plugins
source/code/plugins
out_oms.rb
out_oms_changetracking_file.rb
56:69 (7%)
385:400 (2%)
view
13 x 2 source/code/plugins
source/code/plugins
collectd_lib.rb
omi_lib.rb
59:74 (21%)
112:126 (14%)
view
13 x 2 source/code/plugins
source/code/plugins
agent_maintenance_script.rb
agent_telemetry_script.rb
582:596 (2%)
505:519 (2%)
view
Duplicated Units
The list of top 20 duplicated units.
See data for all 47 unit duplicates...
Size#FoldersFilesLinesCode
41 x 2 source/code/troubleshooter/modules/log_collector
tools/LogCollector/source
omslinux_agentlog.py
omslinux_agentlog.py
0:0 
0:0 
view
38 x 2 source/code/troubleshooter/modules/log_collector
tools/LogCollector/source
update_mgmt_health_check.py
update_mgmt_health_check.py
0:0 
0:0 
view
37 x 2 source/code/troubleshooter/modules/log_collector
tools/LogCollector/source
update_mgmt_health_check.py
update_mgmt_health_check.py
0:0 
0:0 
view
24 x 2 source/code/troubleshooter/modules/log_collector
tools/LogCollector/source
update_mgmt_health_check.py
update_mgmt_health_check.py
0:0 
0:0 
view
23 x 2 source/code/troubleshooter/modules/log_collector
tools/LogCollector/source
omslinux_agentlog.py
omslinux_agentlog.py
0:0 
0:0 
view
24 x 2 source/code/troubleshooter/modules/log_collector
tools/LogCollector/source
omslinux_agentlog.py
omslinux_agentlog.py
0:0 
0:0 
view
18 x 2 source/code/troubleshooter/modules/log_collector
tools/LogCollector/source
update_mgmt_health_check.py
update_mgmt_health_check.py
0:0 
0:0 
view
17 x 2 source/code/troubleshooter/modules/log_collector
tools/LogCollector/source
omslinux_agentlog.py
omslinux_agentlog.py
0:0 
0:0 
view
18 x 2 source/code/troubleshooter/modules/log_collector
tools/LogCollector/source
update_mgmt_health_check.py
update_mgmt_health_check.py
0:0 
0:0 
view
17 x 2 source/code/troubleshooter/modules/log_collector
tools/LogCollector/source
update_mgmt_health_check.py
update_mgmt_health_check.py
0:0 
0:0 
view
15 x 2 source/code/troubleshooter/modules/log_collector
tools/LogCollector/source
update_mgmt_health_check.py
update_mgmt_health_check.py
0:0 
0:0 
view
14 x 2 source/code/troubleshooter/modules/log_collector
tools/LogCollector/source
update_mgmt_health_check.py
update_mgmt_health_check.py
0:0 
0:0 
view
13 x 2 source/code/plugins
source/code/plugins
in_heartbeat_request.rb
in_omi.rb
75:89 
62:76 
view
13 x 2 source/code/plugins
source/code/plugins
in_oms_omi.rb
in_wlm_oms_omi.rb
59:73 
56:70 
view
16 x 3 source/code/troubleshooter/modules/log_collector
source/code/troubleshooter/modules
tools/LogCollector/source
omslinux_agentlog.py
main.py
omslinux_agentlog.py
0:0 
0:0 
0:0 
view
12 x 2 source/code/troubleshooter/modules/log_collector
tools/LogCollector/source
omslinux_agentlog.py
omslinux_agentlog.py
0:0 
0:0 
view
12 x 2 source/code/troubleshooter/modules/log_collector
tools/LogCollector/source
omslinux_agentlog.py
omslinux_agentlog.py
0:0 
0:0 
view
11 x 2 source/code/troubleshooter/modules/log_collector
tools/LogCollector/source
omslinux_agentlog.py
omslinux_agentlog.py
0:0 
0:0 
view
11 x 2 source/code/troubleshooter/modules/log_collector
tools/LogCollector/source
omslinux_agentlog.py
omslinux_agentlog.py
0:0 
0:0 
view
11 x 2 source/code/troubleshooter/modules/log_collector
tools/LogCollector/source
update_mgmt_health_check.py
update_mgmt_health_check.py
0:0 
0:0 
view