kubernetes / node-problem-detector
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
  • 7% duplication:
    • 4,107 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 302 duplicated lines
  • 13 duplicates
system7% (302 lines)
Duplication per Extension
yaml53% (154 lines)
go3% (148 lines)
Duplication per Component (primary)
deployment56% (154 lines)
pkg/util11% (66 lines)
pkg/systemlogmonitor6% (34 lines)
pkg/healthchecker8% (20 lines)
pkg/custompluginmonitor3% (16 lines)
pkg/systemstatsmonitor1% (12 lines)
cmd/options0% (0 lines)
cmd/healthchecker0% (0 lines)
cmd/nodeproblemdetector0% (0 lines)
cmd/logcounter0% (0 lines)
pkg/problemdaemon0% (0 lines)
pkg/version0% (0 lines)
pkg/problemmetrics0% (0 lines)
pkg/types0% (0 lines)
pkg/problemdetector0% (0 lines)
pkg/exporters0% (0 lines)
pkg/logcounter0% (0 lines)
ROOT0% (0 lines)
config/plugin0% (0 lines)
Longest Duplicates
The list of 13 longest duplicates.
See data for all 13 duplicates...
Size#FoldersFilesLinesCode
31 x 2 deployment
deployment
node-problem-detector-healthchecker.yaml
node-problem-detector.yaml
1:31 (31%)
1:31 (37%)
view
28 x 2 deployment
deployment
node-problem-detector-healthchecker.yaml
node-problem-detector.yaml
34:63 (28%)
33:62 (33%)
view
18 x 2 deployment
deployment
node-problem-detector-healthchecker.yaml
node-problem-detector.yaml
72:90 (18%)
63:81 (21%)
view
14 x 2 pkg/util/metrics
pkg/util/metrics
metric_float64.go
metric_int64.go
46:64 (31%)
46:64 (31%)
view
12 x 2 pkg/util/metrics
pkg/util/metrics
metric_float64.go
metric_int64.go
83:99 (26%)
83:99 (26%)
view
10 x 2 pkg/healthchecker
pkg/healthchecker
health_checker_linux.go
health_checker_windows.go
85:99 (27%)
96:110 (22%)
view
9 x 2 pkg/custompluginmonitor
pkg/systemlogmonitor
custom_plugin_monitor.go
log_monitor.go
96:106 (5%)
95:105 (6%)
view
7 x 2 pkg/util/metrics
pkg/util/metrics
metric_float64.go
metric_int64.go
68:75 (15%)
68:75 (15%)
view
7 x 2 pkg/custompluginmonitor
pkg/systemlogmonitor
custom_plugin_monitor.go
log_monitor.go
304:311 (3%)
243:250 (4%)
view
6 x 2 pkg/systemstatsmonitor
pkg/systemstatsmonitor
system_stats_monitor.go
system_stats_monitor.go
124:129 (7%)
135:140 (7%)
view
6 x 2 pkg/systemlogmonitor/logwatchers/filelog
pkg/systemlogmonitor/logwatchers/journald
log_watcher.go
log_watcher.go
49:55 (8%)
52:58 (5%)
view
6 x 2 pkg/systemlogmonitor/logwatchers/filelog
pkg/systemlogmonitor/logwatchers/kmsg
log_watcher.go
log_watcher_linux.go
49:55 (8%)
46:52 (10%)
view
6 x 2 pkg/systemlogmonitor/logwatchers/journald
pkg/systemlogmonitor/logwatchers/kmsg
log_watcher.go
log_watcher_linux.go
52:58 (5%)
46:52 (10%)
view
Duplicated Units
The list of top 3 duplicated units.
See data for all 3 unit duplicates...
Size#FoldersFilesLinesCode
15 x 2 pkg/util/metrics
pkg/util/metrics
metric_int64.go
metric_float64.go
82:100 
82:100 
view
14 x 2 pkg/custompluginmonitor
pkg/systemlogmonitor
custom_plugin_monitor.go
log_monitor.go
95:109 
94:108 
view
8 x 2 pkg/custompluginmonitor
pkg/systemlogmonitor
custom_plugin_monitor.go
log_monitor.go
304:312 
243:251 
view