android / ndk-samples
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
  • 32% duplication:
    • 72,793 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 23,731 duplicated lines
  • 1,328 duplicates
system32% (23,731 lines)
Duplication per Extension
inl49% (14,535 lines)
cpp28% (3,675 lines)
java47% (1,844 lines)
h10% (1,514 lines)
c28% (801 lines)
vsh93% (466 lines)
hpp4% (378 lines)
fsh92% (359 lines)
org34% (159 lines)
Duplication per Component (primary)
teapots81% (15,571 lines)
endless-tunnel16% (4,773 lines)
camera45% (1,091 lines)
hello-neon9% (1,004 lines)
native-media27% (194 lines)
native-codec26% (176 lines)
san-angeles13% (159 lines)
native-plasma63% (157 lines)
bitmap-plasma70% (144 lines)
gles3jni14% (126 lines)
display-p39% (120 lines)
nn-samples6% (68 lines)
prefab20% (48 lines)
audio-echo2% (26 lines)
native-audio1% (24 lines)
hello-gl27% (24 lines)
native-activity6% (13 lines)
webp4% (13 lines)
native-midi0% (0 lines)
hello-libs0% (0 lines)
sensor-graph0% (0 lines)
other-builds0% (0 lines)
hello-jni0% (0 lines)
hello-oboe0% (0 lines)
hello-jniCallback0% (0 lines)

Duplication Between Components (50+ lines)

