dart-lang / pub-dev
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
  • 4% duplication:
    • 34,088 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 1,693 duplicated lines
  • 528 duplicates
system4% (1,693 lines)
Duplication per Extension
dart4% (1,440 lines)
yaml29% (213 lines)
scss1% (40 lines)
Duplication per Component (primary)
app/lib5% (1,346 lines)
ROOT24% (56 lines)
pkg/web_css2% (51 lines)
pkg/pub_integration2% (34 lines)
pkg/api_builder6% (33 lines)
pkg/indexed_blob13% (25 lines)
pkg/web_app1% (23 lines)
pkg/fake_gcloud3% (21 lines)
pkg/pub_dartdoc_data23% (20 lines)
pkg/client_data4% (20 lines)
pkg/_popularity20% (15 lines)
app/config18% (14 lines)
pkg/pub_dartdoc3% (9 lines)
pkg/pub_package_reader1% (9 lines)
pkg/pub_validations7% (9 lines)
app7% (8 lines)
pkg/code_coverage0% (0 lines)
tool0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 528 duplicates...
Size#FoldersFilesLinesCode
20 x 2 ROOT
ROOT
analyzer.yaml
dartdoc.yaml
8:36 (86%)
8:36 (86%)
view
19 x 2 app/lib/service/entrypoint
app/lib/service/entrypoint
analyzer.dart
dartdoc.dart
35:60 (33%)
35:60 (31%)
view
18 x 2 app/lib/fake/server
app/lib/fake/server
fake_analyzer_service.dart
fake_dartdoc_service.dart
45:66 (34%)
45:66 (34%)
view
15 x 2 app/lib/frontend/templates/views/consent
app/lib/frontend/templates/views/consent
publisher_contact_invite.dart
publisher_member_invite.dart
20:34 (36%)
17:31 (28%)
view
15 x 2 app/lib/frontend/templates
app/lib/frontend/templates
package_admin.dart
package_admin.dart
36:52 (20%)
71:85 (20%)
view
15 x 2 app/lib/frontend/templates
app/lib/frontend/templates
publisher.dart
publisher.dart
121:136 (8%)
162:177 (8%)
view
14 x 2 app/lib/frontend/templates/views/pkg
app/lib/frontend/templates/views/pkg
header.dart
info_box.dart
32:45 (17%)
86:99 (10%)
view
13 x 2 pkg/api_builder/lib
pkg/api_builder/lib
_client_utils.dart
_client_utils.dart
52:65 (17%)
72:85 (17%)
view
13 x 2 app/lib/shared
app/lib/shared
urls.dart
urls.dart
213:229 (4%)
239:255 (4%)
view
12 x 2 app/lib/frontend/handlers
app/lib/frontend/handlers
publisher.dart
publisher.dart
104:120 (11%)
131:147 (11%)
view
11 x 2 pkg/client_data
pkg/pub_dartdoc_data
pubspec.yaml
pubspec.yaml
3:15 (84%)
3:15 (84%)
view
11 x 2 app/lib/dartdoc
app/lib/fake/backend
dartdoc_runner.dart
fake_dartdoc_runner.dart
117:127 (1%)
42:52 (22%)
view
11 x 2 pkg/web_app
pkg/web_css
mono_pkg.yaml
mono_pkg.yaml
2:13 (100%)
2:13 (100%)
view
11 x 2 app/lib/analyzer
app/lib/dartdoc
pana_runner.dart
dartdoc_runner.dart
115:131 (7%)
191:207 (1%)
view
11 x 2 app/lib/frontend/dom
app/lib/frontend/dom
material.dart
material.dart
117:127 (3%)
159:169 (3%)
view
11 x 2 app/lib/frontend/handlers
app/lib/frontend/handlers
package.dart
package.dart
256:267 (3%)
290:301 (3%)
view
10 x 2 app/lib/fake/server
app/lib/fake/server
fake_analyzer_service.dart
fake_default_service.dart
55:66 (19%)
57:68 (18%)
view
10 x 2 app/lib/frontend/templates/views/pkg
app/lib/frontend/templates/views/shared
index.dart
site_header.dart
262:271 (2%)
226:235 (4%)
view
10 x 2 app/lib/audit
app/lib/audit
models.dart
models.dart
255:265 (2%)
278:288 (2%)
view
10 x 2 app/lib/fake/server
app/lib/fake/server
fake_dartdoc_service.dart
fake_default_service.dart
55:66 (19%)
57:68 (18%)
view
Duplicated Units
The list of top 4 duplicated units.
See data for all 4 unit duplicates...
Size#FoldersFilesLinesCode
15 x 2 app/lib/frontend/dom
app/lib/frontend/dom
dom.dart
dom.dart
386:401 
654:669 
view
12 x 2 app/lib/service/entrypoint
app/lib/service/entrypoint
analyzer.dart
dartdoc.dart
36:50 
36:50 
view
8 x 2 pkg/pub_integration/lib/src
pkg/pub_integration/lib/src
pub_http_client.dart
pub_http_client.dart
28:36 
43:51 
view
7 x 2 app/lib/frontend/dom
app/lib/frontend/dom
dom.dart
dom.dart
213:220 
254:261 
view