android / wear-os-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
  • 16% duplication:
    • 6,881 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 1,149 duplicated lines
  • 107 duplicates
system16% (1,149 lines)
Duplication per Extension
kt16% (930 lines)
java16% (219 lines)
Duplication per Component (primary)
WearAccessibilityApp16% (219 lines)
WearComplicationDataSourcesTestSuite37% (199 lines)
DataLayer30% (170 lines)
RuntimePermissionsWear20% (140 lines)
WearTilesKotlin23% (138 lines)
ComposeAdvanced16% (98 lines)
WearOAuth26% (70 lines)
WearSpeakerSample7% (50 lines)
ComposeStarter42% (27 lines)
WatchFaceAlphaKotlin1% (14 lines)
AlwaysOnKotlin2% (12 lines)
WearVerifyRemoteApp5% (12 lines)
WearStandaloneGoogleSignIn0% (0 lines)
TimeText0% (0 lines)

Duplication Between Components (50+ lines)

G ComposeAdvanced ComposeAdvanced ComposeStarter ComposeStarter ComposeAdvanced--ComposeStarter 54

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 107 duplicates...
Size#FoldersFilesLinesCode
23 x 2 WearComplicationDataSour...ationproviderstestsuite
WearComplicationDataSour...ationproviderstestsuite
LongTextDataSourceService.kt
ShortTextDataSourceService.kt
53:79 (17%)
51:77 (25%)
view
22 x 2 WearOAuth/oauth-device-g...rable/oauth/devicegrant
WearOAuth/oauth-pkce/src...oid/wearable/oauth/pkce
AuthDeviceGrantViewModel.kt
AuthPKCEViewModel.kt
164:193 (22%)
179:207 (21%)
view
20 x 2 ComposeAdvanced/app/src/...presentation/components
ComposeAdvanced/app/src/...presentation/components
CustomPositionIndicator.kt
CustomTimeText.kt
37:60 (64%)
62:85 (39%)
view
19 x 2 ComposeAdvanced/app/src/...presentation/components
ComposeAdvanced/app/src/...presentation/components
CustomTimeText.kt
CustomVignette.kt
66:85 (37%)
38:57 (59%)
view
19 x 2 ComposeAdvanced/app/src/...presentation/components
ComposeAdvanced/app/src/...presentation/components
CustomPositionIndicator.kt
CustomVignette.kt
41:60 (61%)
38:57 (59%)
view
16 x 2 WearComplicationDataSour...ationproviderstestsuite
WearComplicationDataSour...ationproviderstestsuite
LongTextDataSourceService.kt
SmallImageDataSourceService.kt
53:71 (12%)
52:70 (30%)
view
16 x 2 WearComplicationDataSour...ationproviderstestsuite
WearComplicationDataSour...ationproviderstestsuite
LargeImageDataSourceService.kt
RangedValueDataSourceService.kt
50:73 (34%)
54:73 (21%)
view
16 x 2 WearComplicationDataSour...ationproviderstestsuite
WearComplicationDataSour...ationproviderstestsuite
ShortTextDataSourceService.kt
SmallImageDataSourceService.kt
51:69 (17%)
52:70 (30%)
view
16 x 2 WearAccessibilityApp/Wea...ar/wearaccessibilityapp
WearAccessibilityApp/Wea...ar/wearaccessibilityapp
MessagingIntentService.java
NotificationsActivity.java
207:231 (17%)
229:258 (10%)
view
15 x 2 DataLayer/Application/sr...roid/wearable/datalayer
DataLayer/Wearable/src/m...roid/wearable/datalayer
MainApp.kt
MainApp.kt
123:137 (15%)
151:165 (12%)
view
15 x 2 ComposeAdvanced/app/src/...nced/presentation/theme
ComposeStarter/app/src/m...rter/presentation/theme
Color.kt
Color.kt
21:39 (93%)
21:36 (93%)
view
14 x 2 WearAccessibilityApp/Wea...ar/wearaccessibilityapp
WearAccessibilityApp/Wea...ar/wearaccessibilityapp
ListsActivity.java
ProgressActivity.java
57:79 (43%)
57:79 (43%)
view
14 x 2 WearAccessibilityApp/Wea...ar/wearaccessibilityapp
WearAccessibilityApp/Wea...araccessibilityapp/util
NotificationsActivity.java
NotificationUtil.java
319:343 (8%)
43:67 (60%)
view
13 x 2 DataLayer/Application/sr...roid/wearable/datalayer
DataLayer/Wearable/src/m...roid/wearable/datalayer
MainApp.kt
MainApp.kt
80:92 (13%)
100:112 (10%)
view
13 x 2 WearComplicationDataSour...ationproviderstestsuite
WearComplicationDataSour...ationproviderstestsuite
RangedValueDataSourceService.kt
ShortTextDataSourceService.kt
54:68 (17%)
51:64 (14%)
view
13 x 2 WearComplicationDataSour...ationproviderstestsuite
WearComplicationDataSour...ationproviderstestsuite
RangedValueDataSourceService.kt
SmallImageDataSourceService.kt
54:68 (17%)
52:65 (24%)
view
13 x 2 WearComplicationDataSour...ationproviderstestsuite
WearComplicationDataSour...ationproviderstestsuite
LongTextDataSourceService.kt
RangedValueDataSourceService.kt
53:66 (10%)
54:68 (17%)
view
13 x 2 WearComplicationDataSour...ationproviderstestsuite
WearComplicationDataSour...ationproviderstestsuite
LargeImageDataSourceService.kt
SmallImageDataSourceService.kt
50:68 (27%)
52:65 (24%)
view
13 x 2 WearComplicationDataSour...ationproviderstestsuite
WearComplicationDataSour...ationproviderstestsuite
LargeImageDataSourceService.kt
ShortTextDataSourceService.kt
50:68 (27%)
51:64 (14%)
view
13 x 2 WearComplicationDataSour...ationproviderstestsuite
WearComplicationDataSour...ationproviderstestsuite
LargeImageDataSourceService.kt
LongTextDataSourceService.kt
50:68 (27%)
53:66 (10%)
view
Duplicated Units
The list of top 2 duplicated units.
See data for all 2 unit duplicates...
Size#FoldersFilesLinesCode
13 x 2 WearOAuth/oauth-device-g...rable/oauth/devicegrant
WearOAuth/oauth-pkce/src...oid/wearable/oauth/pkce
AuthDeviceGrantActivity.kt
AuthPKCEActivity.kt
40:59 
37:56 
view
7 x 2 DataLayer/Wearable/src/m...roid/wearable/datalayer
DataLayer/Application/sr...roid/wearable/datalayer
ClientDataViewModel.kt
ClientDataViewModel.kt
114:121 
81:88 
view