facebookresearch / Kats
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
  • 14% duplication:
    • 18,928 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 2,785 duplicated lines
  • 346 duplicates
system14% (2,785 lines)
Duplication per Extension
py14% (2,785 lines)
Duplication per Component (primary)
kats/models17% (1,525 lines)
kats/detectors10% (611 lines)
kats/utils21% (543 lines)
kats/tsfeatures6% (82 lines)
kats/graphics11% (12 lines)
kats1% (12 lines)
ROOT0% (0 lines)
sphinx/source0% (0 lines)
kats/evaluation0% (0 lines)
kats/data0% (0 lines)

Duplication Between Components (50+ lines)

G kats/models kats/models kats/utils kats/utils kats/models--kats/utils 224 kats/tsfeatures kats/tsfeatures kats/models--kats/tsfeatures 130 kats/detectors kats/detectors kats/detectors--kats/models 84

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 346 duplicates...
Size#FoldersFilesLinesCode
55 x 2 kats/models/nowcasting
kats/models/nowcasting
dynamic_nowcasting.py
nowcastingplus.py
83:154 (32%)
82:153 (41%)
view
37 x 2 kats/models/metalearner
kats/utils
get_metadata.py
backtesters.py
333:373 (14%)
183:234 (5%)
view
37 x 2 kats/models/globalmodel
kats/models/globalmodel
ensemble.py
model.py
423:477 (9%)
837:889 (4%)
view
36 x 2 kats/utils
kats/utils
time_series_parameter_tuning.py
time_series_parameter_tuning.py
697:732 (6%)
795:830 (6%)
view
25 x 2 kats/models/nowcasting
kats/tsfeatures
feature_extraction.py
tsfeatures.py
219:251 (12%)
1733:1765 (2%)
view
23 x 2 kats/models/globalmodel
kats/utils
backtester.py
backtesters.py
526:550 (5%)
299:323 (3%)
view
22 x 2 kats/detectors
kats/detectors
stat_sig_detector.py
stat_sig_detector.py
501:533 (3%)
850:880 (3%)
view
22 x 2 kats/utils
kats/utils
parameter_tuning_utils.py
parameter_tuning_utils.py
186:207 (11%)
276:297 (11%)
view
22 x 2 kats/models/globalmodel
kats/models/globalmodel
utils.py
utils.py
633:657 (1%)
741:763 (1%)
view
20 x 2 kats/models/globalmodel
kats/models/globalmodel
ensemble.py
model.py
479:498 (5%)
891:910 (2%)
view
19 x 2 kats/models/ensemble
kats/models/ensemble
kats_ensemble.py
kats_ensemble.py
305:325 (3%)
598:618 (3%)
view
19 x 2 kats/models/globalmodel
kats/models/globalmodel
utils.py
utils.py
659:691 (1%)
766:799 (1%)
view
19 x 2 kats/models
kats/models
prophet.py
prophet.py
153:171 (6%)
271:289 (6%)
view
18 x 2 kats/models/metalearner
kats/utils
get_metadata.py
backtesters.py
379:397 (6%)
238:260 (2%)
view
18 x 2 kats/detectors
kats/detectors
changepoint_evaluator.py
changepoint_evaluator.py
465:484 (4%)
513:532 (4%)
view
18 x 2 kats/models/ensemble
kats/models/ensemble
kats_ensemble.py
weighted_avg_ensemble.py
756:788 (3%)
52:84 (21%)
view
18 x 2 kats/utils
kats/utils
backtesters.py
backtesters.py
449:466 (2%)
833:850 (2%)
view
17 x 2 kats/models/nowcasting
kats/models/nowcasting
dynamic_nowcasting.py
nowcastingplus.py
289:320 (9%)
227:257 (12%)
view
16 x 2 kats/models/nowcasting
kats/tsfeatures
feature_extraction.py
tsfeatures.py
171:188 (8%)
1685:1702 (1%)
view
15 x 2 kats/utils
kats/utils
backtesters.py
emp_confidence_int.py
836:850 (2%)
76:90 (7%)
view
Duplicated Units
The list of top 16 duplicated units.
See data for all 16 unit duplicates...
Size#FoldersFilesLinesCode
10 x 2 kats/models/nowcasting
kats/models/nowcasting
dynamic_nowcasting.py
nowcastingplus.py
0:0 
0:0 
view
12 x 2 kats/models/globalmodel
kats/models/globalmodel
utils.py
utils.py
0:0 
0:0 
view
8 x 2 kats/models/ensemble
kats/models/ensemble
weighted_avg_ensemble.py
median_ensemble.py
0:0 
0:0 
view
8 x 2 kats/detectors
kats/detectors
detector_consts.py
detector_consts.py
0:0 
0:0 
view
8 x 2 kats/detectors
kats/detectors
changepoint_evaluator.py
changepoint_evaluator.py
0:0 
0:0 
view
7 x 3 kats/models
kats/models
kats/models
holtwinters.py
linear_model.py
quadratic_model.py
0:0 
0:0 
0:0 
view
7 x 2 kats/models/globalmodel
kats/models/globalmodel
model.py
ensemble.py
0:0 
0:0 
view
7 x 2 kats/models/globalmodel
kats/models/globalmodel
model.py
ensemble.py
0:0 
0:0 
view
7 x 2 kats/models/globalmodel
kats/models/globalmodel
utils.py
utils.py
0:0 
0:0 
view
7 x 2 kats/detectors
kats/detectors
threshold_detector.py
cusum_model.py
0:0 
0:0 
view
7 x 2 kats/models/ensemble
kats/models/ensemble
weighted_avg_ensemble.py
kats_ensemble.py
0:0 
0:0 
view
6 x 2 kats/models/nowcasting
kats/tsfeatures
feature_extraction.py
tsfeatures.py
0:0 
0:0 
view
6 x 2 kats/detectors
kats/detectors
residual_translation.py
residual_translation.py
0:0 
0:0 
view
13 x 2 kats/utils
kats/utils
backtesters.py
backtesters.py
0:0 
0:0 
view
7 x 2 kats/models/nowcasting
kats/models/nowcasting
dynamic_nowcasting.py
nowcastingplus.py
0:0 
0:0 
view
6 x 2 kats/detectors
kats/detectors
threshold_detector.py
prophet_detector.py
0:0 
0:0 
view