dart-lang / linter
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
  • 13% duplication:
    • 19,633 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 2,595 duplicated lines
  • 7,348 duplicates
system13% (2,595 lines)
Duplication per Extension
dart13% (2,595 lines)
Duplication per Component (primary)
lib/src/rules15% (2,320 lines)
tool11% (144 lines)
tool/canonical20% (69 lines)
lib/src/util2% (26 lines)
lib/src2% (24 lines)
tool/bot22% (12 lines)
example0% (0 lines)
tool/score0% (0 lines)
tool/since0% (0 lines)
ROOT0% (0 lines)
doc0% (0 lines)

Duplication Between Components (50+ lines)

G tool/canonical tool/canonical tool tool tool/canonical--tool 152

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 7,348 duplicates...
Size#FoldersFilesLinesCode
17 x 2 lib/src/rules
lib/src/rules
prefer_if_null_operators.dart
prefer_null_aware_operators.dart
34:56 (34%)
34:56 (25%)
view
16 x 2 lib/src/rules
lib/src/rules
public_member_api_docs.dart
public_member_api_docs.dart
226:253 (7%)
311:338 (7%)
view
16 x 2 lib/src/rules
lib/src/rules
sized_box_for_whitespace.dart
use_decorated_box.dart
53:77 (19%)
55:79 (21%)
view
15 x 2 lib/src/rules
lib/src/rules
avoid_unnecessary_containers.dart
sort_child_properties_last.dart
53:74 (23%)
87:107 (13%)
view
15 x 2 lib/src/rules
lib/src/rules
sort_constructors_first.dart
sort_unnamed_constructors_first.dart
40:61 (31%)
40:61 (31%)
view
14 x 2 lib/src/rules
lib/src/rules
avoid_return_types_on_setters.dart
parameter_assignments.dart
34:53 (33%)
115:134 (9%)
view
14 x 2 lib/src/rules
lib/src/rules
control_flow_in_finally.dart
throw_in_finally.dart
17:35 (12%)
18:36 (26%)
view
14 x 2 lib/src/rules
lib/src/rules
avoid_escaping_inner_quotes.dart
unnecessary_string_escapes.dart
32:51 (29%)
35:54 (13%)
view
14 x 2 lib/src/rules
lib/src/rules
avoid_return_types_on_setters.dart
avoid_void_async.dart
34:53 (33%)
38:57 (28%)
view
14 x 2 lib/src/rules
lib/src/rules
avoid_void_async.dart
parameter_assignments.dart
38:57 (28%)
115:134 (9%)
view
13 x 2 lib/src/rules
lib/src/rules
prefer_void_to_null.dart
public_member_api_docs.dart
73:89 (12%)
116:133 (5%)
view
13 x 2 lib/src/rules
lib/src/rules
sort_child_properties_last.dart
use_decorated_box.dart
87:105 (12%)
55:74 (17%)
view
13 x 2 lib/src/rules
lib/src/rules
unnecessary_new.dart
use_full_hex_values_for_flutter_color...
39:56 (33%)
37:55 (27%)
view
13 x 2 lib/src/rules
lib/src/rules
avoid_implementing_value_types.dart
sort_constructors_first.dart
93:111 (15%)
40:58 (27%)
view
13 x 2 lib/src/rules
lib/src/rules
avoid_equals_and_hash_code_on_mutable...
use_setters_to_change_properties.dart
82:100 (15%)
38:56 (20%)
view
13 x 2 lib/src/rules
lib/src/rules
avoid_unnecessary_containers.dart
sized_box_for_whitespace.dart
53:72 (20%)
53:72 (16%)
view
13 x 2 lib/src/rules
lib/src/rules
sort_child_properties_last.dart
use_full_hex_values_for_flutter_color...
87:105 (12%)
37:55 (27%)
view
13 x 2 lib/src/rules
lib/src/rules
empty_constructor_bodies.dart
prefer_initializing_formals.dart
44:62 (28%)
119:137 (8%)
view
13 x 2 lib/src/rules
lib/src/rules
sized_box_for_whitespace.dart
sort_child_properties_last.dart
53:72 (16%)
87:105 (12%)
view
13 x 2 lib/src/rules
lib/src/rules
avoid_unnecessary_containers.dart
use_decorated_box.dart
53:72 (20%)
55:74 (17%)
view
Duplicated Units
The list of top 13 duplicated units.
See data for all 13 unit duplicates...
Size#FoldersFilesLinesCode
17 x 2 lib/src/rules
lib/src/rules
prefer_void_to_null.dart
public_member_api_docs.dart
72:90 
115:134 
view
16 x 2 lib/src/rules
lib/src/rules
avoid_positional_boolean_parameters.dart
diagnostic_describe_all_properties.dart
111:128 
174:192 
view
9 x 2 tool
tool
doc.dart
doc.dart
265:274 
439:448 
view
8 x 2 lib/src/rules
lib/src/rules
control_flow_in_finally.dart
throw_in_finally.dart
22:30 
23:31 
view
7 x 2 lib/src/util
lib/src/util
condition_scope_visitor.dart
condition_scope_visitor.dart
239:246 
249:256 
view
7 x 2 lib/src/rules
lib/src/rules
literal_only_boolean_expressions.dart
curly_braces_in_flow_control_structur...
122:129 
62:69 
view
7 x 2 lib/src/rules
lib/src/rules
lines_longer_than_80_chars.dart
flutter_style_todos.dart
68:75 
57:64 
view
7 x 2 tool
tool/canonical
query.dart
gh_labels.dart
60:68 
53:61 
view
6 x 2 lib/src/util
tool/canonical
score_utils.dart
scorecard.dart
41:47 
399:405 
view
6 x 2 lib/src/rules
lib/src/rules
avoid_returning_null.dart
avoid_returning_null.dart
83:89 
92:98 
view
6 x 2 lib/src/rules
lib/src/rules
prefer_final_parameters.dart
avoid_final_parameters.dart
79:85 
67:73 
view
6 x 2 lib/src/rules
lib/src/rules
lines_longer_than_80_chars.dart
flutter_style_todos.dart
77:83 
66:72 
view
6 x 2 lib/src/rules
lib/src/rules
avoid_return_types_on_setters.dart
avoid_return_types_on_setters.dart
53:59 
62:68 
view