firebase / quickstart-ios
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
  • 16% duplication:
    • 13,374 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 2,201 duplicated lines
  • 254 duplicates
system16% (2,201 lines)
Duplication per Extension
swift16% (1,539 lines)
m16% (650 lines)
h4% (12 lines)
Duplication per Component (primary)
authentication19% (823 lines)
firestore21% (345 lines)
database15% (327 lines)
config29% (158 lines)
crashlytics36% (113 lines)
performance9% (83 lines)
functions12% (67 lines)
analytics6% (55 lines)
inappmessaging35% (44 lines)
storage12% (41 lines)
appdistribution41% (30 lines)
dynamiclinks4% (30 lines)
messaging9% (25 lines)
installations15% (22 lines)
swiftui10% (13 lines)
template26% (10 lines)
abtesting2% (8 lines)
admob3% (7 lines)
scripts0% (0 lines)

Duplication Between Components (50+ lines)

G authentication authentication database database authentication--database 172 config config authentication--config 104 performance performance database--performance 60 analytics analytics analytics--config 91 storage storage performance--storage 66 appdistribution appdistribution appdistribution--config 60 dynamiclinks dynamiclinks inappmessaging inappmessaging dynamiclinks--inappmessaging 55 messaging messaging messaging--storage 50 crashlytics crashlytics crashlytics--database 50

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 254 duplicates...
Size#FoldersFilesLinesCode
53 x 2 firestore/FirestoreExample
firestore/FirestoreSwiftUIExample/Extensions
Restaurant.swift
Restaurant+Extension.swift
41:94 (59%)
27:80 (76%)
view
44 x 2 database/DatabaseExample...aseExample/Shared/Views
database/DatabaseExample...aseExample/Shared/Views
LoginView.swift
SignUpView.swift
28:81 (45%)
27:80 (45%)
view
38 x 2 config/ConfigExample
config/ConfigExample
Extensions.swift
RemoteConfigView.swift
17:75 (76%)
185:243 (22%)
view
34 x 2 authentication/Authentic...Example/ViewControllers
authentication/Authentic...Example/ViewControllers
AccountLinkingViewController.swift
AuthViewController.swift
474:532 (11%)
284:342 (18%)
view
26 x 2 crashlytics/LegacyCrashl...CrashlyticsExampleSwift
crashlytics/Shared
ViewController.swift
ReachabililtyHelper.swift
73:114 (44%)
25:66 (96%)
view
24 x 2 firestore/FirestoreExample
firestore/FirestoreExample
StarsView.swift
StarsView.swift
150:183 (11%)
327:360 (11%)
view
22 x 2 authentication/Authentic...Example/ViewControllers
authentication/LegacyAut...henticationExampleSwift
AuthViewController.swift
MainViewController.swift
301:332 (12%)
1045:1076 (3%)
view
22 x 2 authentication/Authentic...Example/ViewControllers
authentication/LegacyAut...henticationExampleSwift
AccountLinkingViewController.swift
MainViewController.swift
491:522 (7%)
1045:1076 (3%)
view
21 x 2 authentication/LegacyAut...t/AuthenticationExample
authentication/LegacyAut...t/AuthenticationExample
MainViewController.m
MainViewController.m
265:290 (2%)
298:323 (2%)
view
21 x 2 authentication/LegacyAut...t/AuthenticationExample
authentication/LegacyAut...t/AuthenticationExample
MainViewController.m
MainViewController.m
265:290 (2%)
462:487 (2%)
view
21 x 2 authentication/LegacyAut...t/AuthenticationExample
authentication/LegacyAut...t/AuthenticationExample
MainViewController.m
MainViewController.m
298:323 (2%)
462:487 (2%)
view
18 x 2 authentication/LegacyAut...t/AuthenticationExample
database/DatabaseExample
UIViewController+Alerts.m
UIViewController+Alerts.m
133:159 (20%)
257:283 (9%)
view
18 x 2 authentication/Authentic...Example/ViewControllers
authentication/Authentic...Example/ViewControllers
AccountLinkingViewController.swift
AuthViewController.swift
444:469 (6%)
245:270 (9%)
view
18 x 2 authentication/Authentic...Example/ViewControllers
authentication/Authentic...Example/ViewControllers
AccountLinkingViewController.swift
AuthViewController.swift
139:164 (6%)
89:114 (9%)
view
17 x 2 authentication/LegacyAut...t/AuthenticationExample
authentication/LegacyAut...t/AuthenticationExample
EmailViewController.m
MainViewController.m
43:62 (14%)
141:160 (2%)
view
15 x 2 crashlytics/LegacyCrashl...CrashlyticsExampleSwift
crashlytics/Shared
ViewController.swift
CrashlyticsSwiftUIExampleApp.swift
46:60 (25%)
29:43 (35%)
view
14 x 2 dynamiclinks/DynamicLinksExample
inappmessaging/InAppMessagingExample
AppDelegate.m
AppDelegate.m
33:53 (18%)
33:50 (46%)
view
14 x 2 firestore/FirestoreExample
firestore/FirestoreSwiftUIExample/Extensions
RestaurantsTableViewController.swift
Firestore+Extension.swift
183:197 (5%)
42:56 (27%)
view
14 x 2 appdistribution/AppDistributionExample
config/ConfigExample
AppDelegate.swift
AppDelegate.swift
18:37 (100%)
18:38 (87%)
view
14 x 2 analytics/AnalyticsExample
appdistribution/AppDistributionExample
AppDelegate.swift
AppDelegate.swift
18:37 (100%)
18:37 (100%)
view
Duplicated Units
The list of top 8 duplicated units.
See data for all 8 unit duplicates...
Size#FoldersFilesLinesCode
19 x 2 authentication/AuthenticationExampleUITests
authentication/AuthenticationExampleUITests
AuthenticationExampleUITests.swift
AuthenticationExampleUITests.swift
76:103 
105:133 
view
14 x 2 crashlytics/LegacyCrashl...CrashlyticsExampleSwift
crashlytics/Shared
ViewController.swift
ReachabililtyHelper.swift
80:95 
32:47 
view
11 x 2 crashlytics/LegacyCrashl...CrashlyticsExampleSwift
crashlytics/Shared
ViewController.swift
ReachabililtyHelper.swift
100:111 
52:63 
view
7 x 4 appdistribution/AppDistributionExample
authentication/AuthenticationExample
analytics/AnalyticsExample
config/ConfigExample
AppDelegate.swift
AppDelegate.swift
AppDelegate.swift
AppDelegate.swift
29:38 
49:58 
29:38 
30:39 
view
6 x 2 storage/StorageExampleSwift
performance/PerformanceExampleSwift
AppDelegate.swift
AppDelegate.swift
24:33 
24:33 
view
6 x 4 crashlytics/Shared
abtesting/Shared
database/DatabaseExample.../DatabaseExample/Shared
performance/SwiftUIPerfo...rformanceExample/Shared
UITests.swift
UITests.swift
UITests.swift
UITests.swift
38:45 
98:105 
85:92 
219:226 
view
6 x 3 appdistribution/AppDistributionUITests
authentication/AuthenticationExampleUITests
config/ConfigExampleUITests
AppDistributionExampleUITests.swift
AuthenticationExampleUITests.swift
ConfigExampleUITests.swift
38:45 
230:237 
38:45 
view
6 x 2 analytics/LegacyAnalytic...AnalyticsExampleUITests
admob/AdMobExampleUITests
AnalyticsExampleUITests.m
AdMobExampleUITests.m
60:66 
88:94 
view