neo-ai / treelite
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
  • 9% duplication:
    • 7,804 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 763 duplicated lines
  • 55 duplicates
system9% (763 lines)
Duplication per Extension
py16% (262 lines)
cc4% (166 lines)
cmake65% (160 lines)
h4% (80 lines)
yml26% (71 lines)
java6% (24 lines)
Duplication per Component (primary)
python/treelite17% (199 lines)
runtime/native16% (173 lines)
cmake62% (103 lines)
src/compiler4% (72 lines)
ROOT26% (71 lines)
src/frontend4% (58 lines)
include/treelite5% (41 lines)
runtime/java3% (24 lines)
src/c_api4% (22 lines)
src0% (0 lines)
src/common0% (0 lines)
python0% (0 lines)

Duplication Between Components (50+ lines)

G cmake cmake runtime/native runtime/native cmake--runtime/native 114 python/treelite python/treelite python/treelite--runtime/native 98

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 55 duplicates...
Size#FoldersFilesLinesCode
57 x 2 cmake
runtime/native/cmake
cmake
Utils.cmake
Utils.cmake
1:64 (34%)
23:86 (73%)
view
19 x 2 python/treelite
runtime/native/python/treelite_runtime
libpath.py
libpath.py
49:73 (51%)
50:74 (50%)
view
18 x 2 cmake
cmake
cmake
Utils.cmake
Utils.cmake
134:154 (10%)
163:183 (10%)
view
17 x 2 python/treelite/contrib
python/treelite/contrib
__init__.py
__init__.py
63:80 (16%)
187:204 (16%)
view
16 x 2 python/treelite
runtime/native/python/treelite_runtime
libpath.py
libpath.py
13:47 (43%)
14:48 (42%)
view
15 x 2 python/treelite
python/treelite
frontend.py
frontend.py
508:523 (4%)
562:577 (4%)
view
12 x 2 include/treelite
src/frontend
tree.h
xgboost.cc
30:51 (6%)
186:202 (3%)
view
11 x 2 python/treelite
python/treelite
frontend.py
frontend.py
440:452 (2%)
508:518 (2%)
view
11 x 2 python/treelite
python/treelite
frontend.py
frontend.py
440:452 (2%)
562:572 (2%)
view
10 x 2 runtime/native/src
runtime/native/src
predictor.cc
predictor.cc
100:109 (3%)
134:143 (3%)
view
10 x 2 cmake
cmake
cmake
Utils.cmake
Utils.cmake
96:106 (6%)
142:152 (6%)
view
10 x 2 ROOT
ROOT
azure-pipelines.yml
azure-pipelines.yml
36:45 (3%)
189:198 (3%)
view
10 x 2 cmake
cmake
cmake
Utils.cmake
Utils.cmake
96:106 (6%)
171:181 (6%)
view
9 x 2 ROOT
ROOT
azure-pipelines.yml
azure-pipelines.yml
132:140 (3%)
151:159 (3%)
view
9 x 2 src/frontend
src/frontend
builder.cc
builder.cc
371:379 (2%)
385:393 (2%)
view
9 x 2 runtime/java/treelite4j/...java/ml/dmlc/treelite4j
runtime/java/treelite4j/...java/ml/dmlc/treelite4j
DenseBatch.java
SparseBatch.java
36:57 (33%)
40:61 (30%)
view
9 x 2 ROOT
ROOT
azure-pipelines.yml
azure-pipelines.yml
100:108 (3%)
151:159 (3%)
view
9 x 2 src/compiler
src/compiler
ast_native.cc
failsafe.cc
114:125 (1%)
364:375 (3%)
view
9 x 2 ROOT
ROOT
azure-pipelines.yml
azure-pipelines.yml
100:108 (3%)
132:140 (3%)
view
9 x 2 ROOT
ROOT
azure-pipelines.yml
azure-pipelines.yml
6:14 (3%)
151:159 (3%)
view
Duplicated Units
The list of top 2 duplicated units.
See data for all 2 unit duplicates...
Size#FoldersFilesLinesCode
8 x 2 runtime/native/include/treelite
include/treelite
common.h
common.h
35:43 
425:433 
view
6 x 2 runtime/native/include/treelite
runtime/native/include/treelite
predictor.h
predictor.h
129:135 
144:150 
view