microsoft / pxt-arcade
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
  • 10% duplication:
    • 8,427 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 888 duplicated lines
  • 99 duplicates
system10% (888 lines)
Duplication per Extension
ts11% (600 lines)
tsx17% (274 lines)
css1% (7 lines)
less5% (7 lines)
Duplication per Component (primary)
share/src13% (756 lines)
libs/corgio42% (92 lines)
libs/screen---ext100% (11 lines)
libs/screen91% (11 lines)
libs/screen---linux100% (11 lines)
theme5% (7 lines)
docfiles0% (0 lines)
editor0% (0 lines)
libs/base0% (0 lines)
libs/blocksprj0% (0 lines)
libs/darts0% (0 lines)
libs/device0% (0 lines)
libs/game0% (0 lines)
libs/hw---n30% (0 lines)
libs/hw---n40% (0 lines)
libs/hw---rpi0% (0 lines)
libs/hw---samd510% (0 lines)
libs/hw---stm32f4010% (0 lines)
libs/hw---vm0% (0 lines)
libs/hw0% (0 lines)
libs/light0% (0 lines)
libs/rotary-encoder0% (0 lines)
libs/screen---st77350% (0 lines)
libs/servo0% (0 lines)
libs/sevenseg0% (0 lines)
libs/storage0% (0 lines)
libs/template0% (0 lines)
scripts0% (0 lines)
ROOT0% (0 lines)
share/public0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 99 duplicates...
Size#FoldersFilesLinesCode
48 x 2 share/src/components
share/src/games/bunny_hop
ColorPicker.tsx
main.ts.ts
129:176 (24%)
266:313 (7%)
view
45 x 2 share/src/components
share/src/games/bunny_hop
ColorPicker.tsx
main.ts.ts
83:127 (22%)
220:264 (6%)
view
38 x 2 share/src/components
share/src/games/bunny_hop
ColorPicker.tsx
main.ts.ts
188:225 (19%)
325:362 (5%)
view
32 x 2 share/src/components
share/src/games/bunny_hop
GameModder.tsx
main.ts.ts
122:153 (4%)
150:181 (4%)
view
23 x 2 share/src/games/bunny_hop
share/src/games/bunny_hop
main.ts.ts
main.ts.ts
63:85 (3%)
76:98 (3%)
view
21 x 2 share/src/components
share/src/games/bunny_hop
GameModder.tsx
main.ts.ts
99:119 (3%)
569:589 (3%)
view
20 x 2 share/src/games/bunny_hop
share/src/games/bunny_hop
main.ts.ts
main.ts.ts
50:69 (3%)
89:108 (3%)
view
20 x 2 share/src/components
share/src/games/bunny_hop
GameModder.tsx
main.ts.ts
168:187 (3%)
195:214 (3%)
view
19 x 2 share/src/games/bunny_hop
share/src/games/bunny_hop
main.ts.ts
main.ts.ts
21:39 (2%)
112:130 (2%)
view
19 x 2 share/src/sprite-editor
share/src/sprite-editor
tools.ts
tools.ts
142:165 (6%)
289:312 (6%)
view
19 x 2 share/src/games/bunny_hop
share/src/games/bunny_hop
main.ts.ts
main.ts.ts
36:54 (2%)
101:119 (2%)
view
18 x 2 libs/corgio
libs/corgio
corgio.ts
corgio.ts
35:52 (8%)
55:72 (8%)
view
15 x 2 share/src
share/src/sprite-editor
bitmap_helpers.ts
spriteEditor.ts
110:124 (11%)
45:59 (3%)
view
12 x 2 share/src/games/bunny_hop
share/src/games/bunny_hop
main.ts.ts
main.ts.ts
13:24 (1%)
130:141 (1%)
view
12 x 2 share/src/sprite-editor
share/src/sprite-editor
tools.ts
tools.ts
180:200 (3%)
253:274 (3%)
view
11 x 2 libs/screen---ext
libs/screen---linux
targetoverrides.ts
targetoverrides.ts
6:25 (100%)
6:25 (100%)
view
11 x 2 share/src/games/bunny_hop
share/src/games/bunny_hop
main.ts.ts
main.ts.ts
49:59 (1%)
62:72 (1%)
view
11 x 2 libs/screen---ext
libs/screen
targetoverrides.ts
targetoverrides.ts
6:25 (100%)
6:25 (100%)
view
11 x 2 libs/corgio
libs/corgio
corgio.ts
corgio.ts
122:132 (5%)
136:146 (5%)
view
11 x 2 libs/screen---linux
libs/screen
targetoverrides.ts
targetoverrides.ts
6:25 (100%)
6:25 (100%)
view
Duplicated Units
The list of top 5 duplicated units.
See data for all 5 unit duplicates...
Size#FoldersFilesLinesCode
23 x 2 share/src/components
share/src/components
Joystick.tsx
Joystick.tsx
115:142 
144:171 
view
21 x 2 share/src/components
share/src/components
GameButtons.tsx
GameButtons.tsx
111:136 
138:163 
view
12 x 2 share/src/sprite-editor
share/src/sprite-editor
tools.ts
tools.ts
184:197 
257:270 
view
10 x 2 share/src/sprite-editor
share/src/sprite-editor
svgEvents.ts
svgEvents.ts
26:36 
56:66 
view
7 x 2 share/src/components
share/src/components
GameButtons.tsx
Joystick.tsx
231:239 
381:389 
view