pytorch / live
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
  • 15% duplication:
    • 14,354 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 2,207 duplicated lines
  • 440 duplicates
system15% (2,207 lines)
Duplication per Extension
tsx26% (1,057 lines)
ts17% (503 lines)
java13% (374 lines)
m66% (174 lines)
swift2% (50 lines)
js4% (49 lines)
Duplication per Component (primary)
react-native-pytorch-core/example33% (940 lines)
react-native-template-pytorch-live/template38% (759 lines)
react-native-template-ptl/template70% (154 lines)
react-native-pytorch-core/android5% (136 lines)
torchlive-cli/src6% (123 lines)
react-native-pytorch-core/ios2% (50 lines)
react-native-pytorch-core/src3% (26 lines)
website/src<1% (12 lines)
website/scripts5% (7 lines)
react-native-template-pytorch-live0% (0 lines)
website0% (0 lines)
react-native-pytorch-core0% (0 lines)
react-native-pytorch-core/cpp0% (0 lines)
react-native-template-ptl0% (0 lines)
torchlive-cli/scripts0% (0 lines)

Duplication Between Components (50+ lines)

G react-native-pytorch-core/example react-native-pytorch-core/example react-native-template-pytorch-live/template react-native-template-pytorch-live/template react-native-pytorch-core/example--react-native-template-pytorch-live/template 988 react-native-template-ptl/template react-native-template-ptl/template react-native-pytorch-core/example--react-native-template-ptl/template 240 react-native-template-ptl/template--react-native-template-pytorch-live/template 308 react-native-pytorch-core/android react-native-pytorch-core/android react-native-pytorch-core/android--react-native-template-pytorch-live/template 52

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 440 duplicates...
Size#FoldersFilesLinesCode
40 x 2 react-native-pytorch-core/example/src
react-native-template-pytorch-live/template/src
useObjectDetection.ts
useObjectDetection.ts
32:79 (70%)
27:74 (76%)
view
39 x 2 react-native-pytorch-core/example/src/toolbox
react-native-template-py...ve/template/src/toolbox
ToolboxList.tsx
ToolboxList.tsx
26:68 (62%)
30:72 (60%)
view
39 x 2 react-native-template-pt...rg/pytorch/live/example
react-native-template-py...rg/pytorch/live/example
MainApplication.java
MainApplication.java
21:83 (100%)
21:83 (100%)
view
34 x 2 react-native-template-pt...rg/pytorch/live/example
react-native-template-py...rg/pytorch/live/example
ReactNativeFlipper.java
ReactNativeFlipper.java
28:69 (100%)
28:69 (100%)
view
34 x 2 react-native-pytorch-cor...pytorch/rn/core/example
react-native-template-py...rg/pytorch/live/example
ReactNativeFlipper.java
ReactNativeFlipper.java
28:66 (100%)
28:69 (100%)
view
34 x 2 react-native-pytorch-cor...pytorch/rn/core/example
react-native-template-pt...rg/pytorch/live/example
ReactNativeFlipper.java
ReactNativeFlipper.java
28:66 (100%)
28:69 (100%)
view
31 x 2 react-native-template-pt...PyTorchLiveExampleTests
react-native-template-py...PyTorchLiveExampleTests
PyTorchLiveExampleTests.m
PyTorchLiveExampleTests.m
17:72 (100%)
17:72 (100%)
view
31 x 2 react-native-pytorch-cor...PyTorchCoreExampleTests
react-native-template-py...PyTorchLiveExampleTests
PyTorchCoreExampleTests.m
PyTorchLiveExampleTests.m
17:72 (100%)
17:72 (100%)
view
31 x 2 react-native-pytorch-cor...ple/src/toolbox/apiTest
react-native-template-py...live/template/src/utils
GameLoop.ts
GameLoop.ts
12:54 (100%)
12:54 (100%)
view
31 x 2 react-native-pytorch-cor...PyTorchCoreExampleTests
react-native-template-pt...PyTorchLiveExampleTests
PyTorchCoreExampleTests.m
PyTorchLiveExampleTests.m
17:72 (100%)
17:72 (100%)
view
29 x 2 react-native-template-pt.../ios/PyTorchLiveExample
react-native-template-py.../ios/PyTorchLiveExample
AppDelegate.m
AppDelegate.m
22:69 (100%)
22:69 (100%)
view
29 x 2 react-native-pytorch-core/example/src
react-native-template-pytorch-live/template/src
useImageModelInference.ts
useImageModelInference.ts
19:52 (85%)
14:47 (100%)
view
26 x 2 react-native-pytorch-core/example/src
react-native-template-pytorch-live/template/src
Models.ts
Models.ts
14:48 (83%)
14:48 (100%)
view
25 x 2 react-native-pytorch-core/example/src/toolbox
react-native-template-py...ve/template/src/toolbox
Toolbox.tsx
Toolbox.tsx
339:364 (9%)
177:202 (17%)
view
25 x 2 react-native-pytorch-core/example/src/toolbox
react-native-template-py...ve/template/src/toolbox
Toolbox.tsx
Toolbox.tsx
309:338 (9%)
143:172 (17%)
view
19 x 2 react-native-pytorch-core/example/src/toolbox
react-native-template-py...ve/template/src/toolbox
ToolboxContext.tsx
ToolboxContext.tsx
15:38 (100%)
16:39 (100%)
view
19 x 2 react-native-template-py...late/src/toolbox/camera
react-native-template-py...late/src/toolbox/camera
CameraFrameByFrame.tsx
CameraTakePicture.tsx
40:60 (50%)
40:60 (50%)
view
18 x 2 react-native-pytorch-core/example/src
react-native-template-pytorch-live/template/src
useNLPQAModelInference.ts
useNLPQAModelInference.ts
15:35 (54%)
14:34 (54%)
view
17 x 2 react-native-pytorch-core/ios/ML/Processing
react-native-pytorch-core/ios/ML/Processing
GreyScaleNormTransform.swift
RGBNormTransform.swift
72:88 (22%)
32:48 (47%)
view
15 x 2 react-native-template-py...late/src/toolbox/canvas
react-native-template-py...late/src/toolbox/canvas
CanvasStarter.tsx
CanvasTransform.tsx
63:81 (30%)
118:136 (17%)
view
Duplicated Units
The list of top 10 duplicated units.
See data for all 10 unit duplicates...
Size#FoldersFilesLinesCode
38 x 3 react-native-template-py...rg/pytorch/live/example
react-native-pytorch-cor...pytorch/rn/core/example
react-native-template-pt...rg/pytorch/live/example
ReactNativeFlipper.java
ReactNativeFlipper.java
ReactNativeFlipper.java
29:72 
29:69 
29:72 
view
25 x 2 react-native-template-pytorch-live/template/src
react-native-pytorch-core/example/src
useImageModelInference.ts
useImageModelInference.ts
21:48 
26:53 
view
18 x 3 react-native-template-py...rg/pytorch/live/example
react-native-pytorch-cor...pytorch/rn/core/example
react-native-template-pt...rg/pytorch/live/example
MainApplication.java
MainApplication.java
MainApplication.java
64:86 
75:97 
64:86 
view
13 x 2 react-native-template-py...live/template/src/utils
react-native-pytorch-core/example/src/utils
useImageFromURL.ts
useImageFromURL.ts
13:30 
13:30 
view
10 x 2 react-native-template-py...rg/pytorch/live/example
react-native-pytorch-cor...h/rn/core/ml/processing
BertQAPacker.java
BaseIValuePacker.java
56:66 
230:240 
view
9 x 2 react-native-template-py...live/template/src/utils
react-native-pytorch-core/example/src/utils
useImageFromBundle.ts
useImageFromBundle.ts
13:22 
13:22 
view
8 x 3 react-native-template-py.../ios/PyTorchLiveExample
react-native-pytorch-cor.../ios/PyTorchCoreExample
react-native-template-pt.../ios/PyTorchLiveExample
AppDelegate.m
AppDelegate.m
AppDelegate.m
22:30 
21:29 
22:30 
view
6 x 2 react-native-template-py...ve/template/src/toolbox
react-native-pytorch-core/example/src/toolbox
Toolbox.tsx
Toolbox.tsx
157:165 
323:331 
view
7 x 2 torchlive-cli/src/commands
torchlive-cli/src/commands
Python.ts
Homebrew.ts
16:23 
18:25 
view
6 x 2 react-native-pytorch-core/cpp
react-native-pytorch-core/cpp
TorchHostObject.cpp
TensorHostObject.cpp
22:28 
27:33 
view