G native-codec native-codec native-media native-media native-codec--native-media 352 gles3jni gles3jni teapots teapots gles3jni--teapots 315 bitmap-plasma bitmap-plasma native-plasma native-plasma bitmap-plasma--native-plasma 288 display-p3 display-p3 display-p3--teapots 178 camera camera camera--teapots 96

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 1,328 duplicates...
Size#FoldersFilesLinesCode
2028 x 2 teapots/image-decoder/src/main/cpp
teapots/textured-teapot/src/main/cpp
inl
teapot.inl
teapot.inl
23:2057 (100%)
23:2057 (100%)
view
2028 x 2 teapots/image-decoder/src/main/cpp
teapots/more-teapots/src/main/cpp
inl
teapot.inl
teapot.inl
23:2057 (100%)
23:2057 (100%)
view
2028 x 2 teapots/choreographer-30fps/src/main/cpp
teapots/textured-teapot/src/main/cpp
inl
teapot.inl
teapot.inl
23:2057 (100%)
23:2057 (100%)
view
2028 x 2 teapots/choreographer-30fps/src/main/cpp
teapots/more-teapots/src/main/cpp
inl
teapot.inl
teapot.inl
23:2057 (100%)
23:2057 (100%)
view
2028 x 2 teapots/more-teapots/src/main/cpp
teapots/textured-teapot/src/main/cpp
inl
teapot.inl
teapot.inl
23:2057 (100%)
23:2057 (100%)
view
2028 x 2 teapots/choreographer-30fps/src/main/cpp
teapots/classic-teapot/src/main/cpp
inl
teapot.inl
teapot.inl
23:2057 (100%)
23:2057 (100%)
view
2028 x 2 teapots/classic-teapot/src/main/cpp
teapots/more-teapots/src/main/cpp
inl
teapot.inl
teapot.inl
23:2057 (100%)
23:2057 (100%)
view
2028 x 2 teapots/choreographer-30fps/src/main/cpp
teapots/image-decoder/src/main/cpp
inl
teapot.inl
teapot.inl
23:2057 (100%)
23:2057 (100%)
view
2028 x 2 teapots/classic-teapot/src/main/cpp
teapots/image-decoder/src/main/cpp
inl
teapot.inl
teapot.inl
23:2057 (100%)
23:2057 (100%)
view
2028 x 2 teapots/classic-teapot/src/main/cpp
teapots/textured-teapot/src/main/cpp
inl
teapot.inl
teapot.inl
23:2057 (100%)
23:2057 (100%)
view
395 x 2 teapots/common/ndk_helper
teapots/common/ndk_helper
gl3stub.c
gl3stub.cpp
20:421 (100%)
20:421 (100%)
view
189 x 2 teapots/choreographer-30.../java/com/sample/helper
teapots/image-decoder/sr.../java/com/sample/helper
NDKHelper.java
NDKHelper.java
48:358 (100%)
48:358 (100%)
view
189 x 2 teapots/classic-teapot/s.../java/com/sample/helper
teapots/image-decoder/sr.../java/com/sample/helper
NDKHelper.java
NDKHelper.java
48:358 (100%)
48:358 (100%)
view
189 x 2 teapots/more-teapots/src.../java/com/sample/helper
teapots/textured-teapot/.../java/com/sample/helper
NDKHelper.java
NDKHelper.java
48:358 (100%)
48:358 (100%)
view
189 x 2 teapots/image-decoder/sr.../java/com/sample/helper
teapots/textured-teapot/.../java/com/sample/helper
NDKHelper.java
NDKHelper.java
48:358 (100%)
48:358 (100%)
view
189 x 2 teapots/image-decoder/sr.../java/com/sample/helper
teapots/more-teapots/src.../java/com/sample/helper
NDKHelper.java
NDKHelper.java
48:358 (100%)
48:358 (100%)
view
189 x 2 teapots/classic-teapot/s.../java/com/sample/helper
teapots/more-teapots/src.../java/com/sample/helper
NDKHelper.java
NDKHelper.java
48:358 (100%)
48:358 (100%)
view
189 x 2 teapots/classic-teapot/s.../java/com/sample/helper
teapots/textured-teapot/.../java/com/sample/helper
NDKHelper.java
NDKHelper.java
48:358 (100%)
48:358 (100%)
view
189 x 2 teapots/choreographer-30.../java/com/sample/helper
teapots/textured-teapot/.../java/com/sample/helper
NDKHelper.java
NDKHelper.java
48:358 (100%)
48:358 (100%)
view
189 x 2 teapots/choreographer-30.../java/com/sample/helper
teapots/more-teapots/src.../java/com/sample/helper
NDKHelper.java
NDKHelper.java
48:358 (100%)
48:358 (100%)
view
Duplicated Units
The list of top 20 duplicated units.
See data for all 70 unit duplicates...
Size#FoldersFilesLinesCode
51 x 2 teapots/image-decoder/src/main/cpp
teapots/textured-teapot/src/main/cpp
TeapotRenderer.cpp
TeapotRenderer.cpp
202:276 
200:274 
view
49 x 2 teapots/choreographer-30fps/src/main/cpp
teapots/classic-teapot/src/main/cpp
TeapotRenderer.cpp
TeapotRenderer.cpp
192:264 
192:264 
view
42 x 4 teapots/image-decoder/src/main/cpp
teapots/classic-teapot/src/main/cpp
teapots/more-teapots/src/main/cpp
teapots/textured-teapot/src/main/cpp
TeapotNativeActivity.cpp
TeapotNativeActivity.cpp
MoreTeapotsNativeActivity.cpp
TeapotNativeActivity.cpp
198:250 
199:251 
209:261 
199:251 
view
35 x 2 camera/texture-view/src/main/cpp
camera/basic/src/main/cpp
camera_manager.cpp
camera_manager.cpp
333:373 
309:349 
view
33 x 5 teapots/image-decoder/sr.../java/com/sample/helper
teapots/choreographer-30.../java/com/sample/helper
teapots/classic-teapot/s.../java/com/sample/helper
teapots/more-teapots/src.../java/com/sample/helper
teapots/textured-teapot/.../java/com/sample/helper
NDKHelper.java
NDKHelper.java
NDKHelper.java
NDKHelper.java
NDKHelper.java
159:206 
159:206 
159:206 
159:206 
159:206 
view
32 x 5 teapots/image-decoder/sr.../java/com/sample/helper
teapots/choreographer-30.../java/com/sample/helper
teapots/classic-teapot/s.../java/com/sample/helper
teapots/more-teapots/src.../java/com/sample/helper
teapots/textured-teapot/.../java/com/sample/helper
NDKHelper.java
NDKHelper.java
NDKHelper.java
NDKHelper.java
NDKHelper.java
208:244 
208:244 
208:244 
208:244 
208:244 
view
32 x 2 teapots/choreographer-30fps/src/main/cpp
teapots/classic-teapot/src/main/cpp
TeapotRenderer.cpp
TeapotRenderer.cpp
41:84 
41:84 
view
31 x 4 teapots/image-decoder/src/main/cpp
teapots/classic-teapot/src/main/cpp
teapots/more-teapots/src/main/cpp
teapots/textured-teapot/src/main/cpp
TeapotNativeActivity.cpp
TeapotNativeActivity.cpp
MoreTeapotsNativeActivity.cpp
TeapotNativeActivity.cpp
255:291 
256:292 
266:302 
256:292 
view
31 x 2 teapots/classic-teapot/src/main/cpp
teapots/textured-teapot/src/main/cpp
TeapotNativeActivity.cpp
TeapotNativeActivity.cpp
122:163 
122:163 
view
29 x 2 teapots/classic-teapot/src/main/cpp
teapots/textured-teapot/src/main/cpp
TeapotRenderer.cpp
TeapotRenderer.cpp
141:190 
149:198 
view
28 x 5 teapots/image-decoder/sr.../java/com/sample/helper
teapots/choreographer-30.../java/com/sample/helper
teapots/classic-teapot/s.../java/com/sample/helper
teapots/more-teapots/src.../java/com/sample/helper
teapots/textured-teapot/.../java/com/sample/helper
NDKHelper.java
NDKHelper.java
NDKHelper.java
NDKHelper.java
NDKHelper.java
118:157 
118:157 
118:157 
118:157 
118:157 
view
27 x 3 teapots/image-decoder/src/main/cpp
teapots/classic-teapot/src/main/cpp
teapots/textured-teapot/src/main/cpp
TeapotNativeActivity.cpp
TeapotNativeActivity.cpp
TeapotNativeActivity.cpp
389:436 
390:438 
390:438 
view
26 x 2 native-codec/app/src/mai...com/example/nativecodec
native-media/app/src/mai...com/example/nativemedia
MyGLSurfaceView.java
MyGLSurfaceView.java
251:278 
240:267 
view
26 x 2 display-p3/image-view/src/main/cpp
teapots/textured-teapot/src/main/cpp
AssetUtil.cpp
AssetUtil.cpp
30:62 
30:62 
view
24 x 4 teapots/image-decoder/sr...com/sample/imagedecoder
teapots/classic-teapot/s.../java/com/sample/teapot
teapots/more-teapots/src.../com/sample/moreteapots
teapots/textured-teapot/...m/sample/texturedteapot
TeapotNativeActivity.java
TeapotNativeActivity.java
MoreTeapotsNativeActivity.java
TeapotNativeActivity.java
92:123 
92:123 
98:129 
92:123 
view
21 x 2 endless-tunnel/app/src/main/cpp/glm/gtx
endless-tunnel/app/src/main/cpp/glm/gtx
inl
bit.inl
bit.inl
450:477 
480:507 
view
21 x 2 camera/texture-view/src/.../com/sample/textureview
camera/basic/src/main/java/com/sample/camera/basic
ViewActivity.java
CameraActivity.java
75:96 
126:147 
view
20 x 2 camera/texture-view/src/main/cpp
camera/basic/src/main/cpp
camera_listeners.cpp
camera_listeners.cpp
96:119 
96:119 
view
19 x 2 bitmap-plasma/app/src/main/cpp
native-plasma/app/src/main/cpp
plasma.c
plasma.c
147:170 
153:176 
view
18 x 5 teapots/image-decoder/sr.../java/com/sample/helper
teapots/choreographer-30.../java/com/sample/helper
teapots/classic-teapot/s.../java/com/sample/helper
teapots/more-teapots/src.../java/com/sample/helper
teapots/textured-teapot/.../java/com/sample/helper
NDKHelper.java
NDKHelper.java
NDKHelper.java
NDKHelper.java
NDKHelper.java
246:267 
246:267 
246:267 
246:267 
246:267 
view