dart-lang / 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
  • 12% duplication:
    • 950 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 114 duplicated lines
  • 47 duplicates
system12% (114 lines)
Duplication per Extension
yaml47% (114 lines)
Duplication per Component (primary)
ffi/primitives19% (20 lines)
ffi/structs14% (18 lines)
command_line51% (15 lines)
native_app68% (13 lines)
ffi/hello_world18% (9 lines)
server/simple13% (9 lines)
extension_methods47% (9 lines)
null_safety/calculate_lix12% (7 lines)
server/google_apis8% (7 lines)
ffi/system-command5% (7 lines)
extension_methods/lib0% (0 lines)
extension_methods/example0% (0 lines)
ROOT0% (0 lines)
command_line/lib0% (0 lines)
isolates0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 47 duplicates...
Size#FoldersFilesLinesCode
11 x 2 ffi/primitives
ffi/structs
pubspec.yaml
pubspec.yaml
5:18 (84%)
7:19 (73%)
view
9 x 2 command_line
server/simple
mono_pkg.yaml
mono_pkg.yaml
1:10 (100%)
1:10 (100%)
view
9 x 2 extension_methods
server/simple
mono_pkg.yaml
mono_pkg.yaml
1:10 (100%)
1:10 (100%)
view
9 x 2 command_line
extension_methods
mono_pkg.yaml
mono_pkg.yaml
1:10 (100%)
1:10 (100%)
view
9 x 2 ffi/hello_world
ffi/primitives
mono_pkg.yaml
mono_pkg.yaml
1:10 (100%)
1:10 (100%)
view
8 x 2 ffi/primitives
server/simple
mono_pkg.yaml
mono_pkg.yaml
1:9 (88%)
1:9 (88%)
view
8 x 2 extension_methods
ffi/primitives
mono_pkg.yaml
mono_pkg.yaml
1:9 (88%)
1:9 (88%)
view
8 x 2 command_line
ffi/primitives
mono_pkg.yaml
mono_pkg.yaml
1:9 (88%)
1:9 (88%)
view
8 x 2 command_line
ffi/hello_world
mono_pkg.yaml
mono_pkg.yaml
1:9 (88%)
1:9 (88%)
view
8 x 2 extension_methods
ffi/hello_world
mono_pkg.yaml
mono_pkg.yaml
1:9 (88%)
1:9 (88%)
view
8 x 2 ffi/hello_world
server/simple
mono_pkg.yaml
mono_pkg.yaml
1:9 (88%)
1:9 (88%)
view
7 x 2 ffi/hello_world
server/google_apis
mono_pkg.yaml
mono_pkg.yaml
1:8 (77%)
1:8 (100%)
view
7 x 2 ffi/primitives
ffi/system-command
mono_pkg.yaml
mono_pkg.yaml
1:8 (77%)
1:8 (100%)
view
7 x 2 ffi/hello_world
ffi/structs
mono_pkg.yaml
mono_pkg.yaml
1:8 (77%)
1:8 (100%)
view
7 x 2 ffi/system-command
native_app
mono_pkg.yaml
mono_pkg.yaml
1:8 (100%)
1:8 (100%)
view
7 x 2 null_safety/calculate_lix
server/google_apis
mono_pkg.yaml
mono_pkg.yaml
1:8 (100%)
1:8 (100%)
view
7 x 2 extension_methods
null_safety/calculate_lix
mono_pkg.yaml
mono_pkg.yaml
1:8 (77%)
1:8 (100%)
view
7 x 2 ffi/hello_world
null_safety/calculate_lix
mono_pkg.yaml
mono_pkg.yaml
1:8 (77%)
1:8 (100%)
view
7 x 2 native_app
server/google_apis
mono_pkg.yaml
mono_pkg.yaml
1:8 (100%)
1:8 (100%)
view
7 x 2 ffi/system-command
server/google_apis
mono_pkg.yaml
mono_pkg.yaml
1:8 (100%)
1:8 (100%)
view
Duplicated Units
The list of top 2 duplicated units.
See data for all 2 unit duplicates...
Size#FoldersFilesLinesCode
9 x 2 command_line/lib/src
command_line/lib/src
util.dart
util.dart
13:25 
27:39 
view
7 x 2 ffi/system-command
ffi/system-command
linux.dart
macos.dart
27:43 
27:42 
view