android / health-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
  • 8% duplication:
    • 2,050 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 183 duplicated lines
  • 16 duplicates
system8% (183 lines)
Duplication per Extension
kt8% (183 lines)
Duplication per Component (primary)
health-services/PassiveData/app/src/main/java/com/example/passivedata27% (52 lines)
health-platform-v1/HealthPlatformSample/app/src/main/java/com/example/healthplatformsample/presentation/ui14% (35 lines)
health-services/MeasureData/app/src/main/java/com/example/measuredata31% (34 lines)
health-services/PassiveGoals/app/src/main/java/com/example/passivegoals10% (25 lines)
health-platform-v1/HealthPlatformSample/app/src/main/java/com/example/healthplatformsample/presentation/components6% (16 lines)
health-platform-v1/HealthPlatformSample/app/src/main/java/com/example/healthplatformsample/data5% (12 lines)
health-services/ExerciseSample/app/src/main/java/com/example/exercise1% (9 lines)
health-platform-v1/HealthPlatformSample/app/src/main/java/com/example/healthplatformsample/presentation/navigation0% (0 lines)
health-platform-v1/HealthPlatformSample/app/src/main/java/com/example/healthplatformsample/presentation/theme0% (0 lines)
health-platform-v1/HealthPlatformSample/app/src/main/java/com/example/healthplatformsample/presentation0% (0 lines)
health-platform-v1/HealthPlatformSample/app/src/main/java/com/example/healthplatformsample0% (0 lines)

Duplication Between Components (50+ lines)

G health-services/MeasureData/app/src/main/java/com/example/measuredata health-services/MeasureData/app/src/main/java/com/example/measuredata health-services/PassiveData/app/src/main/java/com/example/passivedata health-services/PassiveData/app/src/main/java/com/example/passivedata health-services/MeasureData/app/src/main/java/com/example/measuredata--health-services/PassiveData/app/src/main/java/com/example/passivedata 68 health-services/PassiveGoals/app/src/main/java/com/example/passivegoals health-services/PassiveGoals/app/src/main/java/com/example/passivegoals health-services/PassiveData/app/src/main/java/com/example/passivedata--health-services/PassiveGoals/app/src/main/java/com/example/passivegoals 50

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 16 longest duplicates.
See data for all 16 duplicates...
Size#FoldersFilesLinesCode
14 x 2 health-services/MeasureD...com/example/measuredata
health-services/PassiveD...com/example/passivedata
MainActivity.kt
MainActivity.kt
35:53 (34%)
35:53 (31%)
view
12 x 2 health-platform-v1/Healt.../ui/SessionDetailScreen
health-platform-v1/Healt...ion/ui/TotalStepsScreen
SessionDetailViewModel.kt
TotalStepsViewModel.kt
45:63 (35%)
48:66 (33%)
view
11 x 2 health-platform-v1/Healt...n/ui/ListSessionsScreen
health-platform-v1/Healt...ion/ui/TotalStepsScreen
ListSessionsViewModel.kt
TotalStepsViewModel.kt
74:87 (22%)
53:66 (30%)
view
11 x 2 health-platform-v1/Healt...n/ui/ListSessionsScreen
health-platform-v1/Healt.../ui/SessionDetailScreen
ListSessionsViewModel.kt
SessionDetailViewModel.kt
74:87 (22%)
50:63 (32%)
view
10 x 2 health-services/PassiveD...com/example/passivedata
health-services/PassiveG...om/example/passivegoals
MainModule.kt
MainModule.kt
32:42 (90%)
32:42 (90%)
view
9 x 2 health-services/Exercise...va/com/example/exercise
health-services/PassiveD...com/example/passivedata
MainModule.kt
MainModule.kt
35:44 (75%)
32:41 (81%)
view
9 x 2 health-services/Exercise...va/com/example/exercise
health-services/PassiveG...om/example/passivegoals
MainModule.kt
MainModule.kt
35:44 (75%)
32:41 (81%)
view
8 x 2 health-platform-v1/Healt...presentation/components
health-platform-v1/Healt...presentation/components
SessionDetailsMinMaxAvg.kt
SessionDetailsMinMaxAvg.kt
46:53 (20%)
56:63 (20%)
view
8 x 2 health-services/PassiveD...com/example/passivedata
health-services/PassiveG...om/example/passivegoals
MainApplication.kt
MainApplication.kt
34:44 (80%)
34:44 (80%)
view
7 x 2 health-services/PassiveD...com/example/passivedata
health-services/PassiveG...om/example/passivegoals
StartupReceiver.kt
StartupReceiver.kt
77:84 (24%)
79:86 (22%)
view
7 x 2 health-services/MeasureD...com/example/measuredata
health-services/PassiveD...com/example/passivedata
MainModule.kt
MainModule.kt
32:38 (87%)
32:38 (63%)
view
7 x 2 health-services/MeasureD...com/example/measuredata
health-services/PassiveG...om/example/passivegoals
MainModule.kt
MainModule.kt
32:38 (87%)
32:38 (63%)
view
7 x 2 health-services/MeasureD...com/example/measuredata
health-services/PassiveD...com/example/passivedata
MainActivity.kt
MainActivity.kt
89:99 (17%)
90:100 (15%)
view
7 x 2 health-services/Exercise...va/com/example/exercise
health-services/MeasureD...com/example/measuredata
MainModule.kt
MainModule.kt
35:41 (58%)
32:38 (87%)
view
6 x 2 health-platform-v1/Healt...althplatformsample/data
health-platform-v1/Healt...althplatformsample/data
HealthPlatformManager.kt
HealthPlatformManager.kt
100:105 (3%)
131:136 (3%)
view
6 x 2 health-services/MeasureD...com/example/measuredata
health-services/PassiveD...com/example/passivedata
MainViewModel.kt
MainViewModel.kt
47:54 (19%)
45:52 (19%)
view