flutter / codelabs
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
  • 93% duplication:
    • 50,616 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 47,088 duplicated lines
  • 14,459 duplicates
system93% (47,088 lines)
Duplication per Extension
dart94% (29,390 lines)
cpp99% (7,079 lines)
html99% (3,142 lines)
yaml85% (1,762 lines)
cc88% (1,719 lines)
h81% (1,620 lines)
ts83% (832 lines)
swift77% (762 lines)
cmake100% (740 lines)
m43% (42 lines)
Duplication per Component (primary)
dartpad_codelabs96% (8,071 lines)
in_app_purchases93% (5,097 lines)
cupertino_store97% (5,020 lines)
firebase-get-to-know-flutter96% (4,472 lines)
startup_namer95% (4,223 lines)
adaptive_app88% (3,822 lines)
friendly_chat93% (3,337 lines)
photos-sharing95% (3,156 lines)
testing_codelab96% (3,084 lines)
github-client84% (2,631 lines)
webview_flutter92% (1,783 lines)
star_counter98% (1,526 lines)
cookbook76% (465 lines)
google-maps-in-flutter60% (355 lines)
plugin_codelab8% (32 lines)
ROOT73% (14 lines)

Duplication Between Components (50+ lines)

G friendly_chat friendly_chat startup_namer startup_namer friendly_chat--startup_namer 6605 testing_codelab testing_codelab friendly_chat--testing_codelab 5085 github-client github-client friendly_chat--github-client 4295 star_counter star_counter friendly_chat--star_counter 1092 google-maps-in-flutter google-maps-in-flutter friendly_chat--google-maps-in-flutter 949 webview_flutter webview_flutter friendly_chat--webview_flutter 470 startup_namer--testing_codelab 5956 startup_namer--webview_flutter 463 adaptive_app adaptive_app adaptive_app--friendly_chat 5162 adaptive_app--startup_namer 6106 adaptive_app--testing_codelab 4522 adaptive_app--github-client 3846 cookbook cookbook adaptive_app--cookbook 2742 firebase-get-to-know-flutter firebase-get-to-know-flutter adaptive_app--firebase-get-to-know-flutter 1174 adaptive_app--star_counter 1013 adaptive_app--google-maps-in-flutter 776 adaptive_app--webview_flutter 369 cupertino_store cupertino_store adaptive_app--cupertino_store 252 testing_codelab--webview_flutter 222 github-client--startup_namer 4998 github-client--testing_codelab 3828 github-client--webview_flutter 220 cookbook--friendly_chat 3255 cookbook--startup_namer 4157 cookbook--testing_codelab 2718 cookbook--github-client 2222 cookbook--firebase-get-to-know-flutter 630 cookbook--star_counter 624 cookbook--google-maps-in-flutter 350 firebase-get-to-know-flutter--friendly_chat 1323 firebase-get-to-know-flutter--startup_namer 1379 firebase-get-to-know-flutter--testing_codelab 968 firebase-get-to-know-flutter--star_counter 1164 firebase-get-to-know-flutter--google-maps-in-flutter 794 firebase-get-to-know-flutter--webview_flutter 308 star_counter--startup_namer 1260 star_counter--testing_codelab 864 star_counter--webview_flutter 204 google-maps-in-flutter--startup_namer 1093 google-maps-in-flutter--testing_codelab 740 google-maps-in-flutter--star_counter 834 google-maps-in-flutter--webview_flutter 393 cupertino_store--friendly_chat 274 cupertino_store--startup_namer 240 cupertino_store--firebase-get-to-know-flutter 220 cupertino_store--webview_flutter 272 dartpad_codelabs dartpad_codelabs dartpad_codelabs--github-client 223 dartpad_codelabs--webview_flutter 197 in_app_purchases in_app_purchases in_app_purchases--startup_namer 205 in_app_purchases--webview_flutter 177

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 14,459 duplicates...
Size#FoldersFilesLinesCode
387 x 2 firebase-get-to-know-flutter/step_02/lib/src
firebase-get-to-know-flutter/step_09/lib/src
authentication.dart
authentication.dart
1:427 (100%)
1:427 (100%)
view
387 x 2 firebase-get-to-know-flutter/step_06/lib/src
firebase-get-to-know-flutter/step_09/lib/src
authentication.dart
authentication.dart
1:427 (100%)
1:427 (100%)
view
387 x 2 firebase-get-to-know-flutter/step_04/lib/src
firebase-get-to-know-flutter/step_05/lib/src
authentication.dart
authentication.dart
1:427 (100%)
1:427 (100%)
view
387 x 2 firebase-get-to-know-flutter/step_04/lib/src
firebase-get-to-know-flutter/step_06/lib/src
authentication.dart
authentication.dart
1:427 (100%)
1:427 (100%)
view
387 x 2 firebase-get-to-know-flutter/step_04/lib/src
firebase-get-to-know-flutter/step_07/lib/src
authentication.dart
authentication.dart
1:427 (100%)
1:427 (100%)
view
387 x 2 firebase-get-to-know-flutter/step_07/lib/src
firebase-get-to-know-flutter/step_09/lib/src
authentication.dart
authentication.dart
1:427 (100%)
1:427 (100%)
view
387 x 2 firebase-get-to-know-flutter/step_05/lib/src
firebase-get-to-know-flutter/step_06/lib/src
authentication.dart
authentication.dart
1:427 (100%)
1:427 (100%)
view
387 x 2 firebase-get-to-know-flutter/step_02/lib/src
firebase-get-to-know-flutter/step_04/lib/src
authentication.dart
authentication.dart
1:427 (100%)
1:427 (100%)
view
387 x 2 firebase-get-to-know-flutter/step_05/lib/src
firebase-get-to-know-flutter/step_07/lib/src
authentication.dart
authentication.dart
1:427 (100%)
1:427 (100%)
view
387 x 2 firebase-get-to-know-flutter/step_02/lib/src
firebase-get-to-know-flutter/step_05/lib/src
authentication.dart
authentication.dart
1:427 (100%)
1:427 (100%)
view
387 x 2 firebase-get-to-know-flutter/step_04/lib/src
firebase-get-to-know-flutter/step_09/lib/src
authentication.dart
authentication.dart
1:427 (100%)
1:427 (100%)
view
387 x 2 firebase-get-to-know-flutter/step_02/lib/src
firebase-get-to-know-flutter/step_06/lib/src
authentication.dart
authentication.dart
1:427 (100%)
1:427 (100%)
view
387 x 2 firebase-get-to-know-flutter/step_06/lib/src
firebase-get-to-know-flutter/step_07/lib/src
authentication.dart
authentication.dart
1:427 (100%)
1:427 (100%)
view
387 x 2 firebase-get-to-know-flutter/step_02/lib/src
firebase-get-to-know-flutter/step_07/lib/src
authentication.dart
authentication.dart
1:427 (100%)
1:427 (100%)
view
387 x 2 firebase-get-to-know-flutter/step_05/lib/src
firebase-get-to-know-flutter/step_09/lib/src
authentication.dart
authentication.dart
1:427 (100%)
1:427 (100%)
view
342 x 2 dartpad_codelabs/src/inherited_widget/step_03
dartpad_codelabs/src/inherited_widget/step_04
solution.dart
solution.dart
14:448 (96%)
16:450 (96%)
view
332 x 2 dartpad_codelabs/src/inherited_widget/step_04
dartpad_codelabs/src/inherited_widget/step_05
snippet.dart
snippet.dart
15:432 (96%)
17:435 (96%)
view
328 x 2 dartpad_codelabs/src/inherited_widget/step_07
dartpad_codelabs/src/inherited_widget/step_08
solution.dart
snippet.dart
1:408 (100%)
1:408 (100%)
view
275 x 2 cupertino_store/step_03/lib/model
cupertino_store/step_05/lib/model
products_repository.dart
products_repository.dart
15:291 (100%)
15:291 (100%)
view
275 x 2 cupertino_store/step_01/lib/model
cupertino_store/step_03/lib/model
products_repository.dart
products_repository.dart
15:291 (100%)
15:291 (100%)
view
Duplicated Units
The list of top 20 duplicated units.
See data for all 247 unit duplicates...
Size#FoldersFilesLinesCode
89 x 6 firebase-get-to-know-flutter/step_04/lib/src
firebase-get-to-know-flutter/step_05/lib/src
firebase-get-to-know-flutter/step_02/lib/src
firebase-get-to-know-flutter/step_09/lib/src
firebase-get-to-know-flutter/step_07/lib/src
firebase-get-to-know-flutter/step_06/lib/src
authentication.dart
authentication.dart
authentication.dart
authentication.dart
authentication.dart
authentication.dart
244:333 
244:333 
244:333 
244:333 
244:333 
244:333 
view
74 x 5 cupertino_store/step_04/lib
cupertino_store/step_05/lib
cupertino_store/step_02/lib
cupertino_store/step_03/lib
cupertino_store/step_06/lib
product_row_item.dart
product_row_item.dart
product_row_item.dart
product_row_item.dart
product_row_item.dart
33:109 
33:109 
33:109 
33:109 
33:109 
view
71 x 8 dartpad_codelabs/src/get...ed_with_slivers/step_04
dartpad_codelabs/src/get...ed_with_slivers/step_05
dartpad_codelabs/src/get...ed_with_slivers/step_05
dartpad_codelabs/src/get...ed_with_slivers/step_08
dartpad_codelabs/src/get...ed_with_slivers/step_07
dartpad_codelabs/src/get...ed_with_slivers/step_07
dartpad_codelabs/src/get...ed_with_slivers/step_06
dartpad_codelabs/src/get...ed_with_slivers/step_06
solution.dart
solution.dart
snippet.dart
snippet.dart
solution.dart
snippet.dart
solution.dart
snippet.dart
42:114 
46:118 
45:117 
72:144 
72:144 
64:136 
62:134 
47:119 
view
69 x 6 firebase-get-to-know-flutter/step_04/lib/src
firebase-get-to-know-flutter/step_05/lib/src
firebase-get-to-know-flutter/step_02/lib/src
firebase-get-to-know-flutter/step_09/lib/src
firebase-get-to-know-flutter/step_07/lib/src
firebase-get-to-know-flutter/step_06/lib/src
authentication.dart
authentication.dart
authentication.dart
authentication.dart
authentication.dart
authentication.dart
359:428 
359:428 
359:428 
359:428 
359:428 
359:428 
view
68 x 6 firebase-get-to-know-flutter/step_04/lib/src
firebase-get-to-know-flutter/step_05/lib/src
firebase-get-to-know-flutter/step_02/lib/src
firebase-get-to-know-flutter/step_09/lib/src
firebase-get-to-know-flutter/step_07/lib/src
firebase-get-to-know-flutter/step_06/lib/src
authentication.dart
authentication.dart
authentication.dart
authentication.dart
authentication.dart
authentication.dart
47:115 
47:115 
47:115 
47:115 
47:115 
47:115 
view
68 x 2 dartpad_codelabs/src/get...ed_with_slivers/step_04
dartpad_codelabs/src/get...ed_with_slivers/step_03
snippet.dart
solution.dart
41:111 
40:109 
view
59 x 2 photos-sharing/final/lib/components
photos-sharing/initial/lib/components
trip_app_bar.dart
trip_app_bar.dart
54:118 
54:118 
view
53 x 7 webview_flutter/step_11/lib/src
webview_flutter/step_10/lib/src
webview_flutter/step_08/lib/src
webview_flutter/step_09/lib/src
webview_flutter/step_12/lib/src
webview_flutter/step_07/lib/src
webview_flutter/step_06/lib/src
navigation_controls.dart
navigation_controls.dart
navigation_controls.dart
navigation_controls.dart
navigation_controls.dart
navigation_controls.dart
navigation_controls.dart
12:66 
12:66 
12:66 
12:66 
12:66 
12:66 
12:66 
view
52 x 2 in_app_purchases/step_10...e-backend/functions/src
in_app_purchases/complet...e-backend/functions/src
app-store.purchase-handler.ts
app-store.purchase-handler.ts
43:101 
49:107 
view
51 x 14 dartpad_codelabs/src/get...ed_with_slivers/step_01
dartpad_codelabs/src/get...ed_with_slivers/step_04
dartpad_codelabs/src/get...ed_with_slivers/step_04
dartpad_codelabs/src/get...ed_with_slivers/step_05
dartpad_codelabs/src/get...ed_with_slivers/step_05
dartpad_codelabs/src/get...ed_with_slivers/step_08
dartpad_codelabs/src/get...ed_with_slivers/step_02
dartpad_codelabs/src/get...ed_with_slivers/step_02
dartpad_codelabs/src/get...ed_with_slivers/step_03
dartpad_codelabs/src/get...ed_with_slivers/step_03
...
snippet.dart
solution.dart
snippet.dart
solution.dart
snippet.dart
snippet.dart
solution.dart
snippet.dart
solution.dart
snippet.dart
...
79:131 
125:177 
122:174 
129:181 
128:180 
155:207 
79:131 
81:133 
120:172 
79:131 
...
view
50 x 3 star_counter/step_08/lib
star_counter/step_09/lib
star_counter/step_07/lib
main.dart
main.dart
main.dart
37:87 
35:85 
37:87 
view
50 x 2 firebase-get-to-know-flutter/step_09/lib
firebase-get-to-know-flutter/step_07/lib
main.dart
main.dart
303:353 
248:298 
view
49 x 6 firebase-get-to-know-flutter/step_04/lib/src
firebase-get-to-know-flutter/step_05/lib/src
firebase-get-to-know-flutter/step_02/lib/src
firebase-get-to-know-flutter/step_09/lib/src
firebase-get-to-know-flutter/step_07/lib/src
firebase-get-to-know-flutter/step_06/lib/src
authentication.dart
authentication.dart
authentication.dart
authentication.dart
authentication.dart
authentication.dart
165:214 
165:214 
165:214 
165:214 
165:214 
165:214 
view
48 x 2 in_app_purchases/step_10...e-backend/functions/src
in_app_purchases/complet...e-backend/functions/src
google-play.purchase-handler.ts
google-play.purchase-handler.ts
30:86 
34:90 
view
48 x 16 dartpad_codelabs/src/inherited_widget/step_01
dartpad_codelabs/src/inherited_widget/step_01
dartpad_codelabs/src/inherited_widget/step_04
dartpad_codelabs/src/inherited_widget/step_04
dartpad_codelabs/src/inherited_widget/step_05
dartpad_codelabs/src/inherited_widget/step_05
dartpad_codelabs/src/inherited_widget/step_08
dartpad_codelabs/src/inherited_widget/step_02
dartpad_codelabs/src/inherited_widget/step_02
dartpad_codelabs/src/inherited_widget/intro
...
solution.dart
snippet.dart
solution.dart
snippet.dart
solution.dart
snippet.dart
snippet.dart
solution.dart
snippet.dart
snippet.dart
...
233:283 
214:264 
312:362 
302:352 
295:345 
305:355 
270:320 
249:299 
242:292 
211:261 
...
view
47 x 2 photos-sharing/final/lib/pages
photos-sharing/initial/lib/pages
trip_list_page.dart
trip_list_page.dart
89:136 
89:136 
view
46 x 3 webview_flutter/step_11/lib/src
webview_flutter/step_10/lib/src
webview_flutter/step_12/lib/src
web_view_stack.dart
web_view_stack.dart
web_view_stack.dart
18:64 
18:64 
18:64 
view
46 x 6 cupertino_store/step_01/lib
cupertino_store/step_04/lib
cupertino_store/step_05/lib
cupertino_store/step_02/lib
cupertino_store/step_03/lib
cupertino_store/step_06/lib
app.dart
app.dart
app.dart
app.dart
app.dart
app.dart
42:88 
42:88 
42:88 
42:88 
42:88 
42:88 
view
46 x 9 dartpad_codelabs/src/inherited_widget/step_01
dartpad_codelabs/src/inherited_widget/step_04
dartpad_codelabs/src/inherited_widget/step_05
dartpad_codelabs/src/inherited_widget/step_08
dartpad_codelabs/src/inherited_widget/step_02
dartpad_codelabs/src/inherited_widget/intro
dartpad_codelabs/src/inherited_widget/step_03
dartpad_codelabs/src/inherited_widget/step_07
dartpad_codelabs/src/inherited_widget/step_06
solution.dart
solution.dart
solution.dart
snippet.dart
solution.dart
snippet.dart
solution.dart
solution.dart
solution.dart
296:343 
375:422 
358:405 
333:380 
312:359 
273:320 
373:420 
333:380 
330:377 
view
45 x 2 dartpad_codelabs/src/get...ed_with_slivers/step_08
dartpad_codelabs/src/get...ed_with_slivers/step_07
snippet.dart
solution.dart
12:65 
12:65 
view