facebookresearch / Clinical-Trial-Parser
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
  • 5% duplication:
    • 4,285 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 239 duplicated lines
  • 26 duplicates
system5% (239 lines)
Duplication per Extension
go5% (211 lines)
py7% (28 lines)
Duplication per Component (primary)
common/util12% (36 lines)
common/trie26% (26 lines)
cmd/cfg27% (25 lines)
cmd/extract34% (25 lines)
cmd/search24% (20 lines)
cmd/nel10% (20 lines)
ct/variables8% (16 lines)
embedding14% (14 lines)
ie5% (14 lines)
vocabularies/mesh4% (14 lines)
vocabularies/taxonomy3% (13 lines)
ct/units5% (8 lines)
ct/parser<1% (8 lines)
vocabularies/umls0% (0 lines)
vocabularies0% (0 lines)
ct/relation0% (0 lines)
ct/studies0% (0 lines)
ct/eligibility0% (0 lines)
ct/criteria0% (0 lines)
common/param0% (0 lines)
common/resource0% (0 lines)
common/conf0% (0 lines)
common/lsh0% (0 lines)
common/col0% (0 lines)
text0% (0 lines)

Duplication Between Components (50+ lines)

G cmd/cfg cmd/cfg cmd/extract cmd/extract cmd/cfg--cmd/extract 50

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 26 duplicates...
Size#FoldersFilesLinesCode
25 x 2 src/cmd/cfg
src/cmd/extract
main.go
main.go
97:131 (27%)
70:104 (34%)
view
14 x 2 src/cmd/nel
src/cmd/search
main.go
main.go
143:160 (7%)
74:91 (17%)
view
10 x 2 src/common/util/fio
src/common/util/fio
file.go
file.go
27:36 (10%)
46:55 (10%)
view
8 x 2 src/ct/units
src/ct/variables
units.go
variables.go
111:120 (6%)
128:137 (5%)
view
8 x 2 src/common/util/fio
src/common/util/fio
file.go
file.go
27:34 (8%)
81:88 (8%)
view
8 x 2 src/ct/parser
src/ct/variables
tree.go
variable_type.go
84:91 (3%)
56:63 (20%)
view
8 x 2 src/common/util/fio
src/common/util/fio
file.go
file.go
46:53 (8%)
81:88 (8%)
view
8 x 2 src/common/util/fio
src/common/util/fio
file.go
file.go
65:72 (8%)
81:88 (8%)
view
8 x 2 src/common/util/fio
src/common/util/fio
file.go
file.go
27:34 (8%)
65:72 (8%)
view
8 x 2 src/common/util/fio
src/common/util/fio
file.go
file.go
46:53 (8%)
65:72 (8%)
view
7 x 2 src/common/trie
src/common/trie
trie.go
trie.go
54:60 (7%)
93:99 (7%)
view
7 x 2 src/cmd/extract
src/ct/variables
main.go
variables.go
78:86 (9%)
128:136 (4%)
view
7 x 2 src/vocabularies/mesh
src/vocabularies/mesh
categories.go
categories.go
14:20 (11%)
34:40 (11%)
view
7 x 2 src/cmd/extract
src/ct/units
main.go
units.go
78:86 (9%)
111:119 (5%)
view
7 x 2 src/embedding
src/ie
train_embeddings.py
ner.py
36:42 (9%)
38:44 (5%)
view
7 x 2 src/cmd/cfg
src/ct/variables
main.go
variables.go
105:113 (7%)
128:136 (4%)
view
7 x 2 src/ct/variables
src/vocabularies/taxonomy
variable_type.go
term.go
56:62 (17%)
136:142 (6%)
view
7 x 2 src/embedding
src/ie
train_embeddings.py
process_ner_data.py
28:34 (9%)
28:34 (5%)
view
7 x 2 src/cmd/cfg
src/ct/units
main.go
units.go
105:113 (7%)
111:119 (5%)
view
7 x 2 src/ct/parser
src/vocabularies/taxonomy
tree.go
term.go
84:90 (2%)
136:142 (6%)
view
Duplicated Units
The list of top 2 duplicated units.
See data for all 2 unit duplicates...
Size#FoldersFilesLinesCode
31 x 2 src/cmd/cfg
src/cmd/extract
main.go
main.go
96:132 
69:105 
view
13 x 2 src/ct/parser
src/ct/variables
tree.go
variable_type.go
83:96 
55:68 
view