tensorflow / tpu
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
  • 38% duplication:
    • 71,707 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 27,868 duplicated lines
  • 1,947 duplicates
system38% (27,868 lines)
Duplication per Extension
py39% (18,368 lines)
c46% (6,843 lines)
yaml71% (1,960 lines)
h16% (344 lines)
pb7% (233 lines)
go5% (120 lines)
Duplication per Component (primary)
models/official42% (16,747 lines)
tools/driver42% (7,187 lines)
models/experimental32% (3,608 lines)
tools/ctpu5% (120 lines)
tools/data_converter14% (116 lines)
tools/datasets9% (63 lines)
models/hyperparameters6% (20 lines)
tools/dataset_profiler8% (7 lines)
tools/diagnostics0% (0 lines)
tools/kubernetes0% (0 lines)
models0% (0 lines)
models/common0% (0 lines)

Duplication Between Components (50+ lines)

G models/experimental models/experimental models/official models/official models/experimental--models/official 2740 models/hyperparameters models/hyperparameters models/experimental--models/hyperparameters 52 tools/datasets tools/datasets models/official--tools/datasets 102 models/hyperparameters--models/official 56

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,947 duplicates...
Size#FoldersFilesLinesCode
1405 x 2 tools/driver/drivers/char/tpu_common/tpuv4
tools/driver/drivers/char/tpu_common/tpuv4lite
tpuv4_bar2_ranges.c
tpuv4lite_bar2_ranges.c
3398:4802 (29%)
1929:3333 (42%)
view
745 x 2 tools/driver/drivers/char/tpu_common/tpuv4
tools/driver/drivers/char/tpu_common/tpuv4lite
tpuv4_bar2_ranges.c
tpuv4lite_bar2_ranges.c
466:1210 (15%)
222:966 (22%)
view
494 x 2 tools/driver/drivers/char/tpu_common/tpuv4
tools/driver/drivers/char/tpu_common/tpuv4lite
tpuv4_bar2_ranges.c
tpuv4lite_bar2_ranges.c
2032:2525 (10%)
1278:1771 (14%)
view
301 x 2 models/official/detection/utils/object_detection
models/official/mask_rcnn/object_detection
visualization_utils.py
visualization_utils.py
45:585 (73%)
38:578 (74%)
view
219 x 2 models/official/detection/ops
models/official/detection/projects/vild/ops
postprocess_ops.py
postprocess_ops.py
30:440 (83%)
32:442 (75%)
view
164 x 2 models/official/mask_rcnn/object_detection
models/official/retinanet/object_detection
preprocessor.py
preprocessor.py
47:442 (100%)
47:442 (100%)
view
141 x 2 models/experimental/inception
models/official/mobilenet
vgg_preprocessing.py
vgg_preprocessing.py
37:366 (100%)
37:366 (100%)
view
139 x 2 models/experimental/densenet_keras
models/official/densenet
vgg_preprocessing.py
vgg_preprocessing.py
37:363 (100%)
37:363 (100%)
view
131 x 2 models/official/densenet
models/official/mobilenet
vgg_preprocessing.py
vgg_preprocessing.py
41:358 (94%)
41:358 (92%)
view
131 x 2 models/experimental/densenet_keras
models/official/mobilenet
vgg_preprocessing.py
vgg_preprocessing.py
41:358 (94%)
41:358 (92%)
view
131 x 2 models/experimental/inception
models/official/densenet
vgg_preprocessing.py
vgg_preprocessing.py
41:358 (92%)
41:358 (94%)
view
131 x 2 models/experimental/densenet_keras
models/experimental/inception
vgg_preprocessing.py
vgg_preprocessing.py
41:358 (94%)
41:358 (92%)
view
128 x 2 models/official/detection/projects/vild/configs
models/official/detection/projects/vild/configs
vild_ensemble_resnet.yaml
vild_resnet.yaml
23:150 (77%)
23:150 (78%)
view
121 x 2 models/official/detection/utils/object_detection
models/official/retinanet/object_detection
preprocessor.py
preprocessor.py
267:520 (41%)
189:442 (73%)
view
121 x 2 models/official/detection/utils/object_detection
models/official/mask_rcnn/object_detection
preprocessor.py
preprocessor.py
267:520 (41%)
189:442 (73%)
view
116 x 2 models/official/detection/utils/object_detection
models/official/mask_rcnn/object_detection
balanced_positive_negative_sampler.py
balanced_positive_negative_sampler.py
41:266 (100%)
41:266 (100%)
view
106 x 2 models/official/mask_rcnn/object_detection
models/official/retinanet/object_detection
target_assigner.py
target_assigner.py
40:310 (100%)
40:310 (100%)
view
106 x 2 models/official/detection/utils/object_detection
models/official/retinanet/object_detection
target_assigner.py
target_assigner.py
40:310 (100%)
40:310 (100%)
view
106 x 2 models/official/detection/utils/object_detection
models/official/mask_rcnn/object_detection
target_assigner.py
target_assigner.py
40:310 (100%)
40:310 (100%)
view
105 x 2 models/official/detection
models/official/detection/projects/fashionpedia
main.py
main.py
57:185 (91%)
56:184 (92%)
view
Duplicated Units
The list of top 20 duplicated units.
See data for all 157 unit duplicates...
Size#FoldersFilesLinesCode
106 x 2 models/official/detection/utils/object_detection
models/official/mask_rcnn/object_detection
visualization_utils.py
visualization_utils.py
0:0 
0:0 
view
72 x 2 models/official/retinanet/object_detection
models/official/mask_rcnn/object_detection
argmax_matcher.py
argmax_matcher.py
0:0 
0:0 
view
84 x 2 models/official/detection/dataloader
models/official/detection/projects/vild/dataloader
maskrcnn_parser.py
vild_parser.py
0:0 
0:0 
view
72 x 2 models/official/detection/dataloader
models/official/detection/projects/vild/dataloader
maskrcnn_parser.py
vild_parser.py
0:0 
0:0 
view
74 x 2 models/official/detection/utils/object_detection
models/official/mask_rcnn/object_detection
balanced_positive_negative_sampler.py
balanced_positive_negative_sampler.py
0:0 
0:0 
view
68 x 4 models/official/densenet
models/official/mobilenet
models/experimental/inception
models/experimental/densenet_keras
vgg_preprocessing.py
vgg_preprocessing.py
vgg_preprocessing.py
vgg_preprocessing.py
0:0 
0:0 
0:0 
0:0 
view
74 x 2 models/official/detection/ops
models/official/detection/projects/vild/ops
postprocess_ops.py
postprocess_ops.py
0:0 
0:0 
view
77 x 3 models/official/retinanet/object_detection
models/official/detection/utils/object_detection
models/official/mask_rcnn/object_detection
target_assigner.py
target_assigner.py
target_assigner.py
0:0 
0:0 
0:0 
view
73 x 2 models/official/detection/ops
models/official/detection/projects/vild/ops
postprocess_ops.py
postprocess_ops.py
0:0 
0:0 
view
48 x 2 models/official/detection/ops
models/official/detection/projects/vild/ops
postprocess_ops.py
postprocess_ops.py
0:0 
0:0 
view
66 x 2 models/official/detection/utils/object_detection
models/official/mask_rcnn/object_detection
visualization_utils.py
visualization_utils.py
0:0 
0:0 
view
40 x 2 models/official/detection/modeling/architecture
models/official/detectio...a/modeling/architecture
factory.py
factory.py
0:0 
0:0 
view
41 x 2 models/experimental/inception
models/experimental/inception
inception_v3.py
inception_v4.py
0:0 
0:0 
view
51 x 2 models/official/detection/utils/object_detection
models/official/mask_rcnn/object_detection
balanced_positive_negative_sampler.py
balanced_positive_negative_sampler.py
0:0 
0:0 
view
69 x 3 models/official/retinanet/object_detection
models/official/detection/utils/object_detection
models/official/mask_rcnn/object_detection
preprocessor.py
preprocessor.py
preprocessor.py
0:0 
0:0 
0:0 
view
70 x 2 models/official/retinanet/object_detection
models/official/mask_rcnn/object_detection
preprocessor.py
preprocessor.py
0:0 
0:0 
view
48 x 2 models/official/mobilenet
models/experimental/inception
inception_preprocessing.py
inception_preprocessing.py
0:0 
0:0 
view
58 x 2 models/official/detection/ops
models/official/detection/projects/vild/ops
postprocess_ops.py
postprocess_ops.py
0:0 
0:0 
view
36 x 2 models/official/detection/utils/object_detection
models/official/mask_rcnn/object_detection
shape_utils.py
shape_utils.py
0:0 
0:0 
view
24 x 3 models/official/detection/modeling
models/official/detection/modeling
models/official/detection/projects/vild/modeling
maskrcnn_model.py
cascade_maskrcnn_model.py
vild_model.py
0:0 
0:0 
0:0 
view