microsoft / pxt-brainpad
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
  • 3% duplication:
    • 9,356 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 322 duplicated lines
  • 17 duplicates
system3% (322 lines)
Duplication per Extension
ts3% (262 lines)
cpp2% (60 lines)
Duplication per Component (primary)
libs/core4% (78 lines)
libs/brainpad53% (76 lines)
libs/display9% (35 lines)
libs/leds63% (35 lines)
libs/screen3% (30 lines)
libs/brainbot12% (20 lines)
libs/lightbulb20% (15 lines)
libs/neopixel6% (15 lines)
sim/visuals<1% (12 lines)
libs/braingamer10% (6 lines)
editor0% (0 lines)
libs/accelerometer0% (0 lines)
libs/animation0% (0 lines)
libs/base0% (0 lines)
libs/blocksprj0% (0 lines)
libs/buttons0% (0 lines)
libs/controller0% (0 lines)
libs/cptest0% (0 lines)
libs/game0% (0 lines)
libs/infrared0% (0 lines)
libs/led0% (0 lines)
libs/music0% (0 lines)
libs/settings0% (0 lines)
libs/sonar0% (0 lines)
libs/thermometer0% (0 lines)
sim0% (0 lines)
sim/public0% (0 lines)
sim/state0% (0 lines)
theme0% (0 lines)

Duplication Between Components (50+ lines)

G libs/display libs/display libs/leds libs/leds libs/display--libs/leds 70

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 17 longest duplicates.
See data for all 17 duplicates...
Size#FoldersFilesLinesCode
38 x 2 libs/brainpad
libs/brainpad
background.ts
images.ts
4:115 (97%)
4:115 (97%)
view
26 x 2 libs/display
libs/leds
leds.ts
leds.ts
15:64 (89%)
14:63 (89%)
view
12 x 2 libs/core/sim
libs/core/sim
led.ts
photocell.ts
84:101 (10%)
68:85 (13%)
view
9 x 2 libs/display
libs/leds
leds.cpp
leds.cpp
48:58 (16%)
50:60 (36%)
view
9 x 2 libs/screen
libs/screen
image.cpp
image.cpp
285:296 (1%)
367:378 (1%)
view
8 x 2 libs/lightbulb
libs/neopixel
ns.ts
neopixel.ts
7:21 (61%)
6:20 (4%)
view
7 x 2 libs/lightbulb
libs/neopixel
lightbulb.ts
neopixel.ts
115:123 (12%)
321:329 (3%)
view
7 x 2 libs/brainbot
libs/brainbot
brainbot.ts
brainbot.ts
119:125 (4%)
136:142 (4%)
view
6 x 2 libs/core/sim
libs/core/sim
neopixel.ts
neopixel.ts
107:112 (2%)
114:119 (2%)
view
6 x 2 libs/core/sim
libs/core/sim
neopixel.ts
neopixel.ts
96:101 (2%)
114:119 (2%)
view
6 x 2 libs/brainbot
libs/braingamer
brainbot.ts
braingamer.ts
159:166 (3%)
25:32 (10%)
view
6 x 2 libs/core
libs/core
hf2.cpp
hf2.cpp
57:62 (2%)
308:313 (2%)
view
6 x 2 libs/core/sim
libs/core/sim
neopixel.ts
neopixel.ts
96:101 (2%)
107:112 (2%)
view
6 x 2 libs/core/sim
libs/core/sim
led.ts
photocell.ts
75:81 (5%)
60:66 (6%)
view
6 x 2 libs/screen
libs/screen
image.cpp
image.cpp
239:245 (<1%)
263:269 (<1%)
view
6 x 2 sim/visuals
sim/visuals
board.ts
board.ts
354:361 (1%)
568:576 (1%)
view
6 x 2 libs/core/sim
libs/core/sim
led.ts
photocell.ts
116:124 (5%)
105:113 (6%)
view
Duplicated Units
The list of top 2 duplicated units.
See data for all 2 unit duplicates...
Size#FoldersFilesLinesCode
29 x 2 libs/display
libs/leds
leds.ts
leds.ts
14:59 
13:58 
view
7 x 2 libs/brainbot
libs/braingamer
brainbot.ts
braingamer.ts
159:167 
25:33 
view