tensorflow / tfjs-models
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
  • 55% duplication:
    • 27,654 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 15,313 duplicated lines
  • 1,550 duplicates
system55% (15,313 lines)
Duplication per Extension
ts56% (14,304 lines)
js53% (677 lines)
yml40% (332 lines)
Duplication per Component (primary)
body-segmentation90% (3,969 lines)
pose-detection50% (2,126 lines)
body-pix97% (2,122 lines)
hand-pose-detection74% (1,903 lines)
face-landmarks-detection89% (1,880 lines)
shared99% (1,800 lines)
posenet61% (621 lines)
tasks14% (171 lines)
speech-commands4% (114 lines)
universal-sentence-encoder21% (71 lines)
toxicity39% (68 lines)
coco-ssd9% (63 lines)
handpose10% (59 lines)
qna12% (59 lines)
blazeface12% (56 lines)
mobilenet4% (56 lines)
knn-classifier20% (53 lines)
scripts28% (47 lines)
deeplab9% (46 lines)
model-playground5% (23 lines)
ROOT3% (6 lines)

Duplication Between Components (50+ lines)

G body-pix body-pix body-segmentation body-segmentation body-pix--body-segmentation 4362 pose-detection pose-detection body-pix--pose-detection 718 face-landmarks-detection face-landmarks-detection body-pix--face-landmarks-detection 382 hand-pose-detection hand-pose-detection body-pix--hand-pose-detection 382 shared shared body-pix--shared 316 posenet posenet body-pix--posenet 1110 toxicity toxicity body-pix--toxicity 94 universal-sentence-encoder universal-sentence-encoder body-pix--universal-sentence-encoder 94 mobilenet mobilenet body-pix--mobilenet 94 qna qna body-pix--qna 84 body-segmentation--pose-detection 4230 body-segmentation--face-landmarks-detection 3906 body-segmentation--hand-pose-detection 3906 body-segmentation--shared 3758 body-segmentation--posenet 1076 handpose handpose body-segmentation--handpose 104 pose-detection--shared 3600 pose-detection--posenet 478 face-landmarks-detection--pose-detection 3692 face-landmarks-detection--hand-pose-detection 3760 face-landmarks-detection--shared 3600 face-landmarks-detection--handpose 104 hand-pose-detection--pose-detection 3706 hand-pose-detection--shared 3600 hand-pose-detection--handpose 104 posenet--toxicity 112 posenet--universal-sentence-encoder 112 posenet--qna 82 toxicity--universal-sentence-encoder 136 mobilenet--posenet 112 mobilenet--toxicity 112 mobilenet--universal-sentence-encoder 112 mobilenet--qna 96 handpose--posenet 90 handpose--toxicity 96 handpose--universal-sentence-encoder 96 handpose--mobilenet 96 handpose--qna 94 qna--toxicity 96 qna--universal-sentence-encoder 102 blazeface blazeface blazeface--posenet 92 blazeface--toxicity 100 blazeface--universal-sentence-encoder 100 blazeface--mobilenet 100 blazeface--handpose 96 blazeface--qna 96 speech-commands speech-commands blazeface--speech-commands 92 coco-ssd coco-ssd coco-ssd--posenet 86 coco-ssd--handpose 94 knn-classifier knn-classifier knn-classifier--qna 92

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,550 duplicates...
Size#FoldersFilesLinesCode
592 x 2 body-pix/src
body-segmentation/src/body_pix/impl
body_pix_model.ts
body_pix_model.ts
33:1041 (100%)
33:1041 (100%)
view
387 x 2 face-landmarks-detection/src/shared/calculators
shared/calculators
render_util.ts
render_util.ts
28:735 (100%)
28:735 (100%)
view
387 x 2 body-segmentation/src/shared/calculators
face-landmarks-detection/src/shared/calculators
render_util.ts
render_util.ts
28:735 (100%)
28:735 (100%)
view
387 x 2 face-landmarks-detection/src/shared/calculators
hand-pose-detection/src/shared/calculators
render_util.ts
render_util.ts
28:735 (100%)
28:735 (100%)
view
387 x 2 body-segmentation/src/shared/calculators
shared/calculators
render_util.ts
render_util.ts
28:735 (100%)
28:735 (100%)
view
387 x 2 body-segmentation/src/shared/calculators
hand-pose-detection/src/shared/calculators
render_util.ts
render_util.ts
28:735 (100%)
28:735 (100%)
view
387 x 2 body-segmentation/src/shared/calculators
pose-detection/src/shared/calculators
render_util.ts
render_util.ts
28:735 (100%)
28:735 (100%)
view
387 x 2 face-landmarks-detection/src/shared/calculators
pose-detection/src/shared/calculators
render_util.ts
render_util.ts
28:735 (100%)
28:735 (100%)
view
387 x 2 pose-detection/src/shared/calculators
shared/calculators
render_util.ts
render_util.ts
28:735 (100%)
28:735 (100%)
view
387 x 2 hand-pose-detection/src/shared/calculators
pose-detection/src/shared/calculators
render_util.ts
render_util.ts
28:735 (100%)
28:735 (100%)
view
387 x 2 hand-pose-detection/src/shared/calculators
shared/calculators
render_util.ts
render_util.ts
28:735 (100%)
28:735 (100%)
view
328 x 2 body-pix/src
body-segmentation/src/body_pix/impl
output_rendering_util.ts
output_rendering_util.ts
23:624 (100%)
23:624 (100%)
view
248 x 2 body-pix/src
body-segmentation/src/body_pix/impl
util.ts
util.ts
25:349 (100%)
25:349 (100%)
view
146 x 2 hand-pose-detection/src/shared/calculators
pose-detection/src/shared/calculators
tensors_to_detections.ts
tensors_to_detections.ts
36:228 (100%)
36:228 (100%)
view
146 x 2 body-segmentation/src/shared/calculators
hand-pose-detection/src/shared/calculators
tensors_to_detections.ts
tensors_to_detections.ts
36:228 (100%)
36:228 (100%)
view
146 x 2 body-segmentation/src/shared/calculators
face-landmarks-detection/src/shared/calculators
tensors_to_detections.ts
tensors_to_detections.ts
36:228 (100%)
36:228 (100%)
view
146 x 2 body-segmentation/src/shared/calculators
pose-detection/src/shared/calculators
tensors_to_detections.ts
tensors_to_detections.ts
36:228 (100%)
36:228 (100%)
view
146 x 2 face-landmarks-detection/src/shared/calculators
hand-pose-detection/src/shared/calculators
tensors_to_detections.ts
tensors_to_detections.ts
36:228 (100%)
36:228 (100%)
view
146 x 2 face-landmarks-detection/src/shared/calculators
pose-detection/src/shared/calculators
tensors_to_detections.ts
tensors_to_detections.ts
36:228 (100%)
36:228 (100%)
view
146 x 2 body-segmentation/src/shared/calculators
shared/calculators
tensors_to_detections.ts
tensors_to_detections.ts
36:228 (100%)
36:228 (100%)
view
Duplicated Units
The list of top 20 duplicated units.
See data for all 144 unit duplicates...
Size#FoldersFilesLinesCode
83 x 5 body-segmentation/src/shared/calculators
shared/calculators
pose-detection/src/shared/calculators
face-landmarks-detection/src/shared/calculators
hand-pose-detection/src/shared/calculators
create_ssd_anchors.ts
create_ssd_anchors.ts
create_ssd_anchors.ts
create_ssd_anchors.ts
create_ssd_anchors.ts
23:117 
23:117 
23:117 
23:117 
23:117 
view
81 x 5 body-segmentation/src/shared/calculators
shared/calculators
pose-detection/src/shared/calculators
face-landmarks-detection/src/shared/calculators
hand-pose-detection/src/shared/calculators
tensors_to_detections.ts
tensors_to_detections.ts
tensors_to_detections.ts
tensors_to_detections.ts
tensors_to_detections.ts
138:229 
138:229 
138:229 
138:229 
138:229 
view
78 x 2 body-segmentation/src/body_pix/impl
body-pix/src
body_pix_model.ts
body_pix_model.ts
597:684 
597:684 
view
78 x 2 body-segmentation/src/body_pix/impl
body-pix/src
body_pix_model.ts
body_pix_model.ts
885:975 
885:975 
view
46 x 2 body-segmentation/src/body_pix/impl/multi_person
body-pix/src/multi_person
decode_multiple_masks_webgl.ts
decode_multiple_masks_webgl.ts
95:149 
95:149 
view
45 x 2 body-segmentation/src/body_pix/impl
body-pix/src
util.ts
util.ts
148:203 
148:203 
view
45 x 2 body-segmentation/src/body_pix/impl
body-pix/src
output_rendering_util.ts
output_rendering_util.ts
411:466 
411:466 
view
44 x 5 body-segmentation/src/shared/calculators
shared/calculators
pose-detection/src/shared/calculators
face-landmarks-detection/src/shared/calculators
hand-pose-detection/src/shared/calculators
render_util.ts
render_util.ts
render_util.ts
render_util.ts
render_util.ts
515:569 
515:569 
515:569 
515:569 
515:569 
view
77 x 2 body-segmentation/src/body_pix/impl
body-pix/src
body_pix_model.ts
body_pix_model.ts
482:619 
482:619 
view
39 x 5 body-segmentation/src/shared/calculators
shared/calculators
pose-detection/src/shared/calculators
face-landmarks-detection/src/shared/calculators
hand-pose-detection/src/shared/calculators
tensors_to_detections.ts
tensors_to_detections.ts
tensors_to_detections.ts
tensors_to_detections.ts
tensors_to_detections.ts
69:115 
69:115 
69:115 
69:115 
69:115 
view
38 x 5 body-segmentation/src/shared/calculators
shared/calculators
pose-detection/src/shared/calculators
face-landmarks-detection/src/shared/calculators
hand-pose-detection/src/shared/calculators
segmentation_smoothing.ts
segmentation_smoothing.ts
segmentation_smoothing.ts
segmentation_smoothing.ts
segmentation_smoothing.ts
34:91 
34:91 
34:91 
34:91 
34:91 
view
38 x 2 body-segmentation/src/body_pix/impl
body-pix/src
body_pix_model.ts
body_pix_model.ts
104:146 
104:146 
view
38 x 2 body-segmentation/src/body_pix/impl
body-pix/src
body_pix_model.ts
body_pix_model.ts
275:319 
275:319 
view
37 x 5 body-segmentation/src/shared/calculators
shared/calculators
pose-detection/src/shared/calculators
face-landmarks-detection/src/shared/calculators
hand-pose-detection/src/shared/calculators
transform_rect.ts
transform_rect.ts
transform_rect.ts
transform_rect.ts
transform_rect.ts
32:73 
32:73 
32:73 
32:73 
32:73 
view
36 x 2 body-segmentation/src/body_pix/impl
body-pix/src
output_rendering_util.ts
output_rendering_util.ts
293:332 
293:332 
view
36 x 2 body-segmentation/src/body_pix/impl/multi_person
body-pix/src/multi_person
decode_instance_masks.ts
decode_instance_masks.ts
87:130 
87:130 
view
36 x 2 body-segmentation/src/body_pix/impl
body-pix/src
body_pix_model.ts
body_pix_model.ts
527:572 
527:572 
view
36 x 2 body-segmentation/src/body_pix/impl
body-pix/src
body_pix_model.ts
body_pix_model.ts
817:860 
817:860 
view
112 x 2 body-segmentation/src/body_pix/impl/multi_person
body-pix/src/multi_person
decode_multiple_masks_webgl.ts
decode_multiple_masks_webgl.ts
25:161 
25:161 
view
34 x 5 body-segmentation/src/shared/calculators
shared/calculators
pose-detection/src/shared/calculators
face-landmarks-detection/src/shared/calculators
hand-pose-detection/src/shared/calculators
convert_image_to_tensor.ts
convert_image_to_tensor.ts
convert_image_to_tensor.ts
convert_image_to_tensor.ts
convert_image_to_tensor.ts
44:89 
44:89 
44:89 
44:89 
44:89 
view