instagram / LibCST
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
  • 12% duplication:
    • 37,988 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 4,633 duplicated lines
  • 1,187 duplicates
system12% (4,633 lines)
Duplication per Extension
py12% (3,289 lines)
rs12% (1,338 lines)
pyi3% (6 lines)
Duplication per Component (primary)
native/libcst11% (1,237 lines)
libcst/_nodes19% (1,028 lines)
libcst/_parser15% (817 lines)
libcst/matchers34% (646 lines)
libcst6% (441 lines)
libcst/codemod5% (219 lines)
native/libcst_derive32% (101 lines)
libcst/codegen8% (63 lines)
libcst/metadata3% (53 lines)
libcst/helpers5% (22 lines)
stubs/libcst_native6% (6 lines)
stubs0% (0 lines)
stubs/libcst0% (0 lines)
ROOT0% (0 lines)
native0% (0 lines)
libcst/testing0% (0 lines)

Duplication Between Components (50+ lines)

G libcst libcst libcst/matchers libcst/matchers libcst--libcst/matchers 527 libcst/_parser libcst/_parser libcst/_parser--libcst 246 libcst/_parser--libcst/matchers 164

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 50 longest duplicates.
See data for all 1,187 duplicates...
Size#FoldersFilesLinesCode
179 x 2 libcst
libcst/matchers
18:200 (3%)
13:196 (52%)
view
110 x 2 libcst
libcst/matchers
32:144 (26%)
23:136 (32%)
view
110 x 2 libcst
libcst
32:144 (26%)
28:140 (1%)
view
59 x 2 libcst
libcst/matchers
146:205 (14%)
137:196 (17%)
view
59 x 2 libcst
libcst
146:205 (14%)
141:200 (1%)
view
54 x 2 libcst/matchers
libcst/matchers
565:657 (10%)
760:852 (10%)
view
33 x 2 libcst/_parser/conversions
libcst
22:54 (2%)
28:60 (<1%)
view
33 x 2 libcst
libcst/_parser/conversions
32:64 (7%)
22:54 (2%)
view
33 x 2 libcst/_parser/conversions
libcst/matchers
22:54 (2%)
23:55 (9%)
view
30 x 2 libcst/_parser/parso/python
libcst/_parser/parso/python
585:620 (3%)
943:978 (3%)
view
28 x 2 libcst/_parser/parso/python
libcst/_parser/parso/python
778:805 (3%)
1078:1105 (3%)
view
24 x 2 native/libcst_derive/src
native/libcst_derive/src
26:58 (60%)
46:78 (36%)
view
23 x 2 native/libcst_derive/src
native/libcst_derive/src
27:58 (57%)
27:58 (57%)
view
23 x 2 native/libcst_derive/src
native/libcst_derive/src
27:58 (57%)
47:78 (35%)
view
22 x 2 libcst/_nodes
libcst/_nodes
3298:3321 (1%)
2192:2215 (<1%)
view
22 x 2 libcst/_parser/parso/python
libcst/_parser/parso/python
727:761 (2%)
1033:1067 (2%)
view
21 x 2 libcst/matchers
libcst/matchers
1392:1412 (2%)
1475:1495 (2%)
view
21 x 2 libcst/_parser/parso/python
libcst/_parser/parso/python
506:530 (2%)
869:893 (2%)
view
20 x 2 libcst/_parser/parso/python
libcst/_parser/parso/python
551:573 (2%)
910:932 (2%)
view
18 x 2 libcst/_nodes
libcst/_nodes
1041:1060 (<1%)
1110:1129 (<1%)
view
17 x 2 libcst/codemod/commands
libcst/codemod/commands
610:627 (3%)
661:678 (3%)
view
17 x 2 libcst/_nodes
libcst/_nodes
2856:2878 (<1%)
2896:2920 (<1%)
view
17 x 2 libcst/matchers
libcst/matchers
785:815 (1%)
888:919 (1%)
view
16 x 2 libcst/_parser/parso/python
libcst/_parser/parso/python
532:548 (1%)
893:909 (1%)
view
15 x 2 libcst/_nodes
libcst/_nodes
3140:3155 (<1%)
3198:3213 (<1%)
view
15 x 2 libcst/_nodes
libcst/_nodes
1022:1037 (<1%)
1093:1108 (<1%)
view
15 x 2 native/libcst/src/nodes
native/libcst/src/nodes
1446:1460 (<1%)
2064:2078 (<1%)
view
15 x 2 native/libcst/src/nodes
native/libcst/src/nodes
813:828 (<1%)
2065:2080 (<1%)
view
15 x 2 native/libcst/src/nodes
native/libcst/src/nodes
1854:1871 (<1%)
1907:1924 (<1%)
view
15 x 2 libcst/matchers
libcst/matchers
1624:1638 (1%)
1779:1793 (1%)
view
15 x 2 libcst/_nodes
libcst/_nodes
3351:3365 (<1%)
2221:2235 (<1%)
view
15 x 2 native/libcst/src/tokenizer
native/libcst/src/tokenizer
695:711 (2%)
715:731 (2%)
view
14 x 2 native/libcst/src/tokenizer/text_position
native/libcst/src/tokenizer/text_position
292:310 (6%)
314:332 (6%)
view
14 x 2 libcst/_nodes
libcst/_nodes
1794:1809 (<1%)
1937:1952 (<1%)
view
14 x 2 native/libcst/src/nodes
native/libcst/src/nodes
1832:1848 (<1%)
1885:1901 (<1%)
view
14 x 2 native/libcst/src/nodes
native/libcst/src/nodes
813:826 (<1%)
1447:1460 (<1%)
view
14 x 2 libcst/_parser/parso/python
libcst/_parser/parso/python
461:478 (1%)
851:868 (1%)
view
14 x 2 native/libcst/src/nodes
native/libcst/src/nodes
1359:1373 (<1%)
1401:1415 (<1%)
view
13 x 2 libcst/_nodes
libcst/_nodes
836:850 (<1%)
910:924 (<1%)
view
13 x 2 libcst/_parser/parso/python
libcst/_parser/parso/python
711:723 (1%)
1020:1032 (1%)
view
13 x 2 libcst/_nodes
libcst/_nodes
529:543 (<1%)
957:971 (<1%)
view
13 x 2 libcst/matchers
libcst/matchers
1126:1141 (1%)
1172:1187 (1%)
view
13 x 2 native/libcst/src/tokenizer/text_position
native/libcst/src/tokenizer/text_position
260:272 (5%)
269:281 (5%)
view
12 x 2 native/libcst/src/tokenizer/text_position
native/libcst/src/tokenizer/text_position
292:305 (5%)
336:349 (5%)
view
12 x 2 libcst/matchers
libcst/matchers
1626:1637 (1%)
1657:1674 (1%)
view
12 x 2 libcst/matchers
libcst/matchers
1794:1805 (1%)
1884:1895 (1%)
view
12 x 2 libcst/matchers
libcst/matchers
1657:1674 (1%)
1781:1792 (1%)
view
12 x 2 native/libcst/src/tokenizer/text_position
native/libcst/src/tokenizer/text_position
314:327 (5%)
336:349 (5%)
view
12 x 2 libcst/_nodes
libcst/_nodes
2236:2249 (<1%)
2312:2325 (<1%)
view
12 x 2 libcst/codemod/visitors
libcst/codemod/visitors
372:383 (4%)
400:411 (4%)
view