Public report of celzero/rethink-app, published 24 October 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Watchdog signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 24 October 2026, 20:31 UTC · Survey ID cd_a1fd9ed95de8497f995c9e785c2322c3

celzero/rethink-app

Measured 24 October 2026, 20:28 UTC, at code version 4170168

No regression since the last survey

A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.

CAI score 50out of 100 Adequate
CriticalWeakAdequateStrongExemplary
Up 1 since the last survey

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A large codebase: 179,854 lines of product code in 2 projects, tests not counted · Estimated rebuild effort: about 1.5 person-years · Weakest lens: Domain Modelling, 42

Findings by how serious they are

34 critical 1402 serious 74 minor

16 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
24 October 2026, 20:28 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that implements it, and today Watchdog is the only one that does.

The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

67of 70 dimensions measured by tools. The other 3 are advisory notes from an AI model, which explain the code but don't count towards the score.
1497of 1510 findings point to an exact file and line, so you can open each one in the code. The other 13 concern the repository as a whole, such as missing documentation.
70dimensions across 7 lenses, read from 179,854 lines of product code in 2 projects.
Chapters

Executive summary

celzero/rethink-app scores 50 out of 100 and is rated Adequate, while five of its seven lenses score higher still: Architecture at 89, Security and Compliance at 58 and Production Readiness at 57, all rated Adequate, and Performance at 81 and Code Health at 80, both rated Strong. The project hasn't declared a stable release yet, so its lenses are rated against a lower bar than a released product's, while the score itself is worked out as for any repository.

The score is lower than those five because the weakest lens counts most, and here that is Domain Modelling, which scores 42 and is rated Weak. Its Encapsulated state dimension scores 1.3 out of 10, and until that reaches 4, Domain Modelling can't be rated higher than Adequate. The first actions are to resolve the 1 No ADRs found finding(s) in ADR Quality and to resolve the 2 Off-boarding risk finding(s) in Bus Factor, and if Domain Modelling rose to 70, the score would rise from 50 to about 56.

34 findings are critical: 30 in Static Analysis (SAST) and four in Secrets (history).

Watchdog couldn't measure 13 dimensions in this code, among them Code Coverage, Test Reliability and Dependency Hygiene, so they are left out of the score. The product code is 179,854 lines, which would take an estimated 1.5 person-years, around €220,000, to rebuild.

A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Domain Modelling 42 · counts for 46%Maturity 47 · counts for 25%Production Readiness 57 · counts for 14%Security and Compliance 58 · counts for 8%Code Health 80 · counts for 4%Performance 81 · counts for 2%Architecture 89 · counts for 1%

If Domain Modelling rose from 42 to 70, the lowest score rated Strong, the score would rise from 50 to about 56.

Code composition: what the lines of code are
Product code 86%Tests 14%
New since the last survey: 237 findings

These 237 critical or serious findings weren't in the previous survey, on 10 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.

  • Cyclomatic Complexity · InAppBillingHandler.handlePurchaseInternal (cyclomatic 70) REDACTED
  • Cyclomatic Complexity · InAppBillingHandler.handlePurchaseInternal (cyclomatic 70) app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt
  • Cyclomatic Complexity · CustomerSupportActivity.collectAndSend (cyclomatic 39) app/src/main/java/com/celzero/bravedns/ui/activity/CustomerSupportActivity.kt
  • Cyclomatic Complexity · RpnPurchaseRouteKt.RpnPurchaseRoute (cyclomatic 29) app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt
  • Cyclomatic Complexity · RpnManagePurchaseScreenKt.RpnManagePurchaseScreen (cyclomatic 29) app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnManagePurchaseScreen.kt
  • Cyclomatic Complexity · RpnPurchaseRouteKt.RpnPurchaseRoute (cyclomatic 29) app/src/websiteTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt
  • Cyclomatic Complexity · RpnProxyManager.handleStateChange (cyclomatic 26) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt
  • Cyclomatic Complexity · SubscriptionStateMachineV2.expireStaleSubsFromDb (cyclomatic 23) app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt
  • Cyclomatic Complexity · RpnHomeScreenKt.RpnHomeScreen (cyclomatic 21) app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnHomeScreen.kt
  • Cyclomatic Complexity · RpnProxyManager.refreshWinEntitlement (cyclomatic 20) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt
  • Cyclomatic Complexity · TunDnsManager.decideUpstreamAnswer (cyclomatic 20) app/src/main/java/com/celzero/bravedns/tunnel/TunDnsManager.kt
  • Cyclomatic Complexity · InAppBillingHandler.validateSubsWithServerBeforeExpiry (cyclomatic 20) REDACTED
  • Cyclomatic Complexity · InAppBillingHandler.validateSubsWithServerBeforeExpiry (cyclomatic 20) app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt
  • Cyclomatic Complexity · ManagePurchaseViewModel.launchOperation (cyclomatic 18) app/src/main/java/com/celzero/bravedns/viewmodel/ManagePurchaseViewModel.kt
  • Cyclomatic Complexity · BillingBackendClient.refreshIdentityLocked (cyclomatic 18) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Cyclomatic Complexity · BillingBackendClient.refreshIdentityLocked (cyclomatic 18) app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Cyclomatic Complexity · OneTimePurchaseProcessor.processInAppPurchased (cyclomatic 17) app/src/play/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt
  • Cyclomatic Complexity · RpnPlusDashboardScreenKt.RpnPlusDashboardScreen (cyclomatic 17) app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnPlusDashboardScreen.kt
  • Cyclomatic Complexity · OneTimePurchaseProcessor.processInAppPurchased (cyclomatic 17) app/src/website/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt
  • Cyclomatic Complexity · SubscriptionStateMachineV2.handleSubscriptionRestored (cyclomatic 16) app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt
  • Cyclomatic Complexity · BillingBackendClient.queryEntitlement (cyclomatic 16) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Cyclomatic Complexity · InAppBillingHandler.purchaseOneTime (cyclomatic 16) REDACTED
  • Cyclomatic Complexity · InAppBillingHandler.launchFlow (cyclomatic 16) REDACTED
  • Cyclomatic Complexity · BillingBackendClient.queryEntitlement (cyclomatic 16) app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Cyclomatic Complexity · InAppBillingHandler.purchaseOneTime (cyclomatic 16) app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt
  • Cyclomatic Complexity · InAppBillingHandler.launchFlow (cyclomatic 16) app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt
  • Cognitive Complexity · InAppBillingHandler.handlePurchaseInternal (cognitive 203) REDACTED
  • Cognitive Complexity · InAppBillingHandler.handlePurchaseInternal (cognitive 203) app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt
  • Cognitive Complexity · RpnProxyManager.refreshWinEntitlement (cognitive 30) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt
  • Cognitive Complexity · RpnPurchaseRouteKt.RpnPurchaseRoute (cognitive 28) app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt
  • Cognitive Complexity · RpnPurchaseRouteKt.RpnPurchaseRoute (cognitive 28) app/src/websiteTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt
  • Cognitive Complexity · SubscriptionStateMachineV2.expireStaleSubsFromDb (cognitive 26) app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt
  • Cognitive Complexity · RpnHomeScreenKt.RpnHomeScreen (cognitive 26) app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnHomeScreen.kt
  • Cognitive Complexity · ExceptionParser.parseGoDump (cognitive 25) app/src/main/java/com/celzero/bravedns/util/ExceptionParser.kt
  • Cognitive Complexity · BillingBackendClient.refreshIdentityLocked (cognitive 25) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Cognitive Complexity · BillingBackendClient.refreshIdentityLocked (cognitive 25) app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Cognitive Complexity · RpnManagePurchaseScreenKt.RpnManagePurchaseScreen (cognitive 22) app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnManagePurchaseScreen.kt
  • Cognitive Complexity · TunDnsManager.decideUpstreamAnswer (cognitive 21) app/src/main/java/com/celzero/bravedns/tunnel/TunDnsManager.kt
  • Cognitive Complexity · InAppBillingHandler.queryPurchases (cognitive 20) REDACTED
  • Cognitive Complexity · InAppBillingHandler.queryPurchases (cognitive 20) app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt
  • Cognitive Complexity · RpnLocationDetailScreenKt.RpnLocationDetailScreen (cognitive 18) app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnLocationDetailScreen.kt
  • Cognitive Complexity · RpnSettingsScreenKt.RpnSettingsScreen (cognitive 18) app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnSettingsScreen.kt
  • Cognitive Complexity · RpnAddLocationScreenKt.RpnAddLocationScreen (cognitive 17) app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAddLocationScreen.kt
  • Cognitive Complexity · RpnSupportScreenKt.RpnSupportScreen (cognitive 17) app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnSupportScreen.kt
  • Cognitive Complexity · GoMemLogConsumer.processSlot (cognitive 16) app/src/main/java/com/celzero/bravedns/service/GoMemLogConsumer.kt
  • Cognitive Complexity · InAppBillingHandler.queryEntitlementFromServer (cognitive 16) REDACTED
  • Cognitive Complexity · RpnPlusDashboardScreenKt.RpnPlusDashboardScreen (cognitive 16) app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnPlusDashboardScreen.kt
  • Cognitive Complexity · InAppBillingHandler.queryEntitlementFromServer (cognitive 16) app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt
  • God Classes · MethodTooLong: InAppBillingHandler.handlePurchaseInternal REDACTED
  • God Classes · MethodTooLong: InAppBillingHandler.handlePurchaseInternal app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt
  • God Classes · MethodTooLong: RpnHomeScreenKt.RpnHomeScreen app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnHomeScreen.kt
  • God Classes · MethodTooLong: RpnLocationDetailScreenKt.RpnLocationDetailScreen app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnLocationDetailScreen.kt
  • God Classes · MethodTooLong: RpnSettingsScreenKt.RpnSettingsScreen app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnSettingsScreen.kt
  • God Classes · MethodTooLong: SubscriptionStateMachineV2.expireStaleInAppFromDb app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt
  • God Classes · MethodTooLong: RpnAddLocationScreenKt.RpnAddLocationScreen app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAddLocationScreen.kt
  • God Classes · MethodTooLong: CustomerSupportActivity.collectAndSend app/src/main/java/com/celzero/bravedns/ui/activity/CustomerSupportActivity.kt
  • God Classes · TooManyMethods: BillingBackendClient app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • God Classes · TooManyMethods: BillingBackendClient app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • God Classes · MethodTooLong: RpnPurchaseRouteKt.RpnPurchaseRoute app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt
  • God Classes · MethodTooLong: RpnPurchaseRouteKt.RpnPurchaseRoute app/src/websiteTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt
  • God Classes · MethodTooLong: TvNavScaffoldKt.TvNavScaffold app/src/tv/java/com/celzero/bravedns/tv/ui/nav/TvNavScaffold.kt
  • God Classes · MethodTooLong: RpnManagePurchaseScreenKt.RpnManagePurchaseScreen app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnManagePurchaseScreen.kt
  • God Classes · MethodTooLong: TunDnsManager.decideUpstreamAnswer app/src/main/java/com/celzero/bravedns/tunnel/TunDnsManager.kt
  • God Classes · FileTooLong: activity/CustomerSupportActivity.kt app/src/main/java/com/celzero/bravedns/ui/activity/CustomerSupportActivity.kt
  • God Classes · MethodTooLong: RpnPlusDashboardScreenKt.RpnPlusDashboardScreen app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnPlusDashboardScreen.kt
  • God Classes · MethodTooLong: RpnSupportScreenKt.RpnSupportScreen app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnSupportScreen.kt
  • God Classes · MethodTooLong: SubscriptionStateMachineV2.expireStaleSubsFromDb app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt
  • God Classes · MethodTooLong: GoVpnAdapter.pauseAndResumeProxies app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt
  • God Classes · TooManyMethods: WgInterfaceViewHolder app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt
  • God Classes · TooManyMethods: ConnectionTrackerRepository app/src/main/java/com/celzero/bravedns/database/ConnectionTrackerRepository.kt
  • God Classes · TooManyMethods: RethinkPlusDashboardFragment app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt
  • God Classes · MethodTooLong: BubbleHelper.showBubble app/src/main/java/com/celzero/bravedns/util/BubbleHelper.kt
  • Code Duplication · Near-duplicate member family (6 members, 23 shared lines) app/src/play/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt
  • Code Duplication · Near-duplicate member family (4 members, 38 shared lines) app/src/tv/java/com/celzero/bravedns/tv/ui/apps/AppsScreen.kt
  • Code Duplication · Near-duplicate member family (3 members, 28 shared lines) app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt
  • Code Duplication · Members sharing a duplicated core (24 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/ui/activity/AdvancedSettingActivity.kt
  • Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/viewmodel/AppConnectionsViewModel.kt
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/play/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt
  • Code Duplication · Duplicated block (212 lines × 2) app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt
  • Code Duplication · Duplicated block (126 lines × 2) REDACTED
  • Code Duplication · Duplicated block (95 lines × 2) app/src/play/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt
  • Code Duplication · Duplicated block (92 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Code Duplication · Duplicated block (91 lines × 2) REDACTED
  • Code Duplication · Duplicated block (81 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Code Duplication · Duplicated block (75 lines × 2) REDACTED
  • Code Duplication · Duplicated block (68 lines × 2) REDACTED
  • Code Duplication · Duplicated block (60 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Code Duplication · Duplicated block (48 lines × 2) app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt

Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.

Fixed since the last survey: 180 findings

These 180 critical or serious findings were in the previous survey, on 10 October 2026, and are gone from this one. The first 100 are listed here.

  • Cyclomatic Complexity · InAppBillingHandler.handlePurchase (cyclomatic 48) REDACTED
  • Cyclomatic Complexity · InAppBillingHandler.handlePurchase (cyclomatic 48) app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt
  • Cyclomatic Complexity · RpnConfigDetailActivity.setupSsidSectionUI (cyclomatic 23) app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt
  • Cyclomatic Complexity · TunDnsManager.handleOnUpstreamAnswer (cyclomatic 20) app/src/main/java/com/celzero/bravedns/tunnel/TunDnsManager.kt
  • Cyclomatic Complexity · SubscriptionStateMachineV2.handleSystemCheckAndDatabaseRestoration (cyclomatic 16) app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt
  • Cyclomatic Complexity · WgConfigDetailActivity.setupSsidSection (cyclomatic 16) app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt
  • Cognitive Complexity · InAppBillingHandler.handlePurchase (cognitive 117) REDACTED
  • Cognitive Complexity · InAppBillingHandler.handlePurchase (cognitive 117) app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt
  • Cognitive Complexity · TunDnsManager.handleOnUpstreamAnswer (cognitive 23) app/src/main/java/com/celzero/bravedns/tunnel/TunDnsManager.kt
  • Cognitive Complexity · WgConfigDetailActivity.setupSsidSection (cognitive 23) app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt
  • God Classes · MethodTooLong: InAppBillingHandler.handlePurchase REDACTED
  • God Classes · MethodTooLong: InAppBillingHandler.handlePurchase app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt
  • God Classes · MethodTooLong: TunDnsManager.handleOnUpstreamAnswer app/src/main/java/com/celzero/bravedns/tunnel/TunDnsManager.kt
  • Code Duplication · Near-duplicate member family (6 members, 31 shared lines) app/src/play/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt
  • Code Duplication · Near-duplicate member family (3 members, 38 shared lines) app/src/tv/java/com/celzero/bravedns/tv/ui/apps/AppsScreen.kt
  • Code Duplication · Near-duplicate member pair (48 shared lines) app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt
  • Code Duplication · Members sharing a duplicated core (30 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/ui/activity/AdvancedSettingActivity.kt
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/viewmodel/AppConnectionsViewModel.kt
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/play/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt
  • Code Duplication · Duplicated block (92 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Code Duplication · Duplicated block (92 lines × 2) REDACTED
  • Code Duplication · Duplicated block (91 lines × 2) app/src/play/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt
  • Code Duplication · Duplicated block (84 lines × 2) REDACTED
  • Code Duplication · Duplicated block (79 lines × 2) app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt
  • Code Duplication · Duplicated block (68 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Code Duplication · Duplicated block (63 lines × 2) REDACTED
  • Code Duplication · Duplicated block (61 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Code Duplication · Duplicated block (61 lines × 2) REDACTED
  • Code Duplication · Duplicated block (57 lines × 2) REDACTED
  • Code Duplication · Duplicated block (50 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Code Duplication · Duplicated block (38 lines × 2) app/src/play/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt
  • Code Duplication · Duplicated block (37 lines × 2) REDACTED
  • Code Duplication · Duplicated block (37 lines × 2) app/src/play/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt
  • Code Duplication · Duplicated block (37 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt
  • Code Duplication · Duplicated block (36 lines × 2) REDACTED
  • Code Duplication · Duplicated block (35 lines × 2) REDACTED
  • Code Duplication · Duplicated block (33 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Code Duplication · Duplicated block (33 lines × 2) REDACTED
  • Code Duplication · Duplicated block (33 lines × 2) REDACTED
  • Code Duplication · Duplicated block (31 lines × 2) app/src/play/java/com/celzero/bravedns/iab/PurchaseConflictNotifier.kt
  • Code Duplication · Duplicated block (29 lines × 2) app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt
  • Code Duplication · Duplicated block (27 lines × 2) app/src/play/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt
  • Code Duplication · Duplicated block (27 lines × 2) REDACTED
  • Code Duplication · Duplicated block (26 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Code Duplication · Duplicated block (25 lines × 2) app/src/play/java/com/celzero/bravedns/iab/DeviceNotRegisteredNotifier.kt
  • Code Duplication · Duplicated block (25 lines × 2) app/src/play/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt
  • Code Duplication · Duplicated block (24 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Code Duplication · Duplicated block (24 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Code Duplication · Duplicated block (22 lines × 2) REDACTED
  • Code Duplication · Duplicated block (21 lines × 6) app/src/play/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt
  • Code Duplication · Duplicated block (21 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Code Duplication · Duplicated block (21 lines × 2) app/src/play/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt
  • Code Duplication · Duplicated block (20 lines × 2) REDACTED
  • Code Duplication · Duplicated block (19 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Code Duplication · Duplicated block (19 lines × 2) app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt
  • Code Duplication · Duplicated block (17–18 lines × 3) app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt
  • Code Duplication · Duplicated block (18 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Code Duplication · Duplicated block (17 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Code Duplication · Duplicated block (16 lines × 2) REDACTED
  • Code Duplication · Duplicated block (15 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Code Duplication · Duplicated block (14 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Code Duplication · Duplicated block (14 lines × 2) REDACTED
  • Code Duplication · Duplicated block (12 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/CheckoutActivity.kt
  • Code Duplication · Duplicated block (12 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt
  • Code Duplication · Duplicated block (12 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Code Duplication · Duplicated block (11 lines × 8) app/src/tv/java/com/celzero/bravedns/tv/ui/dns/DnsScreen.kt
  • Code Duplication · Duplicated block (11 lines × 4) app/src/main/java/com/celzero/bravedns/ui/activity/DnsDetailActivity.kt
  • Code Duplication · Duplicated block (11 lines × 3) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt
  • Code Duplication · Duplicated block (11 lines × 3) app/src/main/java/com/celzero/bravedns/ui/activity/AdvancedSettingActivity.kt
  • Code Duplication · Duplicated block (11 lines × 3) app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt
  • Code Duplication · Duplicated block (9–11 lines × 2) app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt
  • Code Duplication · Duplicated block (11 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/CustomRulesActivity.kt
  • Code Duplication · Duplicated block (11 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt
  • Code Duplication · Duplicated block (10 lines × 6) app/src/main/java/com/celzero/bravedns/ui/activity/CheckoutActivity.kt
  • Code Duplication · Duplicated block (10 lines × 4) app/src/main/java/com/celzero/bravedns/adapter/CustomIpAdapter.kt
  • Code Duplication · Duplicated block (10 lines × 2) app/src/main/java/com/celzero/bravedns/glide/FavIconDownloader.kt
  • Code Duplication · Duplicated block (10 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt
  • Code Duplication · Duplicated block (4–10 lines × 3) app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt
  • Code Duplication · Duplicated block (8–9 lines × 15) app/src/tv/java/com/celzero/bravedns/tv/ui/apps/AppsScreen.kt
  • Code Duplication · Duplicated block (9 lines × 3) app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt
  • Code Duplication · Duplicated block (9 lines × 2) REDACTED
  • Code Duplication · Duplicated block (6–8 lines × 9) app/src/main/java/com/celzero/bravedns/ui/activity/AppLockActivity.kt
  • Code Duplication · Duplicated block (8 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Code Duplication · Duplicated block (7 lines × 30) app/src/main/java/com/celzero/bravedns/ui/activity/AdvancedSettingActivity.kt
  • Code Duplication · Duplicated block (7 lines × 2) app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt
  • Code Duplication · Duplicated block (7 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt
  • Code Duplication · Duplicated block (15 lines × 4) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt
  • Code Duplication · Duplicated block (11 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt
  • Code Duplication · Duplicated block (10 lines × 3) app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt
  • Code Duplication · Duplicated block (6 lines × 2) app/src/main/java/com/celzero/bravedns/database/AppInfo.kt
Rebuild cost: about €220,000 · Estimate
Cost to rebuild€74,000 to €370,000, for 1,240 to 3,935 hours of work, about 1.5 person-years for 1 to 3 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 50. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeLarge: 179,854 lines of product code

How the estimate is made: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

Top priorities

The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.

1
Resolve the 1 No ADRs found finding(s) in ADR Quality.
Raises the score by about 4 points · Low effort · ADR Quality
2
Resolve the 2 Off-boarding risk finding(s) in Bus Factor.
Raises the score by about 4 points · Low effort · Bus Factor
3
Make entity setters private/init-only and hand collections out as IReadOnlyList/IReadOnlyCollection over a private backing field; change state only through methods that enforce the invariants (Marten/EF can bind via constructor or private setters).
Raises the score by about 5 points · Medium effort · Encapsulated state

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

Where the investment is most exposed · Value at risk
This code would cost about €220,000 to build again, about 1.5 person-years of work. Its weakest lens is Domain Modelling, at 42 (Weak). Domain Modelling is about whether the code protects the rules the business depends on. Because the weakest lens counts most in the score, work on Domain Modelling also moves the score most.
Based on: the rebuild estimate · the Domain Modelling grade · how much each lens counts
What to do: Start with the Domain Modelling actions in Top priorities.
One cause behind 80 Domain Modelling findings · Common cause
80 findings in the Domain Modelling lens come from the same cause. The code models the business as objects, such as an order or a customer, and each object should guard its own rules: an order, for example, should refuse to be shipped before it has been paid. Here the objects don't do that. Other code can change an object's data directly, so it can put an order into a state the rules forbid. Some objects only hold data, while the rules that should keep that data valid sit elsewhere in the code. Identifiers, such as order numbers and customer numbers, are passed around as plain numbers or text, so nothing stops the code from using one kind where another belongs. Because all of these findings have the same cause, fixing it once, in the business objects themselves, deals with them together.
Based on: Encapsulated state (30 findings) · Rich vs anemic model (31 findings) · Strongly-typed ids (19 findings)
What to do: Give each business object the methods that enforce its rules, such as a method for shipping an order that first checks it has been paid, and let only those methods change its data. Give each kind of identifier a type of its own, so an order number can't be used where a customer number belongs.
If you do one thing first · First action
Resolve the 1 No ADRs found finding(s) in ADR Quality. Of all the actions in this report, it raises the score most for the work it takes: about 4 points for low effort, because it clears the 1 ADR Quality findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 7.4 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 2% to 5% on every change. The history of the code shows how much it changes: about 253,010 lines over the last 90 days, which is about 1,026,096 lines a year. At that pace, the extra work comes to an estimated 51.3 to 342 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

577 modules, with 736 dependencies between them. 3 loops run through 102 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 537 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 data.AppConfig2 download.AppDownloadManager3 rpnproxy.RpnProxyManager4 service.AppUpdater5 service.ConnectionMonitor6 service.DomainRulesManager7 service.IpRulesManager8 service.ProxyManager9 service.RethinkBlocklistManager10 ui.activity.AppListActivity11 ui.activity.CustomRulesActivity12 iab.ServerApiError13 rpnproxy.SubscriptionStateMachineV214 service.BraveVPNService15 service.FirewallManager16 tunnel.TunDnsManager17 ui.fragment.SummaryStatisticsFragment18 util19 wireguard20 net.go21 receiver22 rpnproxy23 service.ConnectionSimulator24 ui.custom25 iab26 service.TunFlowManager27 scheduler28 service29 data30 database31 adapter.GenericHopAdapter32 customdownloader33 ui.adapter.CountryServerAdapter34 viewmodel35 ui.adapter36 ui.fragment37 adapter38 ui.activity39 ui.bottomsheet40 ui.dialog
1 data.AppConfig
2 download.AppDownloadManager
3 rpnproxy.RpnProxyManager
4 service.AppUpdater
5 service.ConnectionMonitor
6 service.DomainRulesManager
7 service.IpRulesManager
8 service.ProxyManager
9 service.RethinkBlocklistManager
10 ui.activity.AppListActivity
11 ui.activity.CustomRulesActivity
12 iab.ServerApiError6
13 rpnproxy.SubscriptionStateMachineV2211
14 service.BraveVPNService1
15 service.FirewallManager1
16 tunnel.TunDnsManager111
17 ui.fragment.SummaryStatisticsFragment1
18 util21614
19 wireguard2
20 net.go2411113
21 receiver11
22 rpnproxy981311
23 service.ConnectionSimulator11
24 ui.custom1
25 iab41331
26 service.TunFlowManager11
27 scheduler1112
28 service28210243556133112311047
29 data91224
30 database1219
31 adapter.GenericHopAdapter111
32 customdownloader1
33 ui.adapter.CountryServerAdapter2
34 viewmodel14111421461
35 ui.adapter23
36 ui.fragment21322264114346222216
37 adapter2121731714414
38 ui.activity2142215115131714
39 ui.bottomsheet1243312134224522
40 ui.dialog122214
Uses a module listed above itPart of a loopThe module itself
1 data.AppConfig2 download.AppDownloadManager3 rpnproxy.RpnProxyManager4 service.AppUpdater5 service.ConnectionMonitor6 service.DomainRulesManager7 service.IpRulesManager8 service.ProxyManager9 service.RethinkBlocklistManager10 ui.activity.AppListActivity11 ui.activity.CustomRulesActivity12 iab.ServerApiError13 rpnproxy.SubscriptionStateMachineV214 service.BraveVPNService15 service.FirewallManager16 tunnel.TunDnsManager17 ui.fragment.SummaryStatisticsFragment18 util19 wireguard20 net.go21 receiver22 rpnproxy23 service.ConnectionSimulator24 ui.custom25 iab26 service.TunFlowManager27 scheduler28 service29 data30 database31 adapter.GenericHopAdapter32 customdownloader33 ui.adapter.CountryServerAdapter34 viewmodel35 ui.adapter36 ui.fragment37 adapter38 ui.activity39 ui.bottomsheet40 ui.dialogdata.AppConfig1download.AppDownloadManager2rpnproxy.RpnProxyManager3service.AppUpdater4service.ConnectionMonitor5service.DomainRulesManager6service.IpRulesManager7service.ProxyManager8service.RethinkBlocklistManager9ui.activity.AppListActivity10ui.activity.CustomRulesActivity11iab.ServerApiError12rpnproxy.SubscriptionStateMachineV213service.BraveVPNService14service.FirewallManager15tunnel.TunDnsManager16ui.fragment.SummaryStatisticsFragment17util18wireguard19net.go20receiver21rpnproxy22service.ConnectionSimulator23ui.custom24iab25service.TunFlowManager26scheduler27service28data29database30adapter.GenericHopAdapter31customdownloader32ui.adapter.CountryServerAdapter33viewmodel34ui.adapter35ui.fragment36adapter37ui.activity38ui.bottomsheet39ui.dialog406211111111216142241111311981311111413311111122821024355613311231104791224121911112141114214612321322264114346222216212173171441421422151151317141243312134224522122214+537 more modules (most-connected shown)

At a glance — Code Health · 80% · Strong ·

At a glance — Architecture · 89% · Adequate · gated by D26 ·

At a glance — Maturity · 47% · Adequate · gated by D16, M2 ·

At a glance — Readiness · 57% · Adequate · gated by P7 ·

At a glance — Security · 58% · Adequate · gated by C1 ·

At a glance — Domain Modelling · 42% · Weak · gated by DM2, DM4, DM5 ·

At a glance — Performance · 81% · Strong ·

Security & Compliance — OWASP Top-10 mapping

Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).

OWASP categoryFindingsSeverity
A05:2025 — Injection33High / Critical
A03:2025 — Software Supply Chain Failures7Medium
A07:2025 — Authentication Failures5High / Critical

Roadmap

First, encapsulate entity state by restricting setters and exposing collections as read-only to enforce invariants, and complete the migration to strongly-typed IDs to prevent argument errors. Next, address the off-boarding risks identified in the bus factor analysis to reduce single points of failure. Finally, resolve the missing architecture decision records by documenting key design choices in a dedicated folder to ensure long-term maintainability.

Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.

Do thisHelpsEffortDimension
Resolve the 1 No ADRs found finding(s) in ADR Quality.+4.3 ptsLowADR Quality
Resolve the 2 Off-boarding risk finding(s) in Bus Factor.+3.6 ptsLowBus Factor
Make entity setters private/init-only and hand collections out as IReadOnlyList/IReadOnlyCollection over a private backing field; change state only through methods that enforce the invariants (Marten/EF can bind via constructor or private setters).+4.7 ptsMediumEncapsulated state
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.+4.1 ptsMediumArchitecture documentation
Adopt strongly-typed ids across the domain — finish the migration or document the boundary; primitive ids invite transposed-argument bugs.+3.4 ptsMediumStrongly-typed ids
Move business rules onto the aggregates/entities they govern so invariants are enforced at the source, not in anemic services.+3.3 ptsMediumRich vs anemic model
Give each aggregate one way in that can refuse — a guarded constructor, value-object parameters that validate themselves, or a private constructor behind a factory that returns a failure.+2.9 ptsMediumConstructible invalid state
Improve Documentation Quality — currently 7.0/10.+2.5 ptsMediumDocumentation Quality

File quality

Per-file score 0–10 — a quality signature. Of 230 files carrying findings, judged against the Preview bar: 2% slop · 24% mixed · 74% near-clean.

FileScoreBandWorst signal
REDACTED1.1SlopSecrets (history): REDACTED: REDACTED
REDACTED2.1SlopSecrets (history): REDACTED: REDACTED
REDACTED2.5SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.0MixedStatic Analysis (SAST): High: REDACTED
REDACTED3.7MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.2MixedSecrets (history): REDACTED: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
app/src/play/java/com/celzero/bravedns/iab/QueryUtils.kt5.5MixedCode Duplication: Duplicated block (14 lines × 2)
app/src/main/java/com/celzero/bravedns/ui/fragment/ConnectionTrackerFragment.kt5.6MixedCognitive Complexity: ConnectionTrackerFragment.setupConnectionTrackerRecyclerView (cognitive 17)
app/src/main/java/com/celzero/bravedns/adapter/CustomIpAdapter.kt5.6MixedGod Classes: ClassTooLong: CustomIpAdapter
app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt6.0MixedExplicit Debt: TodoComment
app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt6.0MixedExplicit Debt: TodoComment
app/src/main/java/com/celzero/bravedns/service/TunFirewallManager.kt6.0MixedExplicit Debt: TodoComment
app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt6.0MixedExplicit Debt: FixmeComment
app/src/main/java/com/celzero/bravedns/service/TunFlowManager.kt6.0MixedExplicit Debt: TodoComment
app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt6.0MixedExplicit Debt: TodoComment

How the grades work

Every finding carries one of four grades. Three say how serious it is. The fourth says this survey could not settle it — and it is a grade, not a gap.

Critical — 34

A definite problem that already costs you something and drags the score down: a missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here tends to cause failures elsewhere.

Serious — 1402

Likely wrong, but not failing yet. It degrades the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to carry for two years either.

Minor — 74

Recorded, with no effect on how the codebase functions. Present so the survey is complete, not because it needs doing.

Could not be resolved — 16

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 67 of 70 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 3 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.8 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.

What we checked — 70 dimensions across the health lenses
D1D2D3D4D5D6D13D15D16D17D19D20D21D26D28D29D34D35D36D44AX10AX3AX4AX6AX8C1C4DM10DM11DM12DM2DM4DM5DM6DM8DM9M1M2M3M4P1P3P4P6P7PF1PF2PF3X1X12X13X14X15X16X17X18X19X20X21X22X23X24X25X26X27X28X29X3X30X5

Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.

How to trust any code-health report — three questions
  1. Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 1497 of 1510 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

This report answers yes to all three. That's the bar to hold any assessment to.

Tools & methods

The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Watchdog duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivySecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ deterministic
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurementLocal LLM◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 01a16f99-5e4e-7e10-9922-4a847edf620f.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.

  • D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: test source is present (.kt) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo. To have real coverage read, produce a coverage report in a standard format (JaCoCo XML — the Gradle `jacocoTestReport` task) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (JaCoCo XML — the Gradle `jacocoTestReport` task) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
  • D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.kt) and this repository declares a JVM test suite (repository root, Gradle), but it was not re-run: no test result was produced. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
  • D12 Dependency Hygiene — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — 4 Maven/Gradle manifest(s) were read, stating a version for 84 dependency(ies) and leaving 9 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
  • D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is an ADMISSION gap, not an environment fault: no published-package marker D22 reads admitted any project here. D22 DOES collect the public API of every language in this tree, and admits a project only when its manifest makes that ecosystem's publication act in a form the marker recognises — so what is missing is not a collector but an admission rule for the publication act this repository makes, if it makes one. The remedy is a better discriminator for that marker — not a collector, and no change to the scan image can close it. The marker's rules are measured to refuse applications, so one refused repository is the rule working as calibrated; several are the evidence that it is too strict.
  • D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `app/src/main/java/com/celzero/bravedns/adapter/FirewallAppListAdapter.kt`, `app/src/main/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt`, `app/src/main/java/com/celzero/bravedns/adapter/WgIncludeAppsAdapter.kt`, `app/src/main/java/com/celzero/bravedns/service/LogActivityAggregator.kt`, `app/src/main/java/com/celzero/bravedns/ui/activity/ConsoleLogActivity.kt`, … (+19 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • AX1 Captive dependencies — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository's container is Koin, whose lifetimes are not modelled yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AXB1 Runtime evidence locked — no reproducible boot — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Subject: a native UI project (REDACTED). The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, a Dockerfile, an npm dev script, a web service's own toolchain entry point (cargo, go, dotnet, Python, Spring Boot), or an Android app's own Gradle wrapper (run on an emulator); an Apple or Flutter app needs a host it lacks. None applied, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. Watchdog then boots it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
  • C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • DM9 Scattered domain decisions — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Arm one resolves each comparison operand to the domain member it judges, and that binding exists only in a Roslyn compilation, which this run did not load. Arm two ran over the neutral model because this repository's frontend declares whether each construction is produced or passed. A rule decided in two places would not appear above.
  • DM9 Scattered domain decisions — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The frontend declares that it computes whether a construction is produced or passed, yet 1708 of 1711 constructions arrived without the answer. Arm two skipped them; it did not clear them.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby or Scala was found, and this repository's Java, Kotlin is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Kotlin is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • P1 CI/CD gates — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. A CI pipeline exists and the word "test" appears, but no explicit test-runner invocation (your stack's test command, or a test job) was matched — so either the gate runs tests through a step this pass could not recognise, or "test" is incidental here (a path, "latest", a reporter). Which of the two it is cannot be settled from this dimension's evidence; the coverage dimensions report whether a suite exists at all. You can widen what we reach: name the test runner explicitly in the pipeline step (your stack's test command, or a job named for the suite) so the gate is unambiguous to a reader and to this pass.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X2 Cancellation propagation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python and Rust source only, and no C# was loaded, and no named async function in this repository's JavaScript/TypeScript, nor any Go, PHP or Dart function or Kotlin suspend function, makes a request that can be cancelled (fetch, axios, ky, ofetch; net/http, net.Dial; amphp; Dio; Ktor, OkHttp), so there is nothing to judge, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X3 Exception handling — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 63 further occurrence(s) are not listed individually; the score already reflects all 103.

Repo exclusion declarations: 2 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.

Limitations & what we did not check

Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • C4 Data Retention: This control is scored from in-repo evidence only — its real-world effectiveness, exercised only at runtime, is outside a static scan.
  • DM4 Rich vs anemic model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
  • DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
  • M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

The LLM boundary

LLM-set scores this run (3): D19, D21, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.

Dimensions

D1 · Cyclomatic Complexity6.4 / 10Adequate✓ Tool-verified

What it measures: How tangled the control flow is — methods with many branches are hard to test and change.

Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.

Maturity: Documented → Verified → Prevented · effective 6.4 / 10 · rule-coverage 100% · ceiling Prevented

90 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was InAppBillingHandler.handlePurchaseInternal at 70. A further 10 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being Result.toString at 39 — they are counted neither in the figure above nor in this dimension's score. 6 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: app/src/play/java/com/celzero/bravedns/iab/Result.kt (Result.toString at 39), app/src/website/java/com/celzero/bravedns/iab/Result.kt (Result.toString at 39), app/src/main/java/com/celzero/bravedns/service/FirewallRuleset.kt (FirewallRuleset.getFirewallRule at 37), app/src/main/java/com/celzero/bravedns/database/AppInfo.kt (AppInfo.<init> at 20), REDACTED (WgInterface.parse at 20), and 1 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

InAppBillingHandler.handlePurchaseInternal (cyclomatic 70) · ×2REDACTED:926
RpnPurchaseRouteKt.RpnPurchaseRoute (cyclomatic 29) · ×2app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:72
SubscriptionCheckWorker.resolveEntitlementExpiry (cyclomatic 21) · ×2app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:303
InAppBillingHandler.validateSubsWithServerBeforeExpiry (cyclomatic 20) · ×2REDACTED:3802
BillingBackendClient.refreshIdentityLocked (cyclomatic 18) · ×2app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:685

+ 75 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 12 bodies over 30 down to 30 or less in Cyclomatic Complexity — start with InAppBillingHandler.handlePurchaseInternal (cyclomatic 70), InAppBillingHandler.handlePurchaseInternal (cyclomatic 70), BraveVPNService.onSharedPreferenceChanged (cyclomatic 61). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 12 together lifts Cyclomatic Complexity from 6.4 to about 7.3/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.
  2. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.

D2 · Cognitive Complexity5.3 / 10Adequate✓ Tool-verified

What it measures: How hard the code is for a person to follow, beyond raw branching.

Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.

Maturity: Documented → Verified → Prevented · effective 5.3 / 10 · rule-coverage 100% · ceiling Prevented

158 method(s) exceeded the cognitive complexity threshold of 15; the worst was InAppBillingHandler.handlePurchaseInternal at 203.

InAppBillingHandler.handlePurchaseInternal (cognitive 203) · ×2REDACTED:926
SubscriptionCheckWorker.resolveEntitlementExpiry (cognitive 35) · ×2app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:303
RpnPurchaseRouteKt.RpnPurchaseRoute (cognitive 28) · ×2app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:72
BillingBackendClient.executeAckWithRetry (cognitive 27) · ×2app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:889
InAppBillingHandler.purchaseSubs (cognitive 26) · ×2REDACTED:2618

+ 137 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 2 bodies over 120 down to 120 or less in Cognitive Complexity — start with InAppBillingHandler.handlePurchaseInternal (cognitive 203), InAppBillingHandler.handlePurchaseInternal (cognitive 203). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 2 together lifts Cognitive Complexity from 5.3 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
  2. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.

D3 · God Classes7.9 / 10Strong✓ Tool-verified

What it measures: Over-large classes that try to do too much ("god classes").

Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.

Maturity: Documented → Verified → Prevented · effective 7.9 / 10 · rule-coverage 100% · ceiling Prevented

178 god class(es) detected.

TooManyMethods: BraveVPNService · ×51app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:177
FileTooLong: service/BraveVPNService.kt · ×46app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt
MethodTooLong: InAppBillingHandler.handlePurchaseInternal · ×42REDACTED:926
ClassTooLong: BraveVPNService · ×39app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:177

What to do

  1. Resolve the 51 TooManyMethods finding(s) in God Classes — start with REDACTED (2), RethinkPlusFragment.kt (2), BillingBackendClient.kt (2). — One of this dimension's main actionable groups (51 warning-level).
  2. Resolve the 46 FileTooLong finding(s) in God Classes — start with REDACTED (2), BillingBackendClient.kt (2), RethinkPlusFragment.kt (2). — One of this dimension's main actionable groups (46 warning-level).
  3. Resolve the 42 MethodTooLong finding(s) in God Classes — start with REDACTED (4), SubscriptionStateMachineV2.kt (4), ProxySettingsActivity.kt (3). — One of this dimension's main actionable groups (42 warning-level).
  4. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.

D4 · Code Duplication8.3 / 10Strong✓ Tool-verified

What it measures: Copy-pasted code that should be shared instead.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.

Maturity: Documented → Verified → Prevented · effective 8.3 / 10 · rule-coverage 100% · ceiling Verified

611 duplicated block group(s) detected. A further 26 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.

Duplicated block (8 lines × 2) · ×38app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:162
Duplicated block (9 lines × 2) · ×35app/src/main/java/com/celzero/bravedns/adapter/CustomDomainAdapter.kt:204
Duplicated block (10 lines × 2) · ×34app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:183
Duplicated block (7 lines × 2) · ×33app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:537
Duplicated block (13 lines × 2) · ×27app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt:320

+ 171 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 38 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with RethinkPlusDashboardFragment.kt (5), REDACTED (4), AppDomainRulesBottomSheet.kt (3). — One of this dimension's main actionable groups (38 warning-level).
  2. Resolve the 35 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with REDACTED (3), SponsorBillingManagerImpl.kt (3), RethinkPlusFragment.kt (3). — One of this dimension's main actionable groups (35 warning-level).
  3. Resolve the 34 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with RethinkPlusFragment.kt (4), REDACTED (3), RpnConfigDetailActivity.kt (2). — One of this dimension's main actionable groups (34 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.

D5 · Coupling10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

2 production modules (Gradle), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; edges a convention plugin adds from buildSrc or build-logic are not visible there; 0 module(s) off the main sequence, with abstractness counted on 1 of the 2 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

✓ On the Gold path — maintain.

Detailed fixes: d5_recommendation.md.

D6 · Cohesion (LCOM4)9.5 / 10Stronggated by 13 serious findings✓ Tool-verified

What it measures: Whether a class's methods are focused on a single responsibility.

Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.

Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 9.5 / 10 · rule-coverage 100% · ceiling Verified

13 of 306 classes have LCOM4 above 3.

Low cohesion: InAppBillingHandlerTest (LCOM4 17) · ×13app/src/testPlay/java/com/celzero/bravedns/iab/InAppBillingHandlerTest.kt:77

What to do

  1. Resolve the 13 Low cohesion finding(s) in Cohesion (LCOM4) — start with InAppBillingHandlerTest.kt (2), QueryUtils.kt (2), REDACTED. — One of this dimension's main actionable groups (13 warning-level).
  2. Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.

D13 · REDACTED Scanning10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.

Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

REDACTED scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D15 · Churn × Complexity Hotspots9.6 / 10Stronggated by 44 serious findings✓ Tool-verified

What it measures: Files that change often and are also complex — the riskiest hotspots.

Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.

Maturity: Documented → Verified → Prevented · effective 9.6 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt (32×61=1952); app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt (26×41=1066); app/src/main/java/com/celzero/bravedns/ui/fragment/HomeScreenFragment.kt (31×31=961) Repeated repair below the complexity floor: app/src/main/java/com/celzero/bravedns/util/Utilities.kt (7 of 11 changes were fixes); app/src/main/java/com/celzero/bravedns/scheduler/EnhancedBugReport.kt (5 of 5 changes were fixes); app/src/main/java/com/celzero/bravedns/service/IpRulesManager.kt (4 of 7 changes were fixes)

Hotspot: app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt · ×26app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:1543
Repeated repair: app/src/main/java/com/celzero/bravedns/util/Utilities.kt · ×18app/src/main/java/com/celzero/bravedns/util/Utilities.kt:355

What to do

  1. Resolve the 26 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (2), BillingBackendClient.kt (2), BraveVPNService.kt. — One of this dimension's main actionable groups (26 warning-level).
  2. Resolve the 18 Repeated repair finding(s) in Churn × Complexity Hotspots — start with Utilities.kt, EnhancedBugReport.kt, IpRulesManager.kt. — One of this dimension's main actionable groups (18 warning-level).

Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.

D16 · Bus Factor2.9 / 10Weak✓ Tool-verified

What it measures: Whether knowledge is concentrated in too few people (the "bus factor").

Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.

Maturity: Documented → Verified → Prevented · effective 2.9 / 10 · rule-coverage 100% · ceiling Documented

350 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt. Counted over 491 of the 674 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Off-boarding risk: anonymized user #1 · ×2

What to do

  1. Resolve the 2 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (2 recommendation-level).

Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.

D17 · Explicit Debt9.9 / 10Stronggated by 136 serious findings✓ Tool-verified

What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.

Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Prevented

136 deducted task-comment markers across 179854 LoC (0.1/KLoC) → score 9.9. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

TodoComment · ×106app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:389
FixmeComment · ×30app/src/main/java/com/celzero/bravedns/NonStoreAppUpdater.kt:87

What to do

  1. Resolve the 106 TodoComment finding(s) in Explicit Debt — start with BraveVPNService.kt (18), ConnectionMonitor.kt (10), GoVpnAdapter.kt (8). — One of this dimension's main actionable groups (106 warning-level).
  2. Resolve the 30 FixmeComment finding(s) in Explicit Debt — start with BraveVPNService.kt (4), TunFlowManager.kt (3), HomeScreenActivity.kt (3). — One of this dimension's main actionable groups (30 warning-level).
  3. Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.

D19 · Documentation QualityStrong◐ Sampled · advisory

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.

Maturity: Documented → Verified → Prevented · effective Strong / 10 · rule-coverage 100% · ceiling Documented

The repository's single README is a well-written overview of the project: it names the three modes (VPN, DNS, Firewall), describes WireGuard and OpenSnitch/oblivious DoH/DNSCrypt backends, links to F-Droid, Google Play, Obtainium, and GitHub actions for release digests. It also begins with an 'In other words' tag that states what the project is doing before diving into architecture; it ends in a clipped outline (Rethink DNS + Firewall + VPN for Android; ...Tenets ...) which all exist, so no section from the outline is flagged as missing. The document is clear and complete given its single file.

What to do

  1. Improve Documentation Quality — currently 7.0/10. — The repository's single README is a well-written overview of the project: it names the three modes (VPN, DNS, Firewall), describes WireGuard and OpenSnitch/oblivious DoH/DNSCrypt backends, links to F-Droid, Google Play, Obtainium, and GitHub actions for release digests. It also begins with an 'In other words' tag that states what the project is doing before diving into architecture; it ends in a clipped outline (Rethink DNS + Firewall + VPN for Android; ...Tenets ...) which all exist, so no section from the outline is flagged as missing. The document is clear and complete given its single file.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality0.0 / 10Critical✓ Tool-verified

What it measures: Whether architecture decisions are recorded well (context, decision, consequences).

Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

No architecture decision records were found.

No ADRs found

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.

D21 · Naming ConsistencyExemplary◐ Sampled · advisory

What it measures: Whether names — types, methods, variables — are clear and consistent.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.

Maturity: Documented → Verified → Prevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Verified

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D26 · Project Cohesion0.0 / 10Critical✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic, LLM-independent.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

1 of 1 build units (Gradle) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

  1. Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.

D28 · Secrets (history)6.0 / 10Adequate✓ Tool-verified

What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.

Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.

Maturity: Documented → Verified → Prevented · effective 6.0 / 10 · rule-coverage 100% · ceiling Documented

4 finding(s): 0 critical, 4 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.

REDACTED
REDACTED

What to do

  1. Resolve the 4 REDACTED finding(s) in Secrets (history) — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (4 issue-level).
  2. Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.

D29 · Static Analysis (SAST)5.1 / 10Adequate✓ Tool-verified

What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.

Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.

Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).

Maturity: Documented → Verified → Prevented · effective 5.1 / 10 · rule-coverage 100% · ceiling Documented

33 finding(s): 0 critical, 30 high, 3 medium, 0 low. 27 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 21 file(s) — `app/src/main/java/com/celzero/bravedns/ui/activity/ConsoleLogActivity.kt` (line 239), `app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt` (line 868), `app/src/main/java/com/celzero/bravedns/util/UIUtils.kt` (lines 188–189), `app/src/main/res/values-ab/strings.xml`, `app/src/main/res/values-ar/strings.xml`, … (+16 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 2 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
  2. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. No action in Static Analysis (SAST) — all 27 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (27 issue-level, 0 of them charged here).

Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.

D34 · Knowledge Freshness10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

Every significant source file has living knowledge — recently and meaningfully worked. Counted over 491 of the 674 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

D35 · Change Coupling9.8 / 10Stronggated by 7 serious findings✓ Tool-verified

What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.

Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

Maturity: Documented → Verified → Prevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: ConnectionTrackerDAO.kt↔DnsLogRepository.kt 80%; ConnectionTrackerRepository.kt↔DnsLogRepository.kt 80%; RethinkLocalFileTagDao.kt↔RethinkRemoteFileTagDao.kt 73%

Change coupling: ConnectionTrackerRepository.kt ↔ DnsLogRepository.kt · ×6app/src/main/java/com/celzero/bravedns/database/ConnectionTrackerRepository.kt:1
Change-coupling hub: ConnectionTrackerDAO.kt → DnsLogDAO.kt, DnsLogRepository.kt, RethinkLogDao.ktapp/src/main/java/com/celzero/bravedns/database/ConnectionTrackerDAO.kt

What to do

  1. Resolve the 6 Change coupling finding(s) in Change Coupling — start with ConnectionTrackerRepository.kt, RethinkLocalFileTagDao.kt, ConnectionTrackerFragment.kt. — One of this dimension's main actionable groups (6 warning-level).
  2. Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with ConnectionTrackerDAO.kt. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.

D36 · Supply-chain Provenance & Signing5.0 / 10Adequate✓ Tool-verified

What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.

Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.

Maturity: Documented → Verified → Prevented · effective 5.0 / 10 · rule-coverage 100% · ceiling Documented

2/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

+ 1 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 84 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

R = React/JS · M = Maturity · P = Readiness.

AX10 · Code composition9.0 / 10Exemplary✓ Tool-verified

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

What to do

  • The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).

Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

AX6 · Interface segregation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').

Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.

AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.

Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.

C1 · Data Protection3.5 / 10Weak✓ Tool-verified

Other · Security — Whether sensitive data is encrypted at rest and in transit and keys are vaulted.

Method: Roslyn plus filesystem scan: encryption presence (EF ColumnEncryption, key-vault references, HTTPS enforcement) and key-derivation KDF detection. Deterministic.

What to do

  • Strengthen data-at-rest protection: vault your keys (AWS KMS / Secrets Manager, GCP KMS / REDACTED Manager, Azure Key Vault, HashiCorp Vault — not a key compiled into the app) and encrypt the store that holds the personal data (SQLCipher, a Realm encryptionKey, field-level AEAD) — partial coverage still leaves gaps.
  • Enforce HTTPS on the server that receives this data: terminate TLS in it (Ktor's sslConnector, Spring's server.ssl and requiresSecure, Netty's SslContextBuilder.forServer) and send Strict-Transport-Security (Ktor's HttpsRedirect), or run it behind a TLS-terminating proxy, so data in transit is always encrypted.
C4 · Data Retention9.0 / 10Exemplary✓ Tool-verified

Other · Security — Whether data has a defined lifetime — retention periods, TTLs, cleanup jobs (storage limitation).

Method: Roslyn scan: retention/TTL configuration presence in schema; CascadeDelete detected but not scored as retention control. Deterministic, gated by PII presence.

  • A retention mechanism is present, but the data-lifecycle is not yet complete — missing: a documented retention period / data-expiry.

What to do

  • Complete the data-lifecycle story: an expiry limit (a declared maximum age for the stored data — a retention-age setting, or a store-level TTL where your storage offers one), a scheduled purge/cleanup job that enforces it, and a documented retention period covering the personal data.
DM10 · One transaction, one aggregate10.0 / 10Exemplary○ Nothing flagged

Other · Domain Modelling — Whether a single operation mutates more than one aggregate root. An aggregate is a consistency boundary, so saving two together fuses them into one — the second's invariants come to depend on the first's transaction, and the pair can no longer be separated. Reads of other aggregates are not counted.

Method: Neutral body surface (DDD-gated): every method body scanned for repository WRITE calls (Add/Update/Save/Remove/Delete/Insert/Store and their async forms), keyed on the ARGUMENT type rather than the repository type — three `IRepository<T>` writes collapse to one repository but are three distinct aggregates. Reads (Get/Find/Load/Query) are excluded, so loading another aggregate for context never counts. Score is offending methods over methods that write at all. Deterministic.

DM11 · Constructible invalid state4.3 / 10Weak✓ Tool-verified

Other · Domain Modelling — Whether an aggregate can be constructed in a state its own rules forbid — a public constructor that takes a raw primitive, stores it, and validates nothing, with no factory beside it. A constructor taking only value objects is not counted: each parameter has already validated itself.

Method: Neutral surface (DDD-gated): each non-abstract entity/aggregate checked for a PUBLIC constructor taking at least one RAW PRIMITIVE parameter whose body contains no guard token (throw / Guard. / Ensure. / ArgumentException / CheckRule), on a type that also offers no static Create/Of/From/New factory. A constructor taking only value objects is never charged -- measured: 64 of 87 unguarded public constructors on the C# corpus take value objects only, so ignoring parameter types would be 73% false positives. One finding per entity. Deterministic.

  • `AlertRegistry`'s public constructor takes `alertTitle`, `alertType`, `alertMessage`, `alertCategory`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `AlertRegistry` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/celzero/bravedns/database/AlertRegistry.kt:49
  • `AppInfo`'s public constructor takes `packageName`, `appName`, `appCategory`, `notes` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `AppInfo` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/celzero/bravedns/database/AppInfo.kt:95
  • `ConsoleLog`'s public constructor takes `message` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `ConsoleLog` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/celzero/bravedns/database/ConsoleLog.kt:22
  • `CountryConfig`'s public constructor takes `id`, `cc`, `name`, `address`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `CountryConfig` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/celzero/bravedns/database/CountryConfig.kt:34
  • `CustomDomain`'s public constructor takes `domain`, `ips`, `proxyId`, `proxyCC` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `CustomDomain` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/celzero/bravedns/database/CustomDomain.kt:73
  • `DnsCryptEndpoint`'s public constructor takes `dnsCryptName`, `dnsCryptURL`, `dnsCryptExplanation` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `DnsCryptEndpoint` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/celzero/bravedns/database/DnsCryptEndpoint.kt:43
  • `DnsCryptRelayEndpoint`'s public constructor takes `dnsCryptRelayName`, `dnsCryptRelayURL`, `dnsCryptRelayExplanation` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `DnsCryptRelayEndpoint` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/celzero/bravedns/database/DnsCryptRelayEndpoint.kt:43
  • `DnsProxyEndpoint`'s public constructor takes `proxyName`, `proxyType`, `proxyAppName`, `proxyIP` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `DnsProxyEndpoint` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/celzero/bravedns/database/DnsProxyEndpoint.kt:47
  • `DoHEndpoint`'s public constructor takes `dohName`, `dohURL`, `dohIp`, `dohExplanation` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `DoHEndpoint` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/celzero/bravedns/database/DoHEndpoint.kt:50
  • `DoTEndpoint`'s public constructor takes `name`, `url`, `desc` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `DoTEndpoint` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/celzero/bravedns/database/DoTEndpoint.kt:48
  • `Event`'s public constructor takes `message`, `details` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `Event` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/celzero/bravedns/database/Event.kt:41
  • `LocalBlocklistPacksMap`'s public constructor takes `pack`, `group` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `LocalBlocklistPacksMap` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/celzero/bravedns/database/LocalBlocklistPacksMap.kt:40
  • `ODoHEndpoint`'s public constructor takes `name`, `proxy`, `resolver`, `proxyIps`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `ODoHEndpoint` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/celzero/bravedns/database/ODoHEndpoint.kt:50
  • `ProxyApplicationMapping`'s public constructor takes `packageName`, `appName`, `proxyName`, `proxyId` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `ProxyApplicationMapping` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/celzero/bravedns/database/ProxyApplicationMapping.kt:46
  • `ProxyEndpoint`'s public constructor takes `proxyName`, `proxyType`, `proxyAppName`, `proxyIP`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `ProxyEndpoint` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/celzero/bravedns/database/ProxyEndpoint.kt:54
  • `RemoteBlocklistPacksMap`'s public constructor takes `pack`, `group` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `RemoteBlocklistPacksMap` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/celzero/bravedns/database/RemoteBlocklistPacksMap.kt:40
  • `RethinkDnsEndpoint`'s public constructor takes `name`, `url`, `desc` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `RethinkDnsEndpoint` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/celzero/bravedns/database/RethinkDnsEndpoint.kt:23
  • `RethinkLocalFileTag`'s public constructor takes `uname`, `vname`, `group`, `subg` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `RethinkLocalFileTag` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/celzero/bravedns/database/RethinkLocalFileTag.kt:52
  • `RethinkRemoteFileTag`'s public constructor takes `uname`, `vname`, `group`, `subg` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `RethinkRemoteFileTag` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/celzero/bravedns/database/RethinkRemoteFileTag.kt:51
  • `RpnLog`'s public constructor takes `message` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `RpnLog` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/celzero/bravedns/database/RpnLog.kt:24
  • `RpnProxy`'s public constructor takes `name`, `configPath`, `serverResPath`, `misc`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `RpnProxy` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/celzero/bravedns/database/RpnProxy.kt:51
  • `SmartDnsEndpoint`'s public constructor takes `dnsName`, `dnsExplanation` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `SmartDnsEndpoint` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/celzero/bravedns/database/SmartDnsEndpoint.kt:23
  • `SubscriptionStateHistory`'s public constructor takes `reason` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `SubscriptionStateHistory` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/celzero/bravedns/database/SubscriptionStateHistory.kt:25
  • `TcpProxyEndpoint`'s public constructor takes `name`, `token`, `url` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `TcpProxyEndpoint` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/celzero/bravedns/database/TcpProxyEndpoint.kt:40
  • `WgConfigFiles`'s public constructor takes `name`, `configPath`, `serverResponse`, `ssids` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `WgConfigFiles` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/celzero/bravedns/database/WgConfigFiles.kt:67
  • `WgHopMap`'s public constructor takes `src`, `hop`, `status` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `WgHopMap` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/celzero/bravedns/database/WgHopMap.kt:41
  • `SponsorEntity`'s public constructor takes `purchaseToken`, `productId` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `SponsorEntity` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse. — app/src/main/java/com/celzero/bravedns/sponsor/database/SponsorEntity.kt:23

What to do

  • Give each aggregate one way in that can refuse — a guarded constructor, value-object parameters that validate themselves, or a private constructor behind a factory that returns a failure.
DM12 · Ambient inputs in the domain10.0 / 10Exemplary○ Nothing flagged

Other · Domain Modelling — Whether domain types receive the time and randomness their rules depend on, rather than reading the process clock or a global random source directly — an ambient read makes the rule it feeds untestable at the instant that matters and lets two reads inside one operation disagree.

Method: Roslyn (DDD-gated, C#/VB only): domain-layer types scanned for ambient reads — DateTime/DateTimeOffset.Now/UtcNow/Today, Random.Shared, new Random(), Stopwatch.GetTimestamp — resolved against the semantic model, with a comment/string-stripped token fallback only where resolution fails. Body reads are scored; field/property initialisers are surfaced unscored. Apply/When folds excluded (ES1 owns them). Deterministic, symbol-resolved.

DM2 · Strongly-typed ids3.0 / 10Weak✓ Tool-verified

Other · Domain Modelling — How much of the domain uses strongly-typed ids vs raw Guid/string/int — adoption curve, not all-or-nothing.

Method: Roslyn (DDD-gated): strongly-typed id adoption on domain entities/events; raw Guid/int/string ids counted versus wrapped types. An id wrapper is recognised by VALUE SEMANTICS, not by being a struct — a record struct, a record class (`record ApartmentId(Guid Value)`) or a class declared by a typed-id base (`class MemberId : TypedIdValueBase`) all count, while a plain mutable class (reference equality) and a verb-phrase query record (`GetCustomerById`) do not. Deterministic, adoption percentage.

Coverage: Population: id-like members by *Id/*Key NAME suffix; strongly-typed-ID shape then checked semantically — non-suffixed identifiers are not seen.

  • `ConnectionTracker.usrId` is a raw `Int` — give it a strongly-typed id: a dedicated single-field type wrapping the `Int`, in whatever form your language spells that. — app/src/main/java/com/celzero/bravedns/database/ConnectionTracker.kt:41
  • `ConnectionTracker.connId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. — app/src/main/java/com/celzero/bravedns/database/ConnectionTracker.kt:52
  • `CustomDomain.proxyId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. — app/src/main/java/com/celzero/bravedns/database/CustomDomain.kt:32
  • `CustomIp.proxyId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. — app/src/main/java/com/celzero/bravedns/database/CustomIp.kt:40
  • `DnsLog.proxyId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. — app/src/main/java/com/celzero/bravedns/database/DnsLog.kt:61
  • `DnsLog.resolverId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. — app/src/main/java/com/celzero/bravedns/database/DnsLog.kt:68
  • `ProxyApplicationMapping.proxyId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. — app/src/main/java/com/celzero/bravedns/database/ProxyApplicationMapping.kt:28
  • `RethinkLocalFileTag.simpleTagId` is a raw `Int` — give it a strongly-typed id: a dedicated single-field type wrapping the `Int`, in whatever form your language spells that. — app/src/main/java/com/celzero/bravedns/database/RethinkLocalFileTag.kt:34
  • `RethinkLog.usrId` is a raw `Int` — give it a strongly-typed id: a dedicated single-field type wrapping the `Int`, in whatever form your language spells that. — app/src/main/java/com/celzero/bravedns/database/RethinkLog.kt:38
  • `RethinkLog.connId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. — app/src/main/java/com/celzero/bravedns/database/RethinkLog.kt:49
  • `RethinkRemoteFileTag.simpleTagId` is a raw `Int` — give it a strongly-typed id: a dedicated single-field type wrapping the `Int`, in whatever form your language spells that. — app/src/main/java/com/celzero/bravedns/database/RethinkRemoteFileTag.kt:33
  • `RpnProxy.tunId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. — app/src/main/java/com/celzero/bravedns/database/RpnProxy.kt:17
  • `SubscriptionStateHistory.subscriptionId` is a raw `Int` — give it a strongly-typed id: a dedicated single-field type wrapping the `Int`, in whatever form your language spells that. — app/src/main/java/com/celzero/bravedns/database/SubscriptionStateHistory.kt:28
  • `SubscriptionStatus.accountId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. — app/src/main/java/com/celzero/bravedns/database/SubscriptionStatus.kt:28
  • `SubscriptionStatus.deviceId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. — app/src/main/java/com/celzero/bravedns/database/SubscriptionStatus.kt:42
  • `SubscriptionStatus.orderId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. — app/src/main/java/com/celzero/bravedns/database/SubscriptionStatus.kt:45
  • `SubscriptionStatus.productId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. — app/src/main/java/com/celzero/bravedns/database/SubscriptionStatus.kt:46
  • `SubscriptionStatus.planId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. — app/src/main/java/com/celzero/bravedns/database/SubscriptionStatus.kt:47
  • `SubscriptionStatus.previousProductId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that. — app/src/main/java/com/celzero/bravedns/database/SubscriptionStatus.kt:65

What to do

  • Adopt strongly-typed ids across the domain — finish the migration or document the boundary; primitive ids invite transposed-argument bugs.
DM4 · Rich vs anemic model3.2 / 10Weak✓ Tool-verified

Other · Domain Modelling — Whether aggregates/entities carry the behaviour that protects their invariants, rather than being data bags driven by external services.

Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.

Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.

  • `AlertRegistry` is an aggregate/entity with 15 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/AlertRegistry.kt:22
  • `AppInfo` is an aggregate/entity with 19 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/AppInfo.kt:28
  • `ConnectionTracker` is an aggregate/entity with 23 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/ConnectionTracker.kt:36
  • `ConsoleLog` is an aggregate/entity with 4 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/ConsoleLog.kt:22
  • `CountryConfig` is an aggregate/entity with 27 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/CountryConfig.kt:34
  • `CustomDomain` is an aggregate/entity with 10 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/CustomDomain.kt:26
  • `DnsCryptEndpoint` is an aggregate/entity with 8 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/DnsCryptEndpoint.kt:23
  • `DnsCryptRelayEndpoint` is an aggregate/entity with 8 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/DnsCryptRelayEndpoint.kt:23
  • `DnsLog` is an aggregate/entity with 31 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/DnsLog.kt:45
  • `DnsProxyEndpoint` is an aggregate/entity with 10 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/DnsProxyEndpoint.kt:25
  • `DoHEndpoint` is an aggregate/entity with 10 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/DoHEndpoint.kt:24
  • `DoTEndpoint` is an aggregate/entity with 9 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/DoTEndpoint.kt:24
  • `Event` is an aggregate/entity with 8 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/Event.kt:41
  • `IpInfo` is an aggregate/entity with 9 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/IpInfo.kt:23
  • `LocalBlocklistPacksMap` is an aggregate/entity with 4 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/LocalBlocklistPacksMap.kt:21
  • `ODoHEndpoint` is an aggregate/entity with 10 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/ODoHEndpoint.kt:24
  • `ProxyApplicationMapping` is an aggregate/entity with 6 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/ProxyApplicationMapping.kt:24
  • `ProxyEndpoint` is an aggregate/entity with 14 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/ProxyEndpoint.kt:24
  • `RemoteBlocklistPacksMap` is an aggregate/entity with 4 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/RemoteBlocklistPacksMap.kt:21
  • `RethinkDnsEndpoint` is an aggregate/entity with 9 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/RethinkDnsEndpoint.kt:23
  • `RethinkLocalFileTag` is an aggregate/entity with 12 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/RethinkLocalFileTag.kt:23
  • `RethinkLog` is an aggregate/entity with 22 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/RethinkLog.kt:34
  • `RethinkRemoteFileTag` is an aggregate/entity with 12 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/RethinkRemoteFileTag.kt:22
  • `RpnLog` is an aggregate/entity with 4 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/RpnLog.kt:24
  • `RpnProxy` is an aggregate/entity with 12 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/RpnProxy.kt:7
  • `SmartDnsEndpoint` is an aggregate/entity with 7 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/SmartDnsEndpoint.kt:23
  • `SubscriptionStateHistory` is an aggregate/entity with 6 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/SubscriptionStateHistory.kt:25
  • `SubscriptionStatus` is an aggregate/entity with 20 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/SubscriptionStatus.kt:25
  • `TcpProxyEndpoint` is an aggregate/entity with 6 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/TcpProxyEndpoint.kt:22
  • `WgConfigFiles` is an aggregate/entity with 13 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/WgConfigFiles.kt:23
  • `WgHopMap` is an aggregate/entity with 5 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — app/src/main/java/com/celzero/bravedns/database/WgHopMap.kt:7

What to do

  • Move business rules onto the aggregates/entities they govern so invariants are enforced at the source, not in anemic services.
DM5 · Encapsulated state1.3 / 10Critical✓ Tool-verified

Other · Domain Modelling — Whether entities protect their state — private/init-only setters, and collections handed out as read-only views rather than the mutable backing collection — instead of exposing writable state that bypasses invariants. Softened when a rehydration framework (Marten/EF) is present.

Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.

Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.

  • `AlertRegistry` exposes publicly writable state (id, alertTitle, alertType, alertCount, alertTime, alertMessage, and 9 more). — app/src/main/java/com/celzero/bravedns/database/AlertRegistry.kt:22
  • `AppInfo` exposes publicly writable state (packageName, appName, uid, isSystemApp, firewallStatus, appCategory, and 13 more). — app/src/main/java/com/celzero/bravedns/database/AppInfo.kt:28
  • `ConnectionTracker` exposes publicly writable state (id, appName, uid, packageName, usrId, ipAddress, and 17 more). — app/src/main/java/com/celzero/bravedns/database/ConnectionTracker.kt:36
  • `ConsoleLog` exposes publicly writable state (id). — app/src/main/java/com/celzero/bravedns/database/ConsoleLog.kt:22
  • `CountryConfig` exposes publicly writable state (isActive, isEnabled, catchAll, lockdown, mobileOnly, ssidBased, and 3 more). — app/src/main/java/com/celzero/bravedns/database/CountryConfig.kt:34
  • `CustomDomain` exposes publicly writable state (domain, uid, ips, status, type, proxyId, and 4 more). — app/src/main/java/com/celzero/bravedns/database/CustomDomain.kt:26
  • `CustomIp` exposes publicly writable state (uid, ipAddress, port, protocol, isActive, proxyId, and 5 more). — app/src/main/java/com/celzero/bravedns/database/CustomIp.kt:34
  • `DnsCryptEndpoint` exposes publicly writable state (id, dnsCryptName, dnsCryptURL, dnsCryptExplanation, isSelected, isCustom, and 2 more). — app/src/main/java/com/celzero/bravedns/database/DnsCryptEndpoint.kt:23
  • `DnsCryptRelayEndpoint` exposes publicly writable state (id, dnsCryptRelayName, dnsCryptRelayURL, dnsCryptRelayExplanation, isSelected, isCustom, and 2 more). — app/src/main/java/com/celzero/bravedns/database/DnsCryptRelayEndpoint.kt:23
  • `DnsLog` exposes publicly writable state (id, uid, appName, packageName, queryStr, time, and 25 more). — app/src/main/java/com/celzero/bravedns/database/DnsLog.kt:45
  • `DnsProxyEndpoint` exposes publicly writable state (id, proxyName, proxyType, proxyAppName, proxyIP, proxyPort, and 4 more). — app/src/main/java/com/celzero/bravedns/database/DnsProxyEndpoint.kt:25
  • `DoHEndpoint` exposes publicly writable state (id, dohName, dohURL, dohIp, dohExplanation, isSelected, and 4 more). — app/src/main/java/com/celzero/bravedns/database/DoHEndpoint.kt:24
  • `DoTEndpoint` exposes publicly writable state (id, name, url, desc, isSelected, isCustom, and 3 more). — app/src/main/java/com/celzero/bravedns/database/DoTEndpoint.kt:24
  • `IpInfo` exposes publicly writable state (ip, asn, asName, asDomain, countryCode, country, and 3 more). — app/src/main/java/com/celzero/bravedns/database/IpInfo.kt:23
  • `LocalBlocklistPacksMap` exposes publicly writable state (pack, level, blocklistIds, group). — app/src/main/java/com/celzero/bravedns/database/LocalBlocklistPacksMap.kt:21
  • `ODoHEndpoint` exposes publicly writable state (id, name, proxy, resolver, proxyIps, desc, and 4 more). — app/src/main/java/com/celzero/bravedns/database/ODoHEndpoint.kt:24
  • `ProxyApplicationMapping` exposes publicly writable state (uid, packageName, proxyId, appName, proxyName, isActive). — app/src/main/java/com/celzero/bravedns/database/ProxyApplicationMapping.kt:24
  • `ProxyEndpoint` exposes publicly writable state (id, proxyName, proxyMode, proxyType, proxyAppName, proxyIP, and 8 more). — app/src/main/java/com/celzero/bravedns/database/ProxyEndpoint.kt:24
  • `RemoteBlocklistPacksMap` exposes publicly writable state (pack, level, blocklistIds, group). — app/src/main/java/com/celzero/bravedns/database/RemoteBlocklistPacksMap.kt:21
  • `RethinkDnsEndpoint` exposes publicly writable state (name, url, uid, desc, isActive, isCustom, and 3 more). — app/src/main/java/com/celzero/bravedns/database/RethinkDnsEndpoint.kt:23
  • `RethinkLocalFileTag` exposes publicly writable state (value, uname, vname, group, subg, url, and 6 more). — app/src/main/java/com/celzero/bravedns/database/RethinkLocalFileTag.kt:23
  • `RethinkLog` exposes publicly writable state (id, appName, uid, usrId, ipAddress, port, and 16 more). — app/src/main/java/com/celzero/bravedns/database/RethinkLog.kt:34
  • `RethinkRemoteFileTag` exposes publicly writable state (value, uname, vname, group, subg, url, and 6 more). — app/src/main/java/com/celzero/bravedns/database/RethinkRemoteFileTag.kt:22
  • `RpnLog` exposes publicly writable state (id). — app/src/main/java/com/celzero/bravedns/database/RpnLog.kt:24
  • `RpnProxy` exposes publicly writable state (id, name, configPath, serverResPath, isActive, isLockdown, and 6 more). — app/src/main/java/com/celzero/bravedns/database/RpnProxy.kt:7
  • `SmartDnsEndpoint` exposes publicly writable state (isSelected). — app/src/main/java/com/celzero/bravedns/database/SmartDnsEndpoint.kt:23
  • `SubscriptionStatus` exposes publicly writable state (id, accountId, deviceId, purchaseToken, orderId, productId, and 14 more). — app/src/main/java/com/celzero/bravedns/database/SubscriptionStatus.kt:25
  • `TcpProxyEndpoint` exposes publicly writable state (id, name, token, url, paymentStatus, isActive). — app/src/main/java/com/celzero/bravedns/database/TcpProxyEndpoint.kt:22
  • `WgConfigFiles` exposes publicly writable state (id, name, configPath, serverResponse, isActive, isCatchAll, and 7 more). — app/src/main/java/com/celzero/bravedns/database/WgConfigFiles.kt:23
  • `WgHopMap` exposes publicly writable state (id, src, hop, isActive, status). — app/src/main/java/com/celzero/bravedns/database/WgHopMap.kt:7

What to do

  • Make entity setters private/init-only and hand collections out as IReadOnlyList/IReadOnlyCollection over a private backing field; change state only through methods that enforce the invariants (Marten/EF can bind via constructor or private setters).
DM6 · Domain ↔ infrastructure boundary10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies (EF/Marten/HTTP/ASP.NET) — the clean-architecture dependency rule.

Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.

Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.

DM8 · Value-object opportunities10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether clusters of primitives that travel together (a missing value object) are extracted — a low-weight suggestion, LLM-confirmed when configured.

Method: Roslyn (DDD-gated): primitive parameter clusters recurring three or more times across signatures extracted, then confirmed by language model when configured. Advisory, low-weight.

DM9 · Scattered domain decisions10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether one domain rule is decided — or one measurement produced — in more than one place, rather than living on the type that owns it.

Method: Neutral body surface plus Roslyn (DDD-gated), two arms. DECISION (Roslyn only): a predicate over a domain type's members judged in two or more types, where none of those decisions live on the owning type — operands of comparisons and relational property patterns only, so a member merely passed as an argument is not judged. DERIVATION: a plain all-numeric carrier of ≥2 members, with no base type and exactly one constructor, CONSTRUCTED as the result of a method (returned or assigned, never inline as an argument) in two or more types other than its own — the same measurement produced twice, which centralising the judgement does not fix. DERIVATION runs on every language whose frontend declares the produced-or-passed fact per construction (Roslyn and the Java sidecar today); a target with only the derivation arm carries an engine gap naming the decision arm as not assessed, and a frontend that declares nothing keeps the dimension not measured rather than clean. Single-member rules, test code and generated code are out of population for both. Advisory.

M1 · Documentation (README)6.0 / 10Adequate✓ Tool-verified

Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.

Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.

What to do

  • Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
  • Add a README to the 2 of 2 project(s) that lack one — worth up to 2 pts.
M2 · Architecture documentation0.0 / 10Critical✓ Tool-verified

Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.

Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
  • No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
  • Add a C4 context/container diagram (Structurizr, PlantUML or Mermaid) or an architecture.md overview.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.

Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.

M4 · Documentation accuracy10.0 / 10Exemplary◐ Sampled · advisory

Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).

Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.

P1 · CI/CD gates8.5 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether an automated pipeline builds and tests every change.

Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.

What to do

  • Run the test suite in CI via an explicit runner step (`./gradlew test` for the toolchain this pipeline already uses) and gate merges on it.
P3 · Security & performance tooling7.0 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).

Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.

What to do

  • Dependabot is configured but does not watch `github-actions` — add that `package-ecosystem` entry to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback7.0 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.

Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.

P6 · Release Hygiene5.0 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

  • No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)

What to do

  • Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.

Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.

  • `Retrofit.Builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×3) — app/src/fdroid/java/com/celzero/bravedns/iab/stripe/RetrofitInstance.kt:22, app/src/fdroid/java/com/celzero/bravedns/iab/stripe/RetrofitInstance.kt:44, app/src/main/java/com/celzero/bravedns/customdownloader/IpInfoDownloader.kt:86

What to do

  • Set connect and read timeouts on every client (`RestTemplateBuilder.connectTimeout/readTimeout`, WebClient `responseTimeout`, `HttpRequest.Builder.timeout`, `HttpURLConnection.setReadTimeout`, Feign `connectTimeout`/`readTimeout` in configuration), and wrap calls to dependencies in resilience4j `@Retry`/`@CircuitBreaker`/`@TimeLimiter` (or Spring Retry).
PF1 · Benchmark discipline9.0 / 10Exemplary✓ Tool-verified

Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.

Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.

PF2 · Allocation hygiene6.3 / 10Adequate✓ Tool-verified

Readiness · Performance — Whether the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.

Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — in .NET Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit; off .NET, with comments and strings blanked, Go's sync.Pool, preallocated slices/maps, Grow, strconv.Append* and buf[:0] reuse; the JVM's NIO buffer views, MemorySegment, primitive collections, pools and literal presizes (plus Kotlin primitive arrays and value classes, Scala AnyVal and @specialized); Swift's reserveCapacity, ContiguousArray, withUnsafe* access and ~Copyable. Activated off .NET on the same floor (400 lines, and benchmarks or 8 uses); Rust and garbage-collected scripting languages are not applicable. Reward-only. Deterministic, syntax/text detection.

What to do

  • Raise allocation-aware density on the hot paths — currently 110 use(s) across 199,879 production line(s) (~0.6/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
  • Java: on hot paths, work through buffer views (ByteBuffer/LongBuffer slices, MemorySegment) instead of copies, avoid boxing with primitive collections (fastutil, Eclipse Collections, HPPC, Trove), presize collections and StringBuilders, and pool expensive buffers (Netty's pooled allocator, commons-pool).
  • Kotlin: on hot paths, use primitive arrays (IntArray, LongArray …) and @JvmInline value classes instead of boxed values, primitive collections (androidx.collection, fastutil) instead of boxed ones, and presize collections and StringBuilders.
PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.

Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.

X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.

Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.

X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.

Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.

X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.

Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.

X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.

Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.

X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.

Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.

X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.

Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.

X18 · Disposal-pattern correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.

Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.

X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.

Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.

X20 · Mistyped argument guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `NullPointerException` (Java, Kotlin, Scala), `ArgumentError.notNull` (Dart) or `ArgumentNullException` (F#'s `nullArg`) tells the caller a parameter was null when it provably was not.

Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements controlled by an `if`, whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`). Deterministic, provable per finding. Advisory.

X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.

Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.

X22 · Contradicted release guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.

Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.

X23 · Unguarded diagnostic materialisation10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.

Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.

X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.

Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.

X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.

Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.

X26 · Unsynchronised callback handoff10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.

Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.

X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether an enhanced `for` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is iterating invalidates the fail-fast iterator it is holding, so the next `next()` throws `ConcurrentModificationException` and the remaining elements are never seen. Whether a `for (x in c)` or `c.forEach { … }` leaves the collection it is walking alone — a `mutableListOf`/`ArrayList`, `mutableMapOf`/`HashMap` or `mutableSetOf`/`HashSet` is a `java.util` collection on the JVM and is walked by its own fail-fast iterator, so a body that adds to or removes from the very collection the loop is walking makes the next step throw `ConcurrentModificationException` and the remaining elements are never seen.

Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.

X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.

X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.

Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.

X3 · Exception handling6.2 / 10Adequate✓ Tool-verified

Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.

Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.

  • `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×5) — app/src/main/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt:793, app/src/main/java/com/celzero/bravedns/adapter/DnsLogAdapter.kt:540, app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:279, …
  • `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×21) — app/src/main/java/com/celzero/bravedns/adapter/ODoHEndpointAdapter.kt:298, app/src/main/java/com/celzero/bravedns/adapter/DohEndpointAdapter.kt:293, app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:294, …
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×13) — app/src/main/java/com/celzero/bravedns/customdownloader/RetrofitManager.kt:223, app/src/main/java/com/celzero/bravedns/database/AppDatabase.kt:1260, app/src/main/java/com/celzero/bravedns/database/AppDatabase.kt:1299, …
  • `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — app/src/main/java/com/celzero/bravedns/database/CountryConfig.kt:163

What to do

  • Swallowed exception (caught, then discarded)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.

Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.

X5 · Nullable reference types9.9 / 10Exemplary✓ Tool-verified

Other · Code Health — Whether Kotlin's null safety is not undermined by not-null assertions — `String` cannot hold null and `String?` must be checked before use in every Kotlin module, and each `!!` is a run-time `NullPointerException` the author has told the compiler cannot happen.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

Reference — by lens

The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.

LensScoreRatingImpact
Code Health80%StrongSolid.
Architecture89%Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity47%Adequate — gated by D16, M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness57%Adequate — gated by P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security58%Adequate — gated by C1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling42%Weak — gated by DM2, DM4, DM5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance81%StrongStrongest area.
Unscored — 2 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 19 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 control(s) we could not find positive evidence for

These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.

  • C3 Audit Trail — Repo shows no audit-logging mechanism (an audit-log table or model — an Exposed table, a data class, a Room entity or a SQL migration's table named for it — Hibernate Envers' @Audited, a JPA entity listener, Hibernate event listener or jOOQ RecordListener that records each change) for sensitive changes — absence of evidence is not evidence of a working control. Record an audit trail in code (or document where it lives) so this dimension can be scored.
  • C5 Data-Subject Rights — Repo shows no corroborated data-subject-rights mechanism (erasure / export-portability / consent) tied to a subject id or GDPR vocabulary — absence of evidence is not evidence of a working control. Implement erasure, data export/portability and consent tracking over the subject's records.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 54 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Java code is a Spring, JSR-330 or CDI singleton bean. No class in this Kotlin code is a Spring, JSR-330 or CDI singleton bean.
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D10 Test Quality — ~29448 lines of test source are present (.kt) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D11 Test Reliability — Test reliability not included — the .kt suite was found but not re-run
  • D12 Dependency Hygiene — Not scored — 4 Maven/Gradle manifest(s) were read, stating a version for 84 dependency(ies) and leaving 9 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
  • D14 License Compliance — Not scored — this repository's 84 declared JVM dependency coordinate(s) were read from its 4 Maven/Gradle manifest(s), but Maven Central could not be asked for the licence of 82 of them (HTTP 429 Too Many Requests from https://repo1.maven.org/maven2/com/google/gms/google-services/4.4.4/google-services-4.4.4.pom), and a licence verdict over part of a dependency graph is not a licence verdict. Nothing is asserted about this repository's licensing in either direction.
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.kt), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) — not scanned yet).
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — 24 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D43 Malicious Dependencies — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) — not scanned yet).
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • D9 Test Distribution — Test source is present (.kt) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so its unit/integration/BDD/E2E split couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • DM1 Aggregate boundaries — no aggregates detected — aggregate-boundary check not applicable
  • DM3 Integration-event coupling — no integration events detected — coupling check not applicable
  • DM7 Repository granularity — no repository abstraction detected (e.g. uses a document session)
  • ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P2 Observability — This repository's JVM source (1 module(s), 670 file(s) read) declares no entry point and bootstraps no server, and nothing here deploys a service — it is a library, run inside whatever hosts it, so production observability (structured logging, tracing/metrics, health checks) is N/A. If it grows a binary or a service, the dimension reactivates.
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (JaCoCo XML — the Gradle `jacocoTestReport` task) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Kotlin was read, and it logs through none that an assembled message defeats: Android's `Log` and Timber, java.util.logging and log4j-api-kotlin take one finished message (as log4net does in C#), or it makes no call through a named logger at all. Calls made through SLF4J, log4j 2 or kotlin-logging (`LoggerFactory.getLogger`, `KotlinLogging.logger {}`) would be judged.
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Critical — 34 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 2 more in this group — see findings.md.
D28 · Secrets (history) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
Serious — 1402 finding(s)
D17 · Explicit Debt · TodoComment · ×106
  • TodoComment app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:389 — // TODO: should we add more checks here? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt:397 — // TODO: remove this in later versions — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/com/celzero/bravedns/adapter/RethinkLogAdapter.kt:136 — // ToDo: get rid of rethink btm sht if not required — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:473 — // TODO: Implement RPN hop logic when hop manager is ready — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/com/celzero/bravedns/customdownloader/LocalBlocklistCoordinator.kt:216 — // downloaded. TODO: Later add checksum matching as well — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/com/celzero/bravedns/data/AppConfig.kt:247 — // TODO: untangle the mess of proxy modes and providers — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/com/celzero/bravedns/database/WgConfigFilesDAO.kt:47 — // TODO: should remove this query post v055o — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/com/celzero/bravedns/database/RethinkDnsEndpointDao.kt:86 — // TODO: remove this method post v054 versions — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/com/celzero/bravedns/database/RefreshDatabase.kt:400 — // TODO: implement upsert logic handling all the edge cases — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/com/celzero/bravedns/database/RefreshDatabase.kt:1160 — //TODO handle error — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/com/celzero/bravedns/net/doh/Race.java:27 — //TODO : Why you are not using it ??????? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/com/celzero/bravedns/net/doh/Prober.java:22 — //TODO : Understand this class ???? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt:173 — // TODO: ideally the values required for transport, alg and rdns should be set in the — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt:258 — // TODO: #321 As of now there is no block free transport for dns types other than Rethink.
  • TodoComment app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt:264 — // TODO: should show notification if the transport is not added? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt:343 — // TODO: remove below method when there is new UI for blockfree transport — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt:2026 — // TODO: notify the user that the default transport could not be set — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt:2104 — // TODO: notify the user that the default transport could not be set — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt:2177 — // TODO: system dns may be non existent; see: AppConfig#updateSystemDnsServers — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt:3457 — // TODO: see if the hop is already added, if so no need to redo this — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/com/celzero/bravedns/receiver/NotificationActionReceiver.kt:50 — // TODO - Move the NOTIFICATION_ACTIONs value to enum — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:1840 — // TODO: perform the validation of purchaseToken and accountId with the subscription data — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/com/celzero/bravedns/scheduler/RpnProxyUpdateWorker.kt:151 — // TODO: Duplicate implementation exists in RpnProxyUpdateWorker and — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/com/celzero/bravedns/scheduler/PaymentWorker.kt:94 — // TODO: no need of this fn now — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt:135 — // TODO: delete the warp config from the wireguard directory, now part of rpn proxy — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • + 81 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×51
  • TooManyMethods: BraveVPNService app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:177 — TooManyMethods — 253 methods. The bar is 30 methods; this is 223 over it, 8.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: HomeScreenFragment app/src/main/java/com/celzero/bravedns/ui/fragment/HomeScreenFragment.kt:164 — TooManyMethods — 160 methods. The bar is 30 methods; this is 130 over it, 5.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: GoVpnAdapter app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt:122 — TooManyMethods — 155 methods. The bar is 30 methods; this is 125 over it, 5.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ServerSelectionFragment app/src/main/java/com/celzero/bravedns/ui/fragment/ServerSelectionFragment.kt:131 — TooManyMethods — 134 methods. The bar is 30 methods; this is 104 over it, 4.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AppConfig app/src/main/java/com/celzero/bravedns/data/AppConfig.kt:63 — TooManyMethods — 111 methods. The bar is 30 methods; this is 81 over it, 3.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: VpnController app/src/main/java/com/celzero/bravedns/service/VpnController.kt:48 — TooManyMethods — 105 methods. The bar is 30 methods; this is 75 over it, 3.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: InAppBillingHandler REDACTED:104 — TooManyMethods — 102 methods. The bar is 30 methods; this is 72 over it, 3.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: InAppBillingHandler app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:104 — TooManyMethods — 102 methods. The bar is 30 methods; this is 72 over it, 3.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RpnProxyManager app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:90 — TooManyMethods — 99 methods. The bar is 30 methods; this is 69 over it, 3.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AppInfoActivity app/src/main/java/com/celzero/bravedns/ui/activity/AppInfoActivity.kt:118 — TooManyMethods — 86 methods. The bar is 30 methods; this is 56 over it, 2.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Utilities app/src/main/java/com/celzero/bravedns/util/Utilities.kt:105 — TooManyMethods — 82 methods. The bar is 30 methods; this is 52 over it, 2.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: FirewallManager app/src/main/java/com/celzero/bravedns/service/FirewallManager.kt:56 — TooManyMethods — 69 methods. The bar is 30 methods; this is 39 over it, 2.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SubscriptionStateMachineV2 app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:59 — TooManyMethods — 66 methods. The bar is 30 methods; this is 36 over it, 2.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: WireguardManager app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt:50 — TooManyMethods — 64 methods. The bar is 30 methods; this is 34 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RpnConfigDetailActivity app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:99 — TooManyMethods — 63 methods. The bar is 30 methods; this is 33 over it, 2.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: WgConfigDetailActivity app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt:96 — TooManyMethods — 59 methods. The bar is 30 methods; this is 29 over it, 1.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AboutFragment app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:129 — TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RethinkPlusFragment app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:67 — TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RethinkPlusFragment app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:67 — TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RethinkBlocklistFragment app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkBlocklistFragment.kt:82 — TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SummaryStatisticsFragment app/src/main/java/com/celzero/bravedns/ui/fragment/SummaryStatisticsFragment.kt:70 — TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AppDatabase app/src/main/java/com/celzero/bravedns/database/AppDatabase.kt:65 — TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: IpRulesManager app/src/main/java/com/celzero/bravedns/service/IpRulesManager.kt:36 — TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DomainRulesManager app/src/main/java/com/celzero/bravedns/service/DomainRulesManager.kt:41 — TooManyMethods — 47 methods. The bar is 30 methods; this is 17 over it, 1.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DnsBlocklistBottomSheet app/src/main/java/com/celzero/bravedns/ui/bottomsheet/DnsBlocklistBottomSheet.kt:80 — TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • + 26 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×46
  • FileTooLong: service/BraveVPNService.kt app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt — FileTooLong — 2976 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: BraveVPNService (177-4914). The bar is 500 significant lines; this is 2476 over it, 5.95× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: go/GoVpnAdapter.kt app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt — FileTooLong — 2725 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: GoVpnAdapter (122-3996). The bar is 500 significant lines; this is 2225 over it, 5.45× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: fragment/ServerSelectionFragment.kt app/src/main/java/com/celzero/bravedns/ui/fragment/ServerSelectionFragment.kt — FileTooLong — 2474 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: ServerSelectionFragment (131-4053). The bar is 500 significant lines; this is 1974 over it, 4.95× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 2436 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1936 over it, 4.87× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt — FileTooLong — 2436 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1936 over it, 4.87× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: rpnproxy/RpnProxyManager.kt app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt — FileTooLong — 2396 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1896 over it, 4.79× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: fragment/HomeScreenFragment.kt app/src/main/java/com/celzero/bravedns/ui/fragment/HomeScreenFragment.kt — FileTooLong — 2189 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: HomeScreenFragment (164-3719). The bar is 500 significant lines; this is 1689 over it, 4.38× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: rpnproxy/SubscriptionStateMachineV2.kt app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt — FileTooLong — 2116 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: SubscriptionStateMachineV2 (59-3382). The bar is 500 significant lines; this is 1616 over it, 4.23× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: activity/AppInfoActivity.kt app/src/main/java/com/celzero/bravedns/ui/activity/AppInfoActivity.kt — FileTooLong — 1372 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: AppInfoActivity (118-2060). The bar is 500 significant lines; this is 872 over it, 2.74× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: fragment/AboutFragment.kt app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt — FileTooLong — 1305 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: AboutFragment (129-1883). The bar is 500 significant lines; this is 805 over it, 2.61× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: database/AppDatabase.kt app/src/main/java/com/celzero/bravedns/database/AppDatabase.kt — FileTooLong — 1108 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: AppDatabase (65-1721). The bar is 500 significant lines; this is 608 over it, 2.22× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: activity/RpnConfigDetailActivity.kt app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt — FileTooLong — 1063 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: RpnConfigDetailActivity (99-1725). The bar is 500 significant lines; this is 563 over it, 2.13× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: service/WireguardManager.kt app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt — FileTooLong — 1006 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 506 over it, 2.01× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: service/ConnectionMonitor.kt app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt — FileTooLong — 1005 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 505 over it, 2.01× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: activity/WgConfigDetailActivity.kt app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt — FileTooLong — 992 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: WgConfigDetailActivity (96-1502). The bar is 500 significant lines; this is 492 over it, 1.98× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: service/TunFlowManager.kt app/src/main/java/com/celzero/bravedns/service/TunFlowManager.kt — FileTooLong — 973 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 473 over it, 1.95× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: activity/TunnelSettingsActivity.kt app/src/main/java/com/celzero/bravedns/ui/activity/TunnelSettingsActivity.kt — FileTooLong — 950 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: TunnelSettingsActivity (69-1468). The bar is 500 significant lines; this is 450 over it, 1.90× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: activity/MiscSettingsActivity.kt app/src/main/java/com/celzero/bravedns/ui/activity/MiscSettingsActivity.kt — FileTooLong — 921 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: MiscSettingsActivity (108-1377). The bar is 500 significant lines; this is 421 over it, 1.84× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: activity/ProxySettingsActivity.kt app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt — FileTooLong — 914 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: ProxySettingsActivity (91-1305). The bar is 500 significant lines; this is 414 over it, 1.83× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: iab/BillingBackendClient.kt app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt — FileTooLong — 888 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: BillingBackendClient (66-1568). The bar is 500 significant lines; this is 388 over it, 1.78× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: iab/BillingBackendClient.kt app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt — FileTooLong — 888 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: BillingBackendClient (66-1568). The bar is 500 significant lines; this is 388 over it, 1.78× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: data/AppConfig.kt app/src/main/java/com/celzero/bravedns/data/AppConfig.kt — FileTooLong — 832 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: AppConfig (63-1347). The bar is 500 significant lines; this is 332 over it, 1.66× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: service/FirewallManager.kt app/src/main/java/com/celzero/bravedns/service/FirewallManager.kt — FileTooLong — 803 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 303 over it, 1.61× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: tunnel/TunDnsManager.kt app/src/main/java/com/celzero/bravedns/tunnel/TunDnsManager.kt — FileTooLong — 761 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 261 over it, 1.52× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: adapter/VpnServerAdapter.kt app/src/main/java/com/celzero/bravedns/ui/adapter/VpnServerAdapter.kt — FileTooLong — 752 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: VpnServerAdapter (84-1230). The bar is 500 significant lines; this is 252 over it, 1.50× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • + 21 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×42
  • MethodTooLong: InAppBillingHandler.handlePurchaseInternal REDACTED:926 — MethodTooLong — handlePurchaseInternal runs 289 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 189 over it, 2.89× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: InAppBillingHandler.handlePurchaseInternal app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:926 — MethodTooLong — handlePurchaseInternal runs 289 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 189 over it, 2.89× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TunnelSettingsActivity.setupClickListeners app/src/main/java/com/celzero/bravedns/ui/activity/TunnelSettingsActivity.kt:288 — MethodTooLong — setupClickListeners runs 230 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 130 over it, 2.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: BraveVPNService.onSharedPreferenceChanged app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:1543 — MethodTooLong — onSharedPreferenceChanged runs 174 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 74 over it, 1.74× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: RpnHomeScreenKt.RpnHomeScreen app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnHomeScreen.kt:80 — MethodTooLong — RpnHomeScreen runs 174 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 74 over it, 1.74× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TunFlowManager.determineProxyDetails app/src/main/java/com/celzero/bravedns/service/TunFlowManager.kt:1113 — MethodTooLong — determineProxyDetails runs 169 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 69 over it, 1.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: RpnLocationDetailScreenKt.RpnLocationDetailScreen app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnLocationDetailScreen.kt:78 — MethodTooLong — RpnLocationDetailScreen runs 168 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 68 over it, 1.68× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TunFirewallManager.firewall app/src/main/java/com/celzero/bravedns/service/TunFirewallManager.kt:100 — MethodTooLong — firewall runs 158 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 58 over it, 1.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SubscriptionStateMachineV2.handlePaymentSuccessful app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:2587 — MethodTooLong — handlePaymentSuccessful runs 156 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 56 over it, 1.56× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: RpnSettingsScreenKt.RpnSettingsScreen app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnSettingsScreen.kt:67 — MethodTooLong — RpnSettingsScreen runs 155 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 55 over it, 1.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SubscriptionStateMachineV2.reconcileWithPlayBilling app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1192 — MethodTooLong — reconcileWithPlayBilling runs 154 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 54 over it, 1.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SubscriptionStateMachineV2.expireStaleInAppFromDb app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1895 — MethodTooLong — expireStaleInAppFromDb runs 151 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 51 over it, 1.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: RpnAddLocationScreenKt.RpnAddLocationScreen app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAddLocationScreen.kt:72 — MethodTooLong — RpnAddLocationScreen runs 149 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 49 over it, 1.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: CustomerSupportActivity.collectAndSend app/src/main/java/com/celzero/bravedns/ui/activity/CustomerSupportActivity.kt:263 — MethodTooLong — collectAndSend runs 148 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 48 over it, 1.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: RpnPurchaseRouteKt.RpnPurchaseRoute app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:72 — MethodTooLong — RpnPurchaseRoute runs 143 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 43 over it, 1.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: RpnPurchaseRouteKt.RpnPurchaseRoute app/src/websiteTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:72 — MethodTooLong — RpnPurchaseRoute runs 143 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 43 over it, 1.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DnsSettingsFragment.initClickListeners app/src/main/java/com/celzero/bravedns/ui/fragment/DnsSettingsFragment.kt:467 — MethodTooLong — initClickListeners runs 141 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 41 over it, 1.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AppInfoActivity.setupClickListeners app/src/main/java/com/celzero/bravedns/ui/activity/AppInfoActivity.kt:1022 — MethodTooLong — setupClickListeners runs 140 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 40 over it, 1.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TvNavScaffoldKt.TvNavScaffold app/src/tv/java/com/celzero/bravedns/tv/ui/nav/TvNavScaffold.kt:106 — MethodTooLong — TvNavScaffold runs 139 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 39 over it, 1.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AboutFragment.showProcDialog app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:1210 — MethodTooLong — showProcDialog runs 138 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 38 over it, 1.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ProxySettingsActivity.showSocks5ProxyDialog app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:801 — MethodTooLong — showSocks5ProxyDialog runs 134 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 34 over it, 1.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: RpnManagePurchaseScreenKt.RpnManagePurchaseScreen app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnManagePurchaseScreen.kt:66 — MethodTooLong — RpnManagePurchaseScreen runs 132 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 32 over it, 1.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: RpnProxyManager.registerProxy app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:1162 — MethodTooLong — registerProxy runs 129 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 29 over it, 1.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DolphinOceanView.calculateDolphinPose app/src/main/java/com/celzero/bravedns/ui/custom/DolphinOceanView.kt:585 — MethodTooLong — calculateDolphinPose runs 125 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 25 over it, 1.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TunDnsManager.decideUpstreamAnswer app/src/main/java/com/celzero/bravedns/tunnel/TunDnsManager.kt:976 — MethodTooLong — decideUpstreamAnswer runs 122 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 22 over it, 1.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 17 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×39
  • ClassTooLong: BraveVPNService app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:177 — ClassTooLong — 2819 significant lines (blank, comment-only and punctuation-only lines excluded), 253 methods. The bar is 400 significant lines; this is 2419 over it, 7.05× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: GoVpnAdapter app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt:122 — ClassTooLong — 2626 significant lines (blank, comment-only and punctuation-only lines excluded), 155 methods. The bar is 400 significant lines; this is 2226 over it, 6.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ServerSelectionFragment app/src/main/java/com/celzero/bravedns/ui/fragment/ServerSelectionFragment.kt:131 — ClassTooLong — 2364 significant lines (blank, comment-only and punctuation-only lines excluded), 134 methods. The bar is 400 significant lines; this is 1964 over it, 5.91× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SubscriptionStateMachineV2 app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:59 — ClassTooLong — 2083 significant lines (blank, comment-only and punctuation-only lines excluded), 66 methods. The bar is 400 significant lines; this is 1683 over it, 5.21× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: HomeScreenFragment app/src/main/java/com/celzero/bravedns/ui/fragment/HomeScreenFragment.kt:164 — ClassTooLong — 2043 significant lines (blank, comment-only and punctuation-only lines excluded), 160 methods. The bar is 400 significant lines; this is 1643 over it, 5.11× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AppInfoActivity app/src/main/java/com/celzero/bravedns/ui/activity/AppInfoActivity.kt:118 — ClassTooLong — 1272 significant lines (blank, comment-only and punctuation-only lines excluded), 86 methods. The bar is 400 significant lines; this is 872 over it, 3.18× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AboutFragment app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:129 — ClassTooLong — 1185 significant lines (blank, comment-only and punctuation-only lines excluded), 58 methods. The bar is 400 significant lines; this is 785 over it, 2.96× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AppDatabase app/src/main/java/com/celzero/bravedns/database/AppDatabase.kt:65 — ClassTooLong — 1064 significant lines (blank, comment-only and punctuation-only lines excluded), 50 methods. The bar is 400 significant lines; this is 664 over it, 2.66× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: RpnConfigDetailActivity app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:99 — ClassTooLong — 990 significant lines (blank, comment-only and punctuation-only lines excluded), 63 methods. The bar is 400 significant lines; this is 590 over it, 2.48× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: WgConfigDetailActivity app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt:96 — ClassTooLong — 914 significant lines (blank, comment-only and punctuation-only lines excluded), 59 methods. The bar is 400 significant lines; this is 514 over it, 2.29× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TunnelSettingsActivity app/src/main/java/com/celzero/bravedns/ui/activity/TunnelSettingsActivity.kt:69 — ClassTooLong — 899 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. The bar is 400 significant lines; this is 499 over it, 2.25× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: BillingBackendClient app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:66 — ClassTooLong — 853 significant lines (blank, comment-only and punctuation-only lines excluded), 43 methods. The bar is 400 significant lines; this is 453 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: BillingBackendClient app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:66 — ClassTooLong — 853 significant lines (blank, comment-only and punctuation-only lines excluded), 43 methods. The bar is 400 significant lines; this is 453 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ProxySettingsActivity app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:91 — ClassTooLong — 841 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 441 over it, 2.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: MiscSettingsActivity app/src/main/java/com/celzero/bravedns/ui/activity/MiscSettingsActivity.kt:108 — ClassTooLong — 831 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 400 significant lines; this is 431 over it, 2.08× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AppConfig app/src/main/java/com/celzero/bravedns/data/AppConfig.kt:63 — ClassTooLong — 787 significant lines (blank, comment-only and punctuation-only lines excluded), 111 methods. The bar is 400 significant lines; this is 387 over it, 1.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: RefreshDatabase app/src/main/java/com/celzero/bravedns/database/RefreshDatabase.kt:72 — ClassTooLong — 690 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 400 significant lines; this is 290 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: VpnServerAdapter app/src/main/java/com/celzero/bravedns/ui/adapter/VpnServerAdapter.kt:84 — ClassTooLong — 689 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods. The bar is 400 significant lines; this is 289 over it, 1.72× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SummaryStatisticsFragment app/src/main/java/com/celzero/bravedns/ui/fragment/SummaryStatisticsFragment.kt:70 — ClassTooLong — 687 significant lines (blank, comment-only and punctuation-only lines excluded), 51 methods. The bar is 400 significant lines; this is 287 over it, 1.72× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DolphinOceanView app/src/main/java/com/celzero/bravedns/ui/custom/DolphinOceanView.kt:67 — ClassTooLong — 683 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. The bar is 400 significant lines; this is 283 over it, 1.71× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: RethinkPlusFragment app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:67 — ClassTooLong — 614 significant lines (blank, comment-only and punctuation-only lines excluded), 58 methods. The bar is 400 significant lines; this is 214 over it, 1.54× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: RethinkPlusFragment app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:67 — ClassTooLong — 614 significant lines (blank, comment-only and punctuation-only lines excluded), 58 methods. The bar is 400 significant lines; this is 214 over it, 1.54× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DnsBlocklistBottomSheet app/src/main/java/com/celzero/bravedns/ui/bottomsheet/DnsBlocklistBottomSheet.kt:80 — ClassTooLong — 584 significant lines (blank, comment-only and punctuation-only lines excluded), 45 methods. The bar is 400 significant lines; this is 184 over it, 1.46× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AppListActivity app/src/main/java/com/celzero/bravedns/ui/activity/AppListActivity.kt:71 — ClassTooLong — 580 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. The bar is 400 significant lines; this is 180 over it, 1.45× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ConnTrackerBottomSheet app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt:75 — ClassTooLong — 556 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods. The bar is 400 significant lines; this is 156 over it, 1.39× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • + 14 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×38
  • Duplicated block (8 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:162 — app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:162-169 | app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt:204-211 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 195 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:162` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:350 — app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:350-357 | app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:541-548 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 168 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnHopManager.kt:226 — app/src/main/java/com/celzero/bravedns/rpnproxy/RpnHopManager.kt:226-233 | app/src/main/java/com/celzero/bravedns/wireguard/WgHopManager.kt:228-235 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/rpnproxy/RpnHopManager.kt` and `app/src/main/java/com/celzero/bravedns/wireguard/WgHopManager.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) app/src/main/java/com/celzero/bravedns/service/RethinkBlocklistManager.kt:143 — app/src/main/java/com/celzero/bravedns/service/RethinkBlocklistManager.kt:143-150 | app/src/main/java/com/celzero/bravedns/service/RethinkBlocklistManager.kt:222-229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/service/RethinkBlocklistManager.kt:143` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/celzero/bravedns/service/RethinkBlocklistManager.kt:221` calls `bufferedReader`, `readText` and `app/src/main/java/com/celzero/bravedns/service/RethinkBlocklistManager.kt:142` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/ConnectionCheckActivity.kt:56 — app/src/main/java/com/celzero/bravedns/ui/activity/ConnectionCheckActivity.kt:56-63 | app/src/main/java/com/celzero/bravedns/ui/activity/PingTestActivity.kt:81-88 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/FirewallAppFilterBottomSheet.kt:163 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/FirewallAppFilterBottomSheet.kt:163-170 | app/src/main/java/com/celzero/bravedns/ui/fragment/ConnectionTrackerFragment.kt:394-401 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/FirewallAppFilterBottomSheet.kt:163` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/LocalBlocklistsBottomSheet.kt:248 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/LocalBlocklistsBottomSheet.kt:248-255 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/LocalBlocklistsBottomSheet.kt:262-269 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/LocalBlocklistsBottomSheet.kt:248` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/DnsLogFragment.kt:208 — app/src/main/java/com/celzero/bravedns/ui/fragment/DnsLogFragment.kt:208-215 | app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkLogFragment.kt:125-132 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/fragment/DnsLogFragment.kt:208` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:513 — app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:513-520 | app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt:497-504 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt` and `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:513` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/ServerSelectionFragment.kt:3340 — app/src/main/java/com/celzero/bravedns/ui/fragment/ServerSelectionFragment.kt:3340-3347 | app/src/main/java/com/celzero/bravedns/ui/fragment/ServerSelectionFragment.kt:3443-3451 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/fragment/ServerSelectionFragment.kt:3340` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (8 lines × 2) REDACTED:69 — REDACTED:69-76 | app/src/website/java/com/celzero/bravedns/adapter/GooglePlaySubsAdapter.kt:69-76 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/adapter/GooglePlaySubsAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1101 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1101-1108 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1101-1108 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1101` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) REDACTED:1699 — REDACTED:1699-1706 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:1699-1706 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) app/src/play/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt:476 — app/src/play/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt:476-483 | app/src/website/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt:476-483 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt` and `app/src/website/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 325 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) app/src/play/java/com/celzero/bravedns/iab/QueryUtils.kt:136 — app/src/play/java/com/celzero/bravedns/iab/QueryUtils.kt:136-143 | app/src/website/java/com/celzero/bravedns/iab/QueryUtils.kt:136-143 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/QueryUtils.kt` and `app/src/website/java/com/celzero/bravedns/iab/QueryUtils.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/DomainConnectionsAdapter.kt:157 — app/src/main/java/com/celzero/bravedns/adapter/DomainConnectionsAdapter.kt:157-164 | app/src/main/java/com/celzero/bravedns/adapter/WgNwStatsAdapter.kt:186-193 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:267 — app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:267-274 | app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt:277-284 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 195 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) app/src/main/java/com/celzero/bravedns/service/BraveTileService.kt:96 — app/src/main/java/com/celzero/bravedns/service/BraveTileService.kt:96-103 | app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:866-873 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/AppDomainRulesBottomSheet.kt:294 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/AppDomainRulesBottomSheet.kt:294-301 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/AppIpRulesBottomSheet.kt:329-336 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/AppDomainRulesBottomSheet.kt` and `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/AppIpRulesBottomSheet.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/AppDomainRulesBottomSheet.kt:303 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/AppDomainRulesBottomSheet.kt:303-310 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/AppIpRulesBottomSheet.kt:338-345 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/AppDomainRulesBottomSheet.kt` and `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/AppIpRulesBottomSheet.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/AppDomainRulesBottomSheet.kt:312 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/AppDomainRulesBottomSheet.kt:312-319 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/AppIpRulesBottomSheet.kt:347-354 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/AppDomainRulesBottomSheet.kt` and `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/AppIpRulesBottomSheet.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:454 — app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:454-461 | app/src/main/java/com/celzero/bravedns/ui/fragment/ServerSelectionFragment.kt:4029-4036 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:490 — app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:490-497 | app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt:471-478 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt` and `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt:482` calls `repeatOnLifecycle` and `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:501` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:545 — app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:545-552 | app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt:525-532 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt` and `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:588 — app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:588-595 | app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt:597-604 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt` and `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • + 13 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×35
  • Duplicated block (9 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/CustomDomainAdapter.kt:204 — app/src/main/java/com/celzero/bravedns/adapter/CustomDomainAdapter.kt:204-212 | app/src/main/java/com/celzero/bravedns/ui/fragment/CustomDomainFragment.kt:264-272 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/CustomDomainAdapter.kt:204` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/celzero/bravedns/adapter/CustomDomainAdapter.kt:213` calls `vv` and `app/src/main/java/com/celzero/bravedns/ui/fragment/CustomDomainFragment.kt:273` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:181 — app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:181-189 | app/src/main/java/com/celzero/bravedns/adapter/RemoteAdvancedViewAdapter.kt:182-190 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/RemoteAdvancedViewAdapter.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:181` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `filetag` to `RethinkLocalFileTag` in one and `RethinkRemoteFileTag` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/PingTestActivity.kt:217 — app/src/main/java/com/celzero/bravedns/ui/activity/PingTestActivity.kt:217-225 | app/src/main/java/com/celzero/bravedns/ui/activity/PingTestActivity.kt:236-244 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/activity/PingTestActivity.kt:217` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:644 — app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:644-652 | app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt:637-645 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:936 — app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:936-944 | app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:1303-1311 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) REDACTED:327 — REDACTED:327-335 | app/src/website/java/com/celzero/bravedns/adapter/GooglePlaySubsAdapter.kt:327-335 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/adapter/GooglePlaySubsAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:213 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:213-221 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:213-221 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 2) REDACTED:3489 — REDACTED:3489-3497 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3489-3497 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 2) app/src/play/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt:216 — app/src/play/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt:216-224 | app/src/website/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt:216-224 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt` and `app/src/website/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 185 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt:216` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:128 — app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:128-136 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt:150-158 — before extracting anything, compare `app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt` and `app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 189 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:128` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt:148` calls `getProxyIdsForApp`, `contains`, `getOrDefault` and `app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:127` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:185 — app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:185-193 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt:210-219 — before extracting anything, compare `app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt` and `app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 189 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:185` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/ProxyScreen.kt:329 — app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/ProxyScreen.kt:329-337 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnCommon.kt:167-175 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/ProxyScreen.kt:329` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) app/src/main/java/com/celzero/bravedns/database/ConnectionTracker.kt:88 — app/src/main/java/com/celzero/bravedns/database/ConnectionTracker.kt:88-96 | app/src/main/java/com/celzero/bravedns/database/RethinkLog.kt:86-94 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/database/ConnectionTracker.kt` and `app/src/main/java/com/celzero/bravedns/database/RethinkLog.kt` as WHOLE FILES: 88% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) app/src/main/java/com/celzero/bravedns/database/ConnectionTracker.kt:98 — app/src/main/java/com/celzero/bravedns/database/ConnectionTracker.kt:98-106 | app/src/main/java/com/celzero/bravedns/database/RethinkLog.kt:96-104 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/database/ConnectionTracker.kt` and `app/src/main/java/com/celzero/bravedns/database/RethinkLog.kt` as WHOLE FILES: 88% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnHopManager.kt:235 — app/src/main/java/com/celzero/bravedns/rpnproxy/RpnHopManager.kt:235-243 | app/src/main/java/com/celzero/bravedns/wireguard/WgHopManager.kt:237-245 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/rpnproxy/RpnHopManager.kt` and `app/src/main/java/com/celzero/bravedns/wireguard/WgHopManager.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt:772 — app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt:772-780 | app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt:923-931 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/FirewallAppFilterBottomSheet.kt:217 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/FirewallAppFilterBottomSheet.kt:217-225 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/RethinkPlusFilterBottomSheet.kt:145-153 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:535 — app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:535-543 | app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt:515-523 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt` and `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) app/src/main/java/com/celzero/bravedns/viewmodel/RethinkLocalFileTagViewModel.kt:76 — app/src/main/java/com/celzero/bravedns/viewmodel/RethinkLocalFileTagViewModel.kt:76-84 | app/src/main/java/com/celzero/bravedns/viewmodel/RethinkRemoteFileTagViewModel.kt:79-87 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/viewmodel/RethinkLocalFileTagViewModel.kt` and `app/src/main/java/com/celzero/bravedns/viewmodel/RethinkRemoteFileTagViewModel.kt` as WHOLE FILES: 86% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) REDACTED:243 — REDACTED:243-251 | app/src/website/java/com/celzero/bravedns/adapter/GooglePlaySubsAdapter.kt:243-251 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/adapter/GooglePlaySubsAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) REDACTED:273 — REDACTED:273-281 | app/src/website/java/com/celzero/bravedns/adapter/GooglePlaySubsAdapter.kt:273-281 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/adapter/GooglePlaySubsAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1559 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1559-1567 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1559-1567 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) app/src/play/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt:134 — app/src/play/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt:134-142 | app/src/website/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt:134-142 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt` and `app/src/website/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) app/src/play/java/com/celzero/bravedns/iab/DeviceNotRegisteredNotifier.kt:134 — app/src/play/java/com/celzero/bravedns/iab/DeviceNotRegisteredNotifier.kt:134-142 | app/src/website/java/com/celzero/bravedns/iab/DeviceNotRegisteredNotifier.kt:134-142 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/DeviceNotRegisteredNotifier.kt` and `app/src/website/java/com/celzero/bravedns/iab/DeviceNotRegisteredNotifier.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) REDACTED:3351 — REDACTED:3351-3359 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3351-3359 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • + 10 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×34
  • Duplicated block (10 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:183 — app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:183-192 | app/src/main/java/com/celzero/bravedns/adapter/RethinkLogAdapter.kt:111-120 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/RethinkLogAdapter.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 225 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/celzero/bravedns/adapter/RethinkLogAdapter.kt:107` calls `displaySummaryDetails` and `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:182` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/CustomDomainAdapter.kt:182 — app/src/main/java/com/celzero/bravedns/adapter/CustomDomainAdapter.kt:182-191 | app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:1733-1742 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:85 — app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:85-94 | app/src/main/java/com/celzero/bravedns/adapter/RemoteAdvancedViewAdapter.kt:86-95 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/RemoteAdvancedViewAdapter.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `filetag` to `RethinkLocalFileTag` in one and `RethinkRemoteFileTag` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (10 lines × 2) app/src/main/java/com/celzero/bravedns/ui/HomeScreenActivity.kt:250 — app/src/main/java/com/celzero/bravedns/ui/HomeScreenActivity.kt:250-259 | app/src/main/java/com/celzero/bravedns/ui/activity/MiscSettingsActivity.kt:1180-1189 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/HomeScreenActivity.kt:250` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/celzero/bravedns/ui/HomeScreenActivity.kt:260` calls `setUserId` and `app/src/main/java/com/celzero/bravedns/ui/activity/MiscSettingsActivity.kt:1190` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/AppLockActivity.kt:72 — app/src/main/java/com/celzero/bravedns/ui/activity/AppLockActivity.kt:72-81 | app/src/main/java/com/celzero/bravedns/ui/activity/ConfigureRethinkBasicActivity.kt:58-67 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt:86 — app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt:86-95 | app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseIpLogsActivity.kt:85-94 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt` and `app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseIpLogsActivity.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseIpLogsActivity.kt:96` calls `getBooleanExtra` and `app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt:97` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/CustomerSupportActivity.kt:121 — app/src/main/java/com/celzero/bravedns/ui/activity/CustomerSupportActivity.kt:121-130 | app/src/main/java/com/celzero/bravedns/ui/activity/PurchaseHistoryActivity.kt:74-83 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) app/src/main/java/com/celzero/bravedns/ui/adapter/AppActivityAdapter.kt:203 — app/src/main/java/com/celzero/bravedns/ui/adapter/AppActivityAdapter.kt:203-212 | app/src/main/java/com/celzero/bravedns/ui/adapter/AppActivityAdapter.kt:219-228 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/adapter/AppActivityAdapter.kt:203` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/LogActivityIntervalBottomSheet.kt:136 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/LogActivityIntervalBottomSheet.kt:136-145 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/RpnLogActivityIntervalBottomSheet.kt:132-141 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/LogActivityIntervalBottomSheet.kt:136` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/CustomDomainFragment.kt:251 — app/src/main/java/com/celzero/bravedns/ui/fragment/CustomDomainFragment.kt:251-260 | app/src/main/java/com/celzero/bravedns/ui/fragment/CustomIpFragment.kt:256-265 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/fragment/CustomDomainFragment.kt` and `app/src/main/java/com/celzero/bravedns/ui/fragment/CustomIpFragment.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:175 — app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:175-184 | app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt:154-163 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt` and `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:175` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/SummaryStatisticsFragment.kt:244 — app/src/main/java/com/celzero/bravedns/ui/fragment/SummaryStatisticsFragment.kt:244-253 | app/src/main/java/com/celzero/bravedns/ui/fragment/WgNwStatsFragment.kt:162-171 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/fragment/SummaryStatisticsFragment.kt:244` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) app/src/play/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt:198 — app/src/play/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt:198-207 | app/src/website/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt:198-207 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt` and `app/src/website/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 185 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:435 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:435-444 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:435-444 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:458 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:458-467 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:458-467 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) app/src/tv/java/com/celzero/bravedns/tv/ui/dns/OdohAddScreen.kt:110 — app/src/tv/java/com/celzero/bravedns/tv/ui/dns/OdohAddScreen.kt:110-119 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgImportScreen.kt:189-198 — before extracting anything, compare `app/src/tv/java/com/celzero/bravedns/tv/ui/dns/OdohAddScreen.kt` and `app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgImportScreen.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/dns/OdohAddScreen.kt:110` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 2) app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgImportScreen.kt:273 — app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgImportScreen.kt:273-282 | app/src/tv/java/com/celzero/bravedns/tv/ui/settings/PauseVpnScreen.kt:221-230 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgImportScreen.kt:273` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:231 — app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:231-240 | app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt:241-250 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 195 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `com.celzero.bravedns.wireguard.Config` in one and `Config` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (10 lines × 2) app/src/main/java/com/celzero/bravedns/database/AppDatabase.kt:215 — app/src/main/java/com/celzero/bravedns/database/AppDatabase.kt:215-224 | app/src/main/java/com/celzero/bravedns/database/LogDatabase.kt:134-143 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/celzero/bravedns/database/AppDatabase.kt:207` calls `i` and `app/src/main/java/com/celzero/bravedns/database/LogDatabase.kt:126` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/PurchaseHistoryActivity.kt:102 — app/src/main/java/com/celzero/bravedns/ui/activity/PurchaseHistoryActivity.kt:102-111 | app/src/main/java/com/celzero/bravedns/ui/activity/ServerOrderHistoryActivity.kt:106-115 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:1547 — app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:1547-1556 | app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt:1332-1342 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) app/src/main/java/com/celzero/bravedns/ui/dialog/RpnSsidDialog.kt:179 — app/src/main/java/com/celzero/bravedns/ui/dialog/RpnSsidDialog.kt:179-188 | app/src/main/java/com/celzero/bravedns/ui/dialog/WgSsidDialog.kt:117-126 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/dialog/RpnSsidDialog.kt` and `app/src/main/java/com/celzero/bravedns/ui/dialog/WgSsidDialog.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/HomeScreenFragment.kt:604 — app/src/main/java/com/celzero/bravedns/ui/fragment/HomeScreenFragment.kt:604-613 | app/src/main/java/com/celzero/bravedns/ui/fragment/ServerSelectionFragment.kt:2508-2517 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) REDACTED:283 — REDACTED:283-292 | app/src/website/java/com/celzero/bravedns/adapter/GooglePlaySubsAdapter.kt:283-292 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/adapter/GooglePlaySubsAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) REDACTED:274 — REDACTED:274-283 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:274-283 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • + 9 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×33
  • Duplicated block (7 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:537 — app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:537-543 | app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt:634-640 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:537` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:1012 — app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:1012-1018 | app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:1058-1064 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:1056` calls `isNetworkCellular` and `app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:1010` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) app/src/main/java/com/celzero/bravedns/service/TcpProxyHelper.kt:156 — app/src/main/java/com/celzero/bravedns/service/TcpProxyHelper.kt:156-162 | app/src/main/java/com/celzero/bravedns/service/TcpProxyHelper.kt:199-205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/service/TcpProxyHelper.kt:156` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt:432 — app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt:432-438 | app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseIpLogsActivity.kt:408-414 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt` and `app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseIpLogsActivity.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt:432` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/LocalBlocklistsBottomSheet.kt:376 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/LocalBlocklistsBottomSheet.kt:376-382 | app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkBlocklistFragment.kt:467-473 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/LocalBlocklistsBottomSheet.kt:376` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) app/src/main/java/com/celzero/bravedns/ui/dialog/RpnSsidDialog.kt:305 — app/src/main/java/com/celzero/bravedns/ui/dialog/RpnSsidDialog.kt:305-311 | app/src/main/java/com/celzero/bravedns/ui/dialog/WgSsidDialog.kt:283-289 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/dialog/RpnSsidDialog.kt` and `app/src/main/java/com/celzero/bravedns/ui/dialog/WgSsidDialog.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/dialog/RpnSsidDialog.kt:305` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1152 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1152-1158 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1152-1158 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1152` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:480 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:480-486 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:480-486 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:480` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:382 — app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:382-388 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt:409-415 — before extracting anything, compare `app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt` and `app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 189 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:382` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:489 — app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:489-495 | app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt:406-412 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 195 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:152 — app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:152-158 | app/src/main/java/com/celzero/bravedns/adapter/RemoteAdvancedViewAdapter.kt:153-159 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/RemoteAdvancedViewAdapter.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/LocalSimpleViewAdapter.kt:93 — app/src/main/java/com/celzero/bravedns/adapter/LocalSimpleViewAdapter.kt:93-99 | app/src/main/java/com/celzero/bravedns/adapter/RemoteSimpleViewAdapter.kt:92-98 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/LocalSimpleViewAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/RemoteSimpleViewAdapter.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) app/src/main/java/com/celzero/bravedns/service/DomainRulesManager.kt:69 — app/src/main/java/com/celzero/bravedns/service/DomainRulesManager.kt:69-75 | app/src/main/java/com/celzero/bravedns/service/IpRulesManager.kt:77-83 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/AppIpRulesBottomSheet.kt:289 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/AppIpRulesBottomSheet.kt:289-296 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/CustomIpRulesBtmSheet.kt:377-383 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/BugReportFilesBottomSheet.kt:451 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/BugReportFilesBottomSheet.kt:451-457 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/PcapFilesBottomSheet.kt:346-352 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/CustomDomainRulesBtmSheet.kt:294 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/CustomDomainRulesBtmSheet.kt:294-300 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/CustomIpRulesBtmSheet.kt:351-357 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/CustomDomainRulesBtmSheet.kt` and `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/CustomIpRulesBtmSheet.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/LogActivityIntervalBottomSheet.kt:384 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/LogActivityIntervalBottomSheet.kt:384-390 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/RpnLogActivityIntervalBottomSheet.kt:260-266 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) app/src/main/java/com/celzero/bravedns/ui/dialog/RpnSsidDialog.kt:190 — app/src/main/java/com/celzero/bravedns/ui/dialog/RpnSsidDialog.kt:190-197 | app/src/main/java/com/celzero/bravedns/ui/dialog/WgSsidDialog.kt:128-134 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/dialog/RpnSsidDialog.kt` and `app/src/main/java/com/celzero/bravedns/ui/dialog/WgSsidDialog.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:1181 — app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:1181-1187 | app/src/main/java/com/celzero/bravedns/util/ProcessInfoCollector.kt:213-219 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/SummaryStatisticsFragment.kt:520 — app/src/main/java/com/celzero/bravedns/ui/fragment/SummaryStatisticsFragment.kt:520-526 | app/src/main/java/com/celzero/bravedns/ui/fragment/WgNwStatsFragment.kt:208-214 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/SummaryStatisticsFragment.kt:528 — app/src/main/java/com/celzero/bravedns/ui/fragment/SummaryStatisticsFragment.kt:528-534 | app/src/main/java/com/celzero/bravedns/ui/fragment/WgNwStatsFragment.kt:216-222 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1325 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1325-1331 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1325-1331 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1391 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1391-1397 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1391-1397 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1400 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1400-1406 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1400-1406 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) REDACTED:472 — REDACTED:472-478 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:472-478 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • + 8 more in this group — see findings.md.
DM4 · Rich vs anemic model · Anemic entity · ×31
  • Anemic entity: AlertRegistry app/src/main/java/com/celzero/bravedns/database/AlertRegistry.kt:22 — `AlertRegistry` is an aggregate/entity with 15 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: AppInfo app/src/main/java/com/celzero/bravedns/database/AppInfo.kt:28 — `AppInfo` is an aggregate/entity with 19 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: ConnectionTracker app/src/main/java/com/celzero/bravedns/database/ConnectionTracker.kt:36 — `ConnectionTracker` is an aggregate/entity with 23 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: ConsoleLog app/src/main/java/com/celzero/bravedns/database/ConsoleLog.kt:22 — `ConsoleLog` is an aggregate/entity with 4 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: CountryConfig app/src/main/java/com/celzero/bravedns/database/CountryConfig.kt:34 — `CountryConfig` is an aggregate/entity with 27 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: CustomDomain app/src/main/java/com/celzero/bravedns/database/CustomDomain.kt:26 — `CustomDomain` is an aggregate/entity with 10 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: DnsCryptEndpoint app/src/main/java/com/celzero/bravedns/database/DnsCryptEndpoint.kt:23 — `DnsCryptEndpoint` is an aggregate/entity with 8 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: DnsCryptRelayEndpoint app/src/main/java/com/celzero/bravedns/database/DnsCryptRelayEndpoint.kt:23 — `DnsCryptRelayEndpoint` is an aggregate/entity with 8 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: DnsLog app/src/main/java/com/celzero/bravedns/database/DnsLog.kt:45 — `DnsLog` is an aggregate/entity with 31 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: DnsProxyEndpoint app/src/main/java/com/celzero/bravedns/database/DnsProxyEndpoint.kt:25 — `DnsProxyEndpoint` is an aggregate/entity with 10 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: DoHEndpoint app/src/main/java/com/celzero/bravedns/database/DoHEndpoint.kt:24 — `DoHEndpoint` is an aggregate/entity with 10 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: DoTEndpoint app/src/main/java/com/celzero/bravedns/database/DoTEndpoint.kt:24 — `DoTEndpoint` is an aggregate/entity with 9 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: Event app/src/main/java/com/celzero/bravedns/database/Event.kt:41 — `Event` is an aggregate/entity with 8 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: IpInfo app/src/main/java/com/celzero/bravedns/database/IpInfo.kt:23 — `IpInfo` is an aggregate/entity with 9 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: LocalBlocklistPacksMap app/src/main/java/com/celzero/bravedns/database/LocalBlocklistPacksMap.kt:21 — `LocalBlocklistPacksMap` is an aggregate/entity with 4 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: ODoHEndpoint app/src/main/java/com/celzero/bravedns/database/ODoHEndpoint.kt:24 — `ODoHEndpoint` is an aggregate/entity with 10 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: ProxyApplicationMapping app/src/main/java/com/celzero/bravedns/database/ProxyApplicationMapping.kt:24 — `ProxyApplicationMapping` is an aggregate/entity with 6 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: ProxyEndpoint app/src/main/java/com/celzero/bravedns/database/ProxyEndpoint.kt:24 — `ProxyEndpoint` is an aggregate/entity with 14 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: RemoteBlocklistPacksMap app/src/main/java/com/celzero/bravedns/database/RemoteBlocklistPacksMap.kt:21 — `RemoteBlocklistPacksMap` is an aggregate/entity with 4 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: RethinkDnsEndpoint app/src/main/java/com/celzero/bravedns/database/RethinkDnsEndpoint.kt:23 — `RethinkDnsEndpoint` is an aggregate/entity with 9 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: RethinkLocalFileTag app/src/main/java/com/celzero/bravedns/database/RethinkLocalFileTag.kt:23 — `RethinkLocalFileTag` is an aggregate/entity with 12 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: RethinkLog app/src/main/java/com/celzero/bravedns/database/RethinkLog.kt:34 — `RethinkLog` is an aggregate/entity with 22 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: RethinkRemoteFileTag app/src/main/java/com/celzero/bravedns/database/RethinkRemoteFileTag.kt:22 — `RethinkRemoteFileTag` is an aggregate/entity with 12 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: RpnLog app/src/main/java/com/celzero/bravedns/database/RpnLog.kt:24 — `RpnLog` is an aggregate/entity with 4 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • Anemic entity: RpnProxy app/src/main/java/com/celzero/bravedns/database/RpnProxy.kt:7 — `RpnProxy` is an aggregate/entity with 12 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
  • + 6 more in this group — see findings.md.
D17 · Explicit Debt · FixmeComment · ×30
  • FixmeComment app/src/main/java/com/celzero/bravedns/NonStoreAppUpdater.kt:87 — // FIXME move to NTP — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt:201 — // fixme: find a better way to handle this — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:289 — // fixme: find a better way to handle this — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/com/celzero/bravedns/adapter/CustomDomainAdapter.kt:318 — // fixme: same as extractHost in CustomDomainFragment, should be moved to a common place — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/com/celzero/bravedns/data/AppConfig.kt:187 — // fixme: remove the type RETHINK_REMOTE and merge it with type DOH — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/com/celzero/bravedns/data/AppConfig.kt:1156 — // FIXME: tunnel does not support both http and socks5 at once. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/com/celzero/bravedns/database/CustomIp.kt:47 — // fixme: Is this needed in database as column? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/com/celzero/bravedns/database/AppDatabase.kt:1611 — // fixme: revisit the links to remove the pragma for each table — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/com/celzero/bravedns/glide/FavIconDownloader.kt:199 — // FIXME: add metadata instead of boolean — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt:2115 — // fixme: this is not expected to happen, should show a notification? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:72 — // fixme: see if these locks can be removed/made into single transaction — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/com/celzero/bravedns/service/VpnController.kt:60 — // FIXME: Publish VpnState through this live-data to relieve direct access — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/com/celzero/bravedns/service/TunFlowManager.kt:325 — // fixme: see flow() — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/com/celzero/bravedns/service/TunFlowManager.kt:544 — // fixme: see flow() — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/com/celzero/bravedns/service/TunFlowManager.kt:380 — // fixme: decide a behaviour on what uid to use when the firewall rules are — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/com/celzero/bravedns/service/NetLogTracker.kt:204 — // fixme: should intend to only write the logs to database. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/com/celzero/bravedns/service/DomainRulesManager.kt:46 — // fixme: find a better way to handle trusted domains without using two data structures — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:1103 — // fixme: using below code has issues when private networks are excluded, return null for now — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:1595 — // FIXME: update just that dns proxy, not the entire tunnel — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:2972 — // fixme: should the string need to be changed based on failure type? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:3234 — // fixme: this code doesn't seem to be doing anything, because route4 and route6 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:3522 — // fixme: see if the ranges overlap with the default route — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/com/celzero/bravedns/ui/HomeScreenActivity.kt:468 — // fixme: find a cleaner way to implement this, move this to some other place — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/com/celzero/bravedns/ui/HomeScreenActivity.kt:523 — // FIXME: remove this post v054 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment app/src/main/java/com/celzero/bravedns/ui/HomeScreenActivity.kt:538 — // FIXME - Move it to Android's built-in WorkManager — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • + 5 more in this group — see findings.md.
DM5 · Encapsulated state · Mutable entity · ×30
  • Mutable entity: AlertRegistry app/src/main/java/com/celzero/bravedns/database/AlertRegistry.kt:22 — `AlertRegistry` exposes publicly writable state (id, alertTitle, alertType, alertCount, alertTime, alertMessage, and 9 more).
  • Mutable entity: AppInfo app/src/main/java/com/celzero/bravedns/database/AppInfo.kt:28 — `AppInfo` exposes publicly writable state (packageName, appName, uid, isSystemApp, firewallStatus, appCategory, and 13 more).
  • Mutable entity: ConnectionTracker app/src/main/java/com/celzero/bravedns/database/ConnectionTracker.kt:36 — `ConnectionTracker` exposes publicly writable state (id, appName, uid, packageName, usrId, ipAddress, and 17 more).
  • Mutable entity: ConsoleLog app/src/main/java/com/celzero/bravedns/database/ConsoleLog.kt:22 — `ConsoleLog` exposes publicly writable state (id).
  • Mutable entity: CountryConfig app/src/main/java/com/celzero/bravedns/database/CountryConfig.kt:34 — `CountryConfig` exposes publicly writable state (isActive, isEnabled, catchAll, lockdown, mobileOnly, ssidBased, and 3 more).
  • Mutable entity: CustomDomain app/src/main/java/com/celzero/bravedns/database/CustomDomain.kt:26 — `CustomDomain` exposes publicly writable state (domain, uid, ips, status, type, proxyId, and 4 more).
  • Mutable entity: CustomIp app/src/main/java/com/celzero/bravedns/database/CustomIp.kt:34 — `CustomIp` exposes publicly writable state (uid, ipAddress, port, protocol, isActive, proxyId, and 5 more).
  • Mutable entity: DnsCryptEndpoint app/src/main/java/com/celzero/bravedns/database/DnsCryptEndpoint.kt:23 — `DnsCryptEndpoint` exposes publicly writable state (id, dnsCryptName, dnsCryptURL, dnsCryptExplanation, isSelected, isCustom, and 2 more).
  • Mutable entity: DnsCryptRelayEndpoint app/src/main/java/com/celzero/bravedns/database/DnsCryptRelayEndpoint.kt:23 — `DnsCryptRelayEndpoint` exposes publicly writable state (id, dnsCryptRelayName, dnsCryptRelayURL, dnsCryptRelayExplanation, isSelected, isCustom, and 2 more).
  • Mutable entity: DnsLog app/src/main/java/com/celzero/bravedns/database/DnsLog.kt:45 — `DnsLog` exposes publicly writable state (id, uid, appName, packageName, queryStr, time, and 25 more).
  • Mutable entity: DnsProxyEndpoint app/src/main/java/com/celzero/bravedns/database/DnsProxyEndpoint.kt:25 — `DnsProxyEndpoint` exposes publicly writable state (id, proxyName, proxyType, proxyAppName, proxyIP, proxyPort, and 4 more).
  • Mutable entity: DoHEndpoint app/src/main/java/com/celzero/bravedns/database/DoHEndpoint.kt:24 — `DoHEndpoint` exposes publicly writable state (id, dohName, dohURL, dohIp, dohExplanation, isSelected, and 4 more).
  • Mutable entity: DoTEndpoint app/src/main/java/com/celzero/bravedns/database/DoTEndpoint.kt:24 — `DoTEndpoint` exposes publicly writable state (id, name, url, desc, isSelected, isCustom, and 3 more).
  • Mutable entity: IpInfo app/src/main/java/com/celzero/bravedns/database/IpInfo.kt:23 — `IpInfo` exposes publicly writable state (ip, asn, asName, asDomain, countryCode, country, and 3 more).
  • Mutable entity: LocalBlocklistPacksMap app/src/main/java/com/celzero/bravedns/database/LocalBlocklistPacksMap.kt:21 — `LocalBlocklistPacksMap` exposes publicly writable state (pack, level, blocklistIds, group).
  • Mutable entity: ODoHEndpoint app/src/main/java/com/celzero/bravedns/database/ODoHEndpoint.kt:24 — `ODoHEndpoint` exposes publicly writable state (id, name, proxy, resolver, proxyIps, desc, and 4 more).
  • Mutable entity: ProxyApplicationMapping app/src/main/java/com/celzero/bravedns/database/ProxyApplicationMapping.kt:24 — `ProxyApplicationMapping` exposes publicly writable state (uid, packageName, proxyId, appName, proxyName, isActive).
  • Mutable entity: ProxyEndpoint app/src/main/java/com/celzero/bravedns/database/ProxyEndpoint.kt:24 — `ProxyEndpoint` exposes publicly writable state (id, proxyName, proxyMode, proxyType, proxyAppName, proxyIP, and 8 more).
  • Mutable entity: RemoteBlocklistPacksMap app/src/main/java/com/celzero/bravedns/database/RemoteBlocklistPacksMap.kt:21 — `RemoteBlocklistPacksMap` exposes publicly writable state (pack, level, blocklistIds, group).
  • Mutable entity: RethinkDnsEndpoint app/src/main/java/com/celzero/bravedns/database/RethinkDnsEndpoint.kt:23 — `RethinkDnsEndpoint` exposes publicly writable state (name, url, uid, desc, isActive, isCustom, and 3 more).
  • Mutable entity: RethinkLocalFileTag app/src/main/java/com/celzero/bravedns/database/RethinkLocalFileTag.kt:23 — `RethinkLocalFileTag` exposes publicly writable state (value, uname, vname, group, subg, url, and 6 more).
  • Mutable entity: RethinkLog app/src/main/java/com/celzero/bravedns/database/RethinkLog.kt:34 — `RethinkLog` exposes publicly writable state (id, appName, uid, usrId, ipAddress, port, and 16 more).
  • Mutable entity: RethinkRemoteFileTag app/src/main/java/com/celzero/bravedns/database/RethinkRemoteFileTag.kt:22 — `RethinkRemoteFileTag` exposes publicly writable state (value, uname, vname, group, subg, url, and 6 more).
  • Mutable entity: RpnLog app/src/main/java/com/celzero/bravedns/database/RpnLog.kt:24 — `RpnLog` exposes publicly writable state (id).
  • Mutable entity: RpnProxy app/src/main/java/com/celzero/bravedns/database/RpnProxy.kt:7 — `RpnProxy` exposes publicly writable state (id, name, configPath, serverResPath, isActive, isLockdown, and 6 more).
  • + 5 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×27
  • Duplicated block (13 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt:320 — app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt:320-332 | app/src/main/java/com/celzero/bravedns/adapter/RethinkLogAdapter.kt:282-294 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/RethinkLogAdapter.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 108 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt:320` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (13 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:442 — app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:442-454 | app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:578-590 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 168 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) app/src/main/java/com/celzero/bravedns/database/RethinkLocalFileTag.kt:66 — app/src/main/java/com/celzero/bravedns/database/RethinkLocalFileTag.kt:66-78 | app/src/main/java/com/celzero/bravedns/database/RethinkRemoteFileTag.kt:65-77 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/database/RethinkLocalFileTag.kt` and `app/src/main/java/com/celzero/bravedns/database/RethinkRemoteFileTag.kt` as WHOLE FILES: 92% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt:176 — app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt:176-188 | app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigEditorActivity.kt:67-79 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (13 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/OrbotBottomSheet.kt:165 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/OrbotBottomSheet.kt:165-177 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/OrbotBottomSheet.kt:187-199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/OrbotBottomSheet.kt:165` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/OrbotBottomSheet.kt:211 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/OrbotBottomSheet.kt:211-223 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/OrbotBottomSheet.kt:233-245 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/OrbotBottomSheet.kt:211` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/OrbotBottomSheet.kt:257 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/OrbotBottomSheet.kt:257-269 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/OrbotBottomSheet.kt:279-291 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/OrbotBottomSheet.kt:257` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ProxyCountriesBtmSheet.kt:110 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ProxyCountriesBtmSheet.kt:110-122 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/WireguardListBtmSheet.kt:113-125 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/DohListFragment.kt:189 — app/src/main/java/com/celzero/bravedns/ui/fragment/DohListFragment.kt:189-201 | app/src/main/java/com/celzero/bravedns/ui/fragment/ODoHListFragment.kt:192-204 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/fragment/DohListFragment.kt` and `app/src/main/java/com/celzero/bravedns/ui/fragment/ODoHListFragment.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/fragment/DohListFragment.kt:189` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:599 — app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:599-611 | app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt:608-620 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt` and `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:599` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:346 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:346-358 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:346-358 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) REDACTED:2602 — REDACTED:2602-2614 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:2602-2614 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) REDACTED:3748 — REDACTED:3748-3760 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3748-3760 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) REDACTED:3774 — REDACTED:3774-3786 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3774-3786 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) app/src/play/java/com/celzero/bravedns/iab/QueryUtils.kt:99 — app/src/play/java/com/celzero/bravedns/iab/QueryUtils.kt:99-111 | app/src/website/java/com/celzero/bravedns/iab/QueryUtils.kt:99-111 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/QueryUtils.kt` and `app/src/website/java/com/celzero/bravedns/iab/QueryUtils.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:430 — app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:430-442 | app/src/website/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:430-442 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt` and `app/src/website/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 326 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:430` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:595 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:595-607 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:595-607 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) app/src/tv/java/com/celzero/bravedns/tv/ui/dns/OdohAddScreen.kt:208 — app/src/tv/java/com/celzero/bravedns/tv/ui/dns/OdohAddScreen.kt:208-220 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgImportScreen.kt:266-278 — before extracting anything, compare `app/src/tv/java/com/celzero/bravedns/tv/ui/dns/OdohAddScreen.kt` and `app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgImportScreen.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/dns/OdohAddScreen.kt:208` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/CustomDomainAdapter.kt:143 — app/src/main/java/com/celzero/bravedns/adapter/CustomDomainAdapter.kt:143-155 | app/src/main/java/com/celzero/bravedns/adapter/CustomIpAdapter.kt:145-157 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (13 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/EventsActivity.kt:118 — app/src/main/java/com/celzero/bravedns/ui/activity/EventsActivity.kt:118-130 | app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:133-145 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (13 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:1650 — app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:1650-1662 | app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt:1431-1443 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) REDACTED:1590 — REDACTED:1590-1602 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:1590-1602 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) app/src/play/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt:115 — app/src/play/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt:115-127 | app/src/website/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt:115-127 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt` and `app/src/website/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 103 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:97 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:97-109 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:97-109 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:605 — app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:605-617 | app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:605-617 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` and `app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 526 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • + 2 more in this group — see findings.md.
DM11 · Constructible invalid state · Constructible in an invalid state · ×27
  • Constructible in an invalid state: AlertRegistry app/src/main/java/com/celzero/bravedns/database/AlertRegistry.kt:49 — `AlertRegistry`'s public constructor takes `alertTitle`, `alertType`, `alertMessage`, `alertCategory`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `AlertRegistry` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: AppInfo app/src/main/java/com/celzero/bravedns/database/AppInfo.kt:95 — `AppInfo`'s public constructor takes `packageName`, `appName`, `appCategory`, `notes` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `AppInfo` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: ConsoleLog app/src/main/java/com/celzero/bravedns/database/ConsoleLog.kt:22 — `ConsoleLog`'s public constructor takes `message` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `ConsoleLog` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: CountryConfig app/src/main/java/com/celzero/bravedns/database/CountryConfig.kt:34 — `CountryConfig`'s public constructor takes `id`, `cc`, `name`, `address`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `CountryConfig` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: CustomDomain app/src/main/java/com/celzero/bravedns/database/CustomDomain.kt:73 — `CustomDomain`'s public constructor takes `domain`, `ips`, `proxyId`, `proxyCC` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `CustomDomain` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: DnsCryptEndpoint app/src/main/java/com/celzero/bravedns/database/DnsCryptEndpoint.kt:43 — `DnsCryptEndpoint`'s public constructor takes `dnsCryptName`, `dnsCryptURL`, `dnsCryptExplanation` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `DnsCryptEndpoint` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: DnsCryptRelayEndpoint app/src/main/java/com/celzero/bravedns/database/DnsCryptRelayEndpoint.kt:43 — `DnsCryptRelayEndpoint`'s public constructor takes `dnsCryptRelayName`, `dnsCryptRelayURL`, `dnsCryptRelayExplanation` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `DnsCryptRelayEndpoint` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: DnsProxyEndpoint app/src/main/java/com/celzero/bravedns/database/DnsProxyEndpoint.kt:47 — `DnsProxyEndpoint`'s public constructor takes `proxyName`, `proxyType`, `proxyAppName`, `proxyIP` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `DnsProxyEndpoint` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: DoHEndpoint app/src/main/java/com/celzero/bravedns/database/DoHEndpoint.kt:50 — `DoHEndpoint`'s public constructor takes `dohName`, `dohURL`, `dohIp`, `dohExplanation` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `DoHEndpoint` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: DoTEndpoint app/src/main/java/com/celzero/bravedns/database/DoTEndpoint.kt:48 — `DoTEndpoint`'s public constructor takes `name`, `url`, `desc` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `DoTEndpoint` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: Event app/src/main/java/com/celzero/bravedns/database/Event.kt:41 — `Event`'s public constructor takes `message`, `details` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `Event` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: LocalBlocklistPacksMap app/src/main/java/com/celzero/bravedns/database/LocalBlocklistPacksMap.kt:40 — `LocalBlocklistPacksMap`'s public constructor takes `pack`, `group` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `LocalBlocklistPacksMap` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: ODoHEndpoint app/src/main/java/com/celzero/bravedns/database/ODoHEndpoint.kt:50 — `ODoHEndpoint`'s public constructor takes `name`, `proxy`, `resolver`, `proxyIps`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `ODoHEndpoint` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: ProxyApplicationMapping app/src/main/java/com/celzero/bravedns/database/ProxyApplicationMapping.kt:46 — `ProxyApplicationMapping`'s public constructor takes `packageName`, `appName`, `proxyName`, `proxyId` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `ProxyApplicationMapping` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: ProxyEndpoint app/src/main/java/com/celzero/bravedns/database/ProxyEndpoint.kt:54 — `ProxyEndpoint`'s public constructor takes `proxyName`, `proxyType`, `proxyAppName`, `proxyIP`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `ProxyEndpoint` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: RemoteBlocklistPacksMap app/src/main/java/com/celzero/bravedns/database/RemoteBlocklistPacksMap.kt:40 — `RemoteBlocklistPacksMap`'s public constructor takes `pack`, `group` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `RemoteBlocklistPacksMap` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: RethinkDnsEndpoint app/src/main/java/com/celzero/bravedns/database/RethinkDnsEndpoint.kt:23 — `RethinkDnsEndpoint`'s public constructor takes `name`, `url`, `desc` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `RethinkDnsEndpoint` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: RethinkLocalFileTag app/src/main/java/com/celzero/bravedns/database/RethinkLocalFileTag.kt:52 — `RethinkLocalFileTag`'s public constructor takes `uname`, `vname`, `group`, `subg` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `RethinkLocalFileTag` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: RethinkRemoteFileTag app/src/main/java/com/celzero/bravedns/database/RethinkRemoteFileTag.kt:51 — `RethinkRemoteFileTag`'s public constructor takes `uname`, `vname`, `group`, `subg` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `RethinkRemoteFileTag` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: RpnLog app/src/main/java/com/celzero/bravedns/database/RpnLog.kt:24 — `RpnLog`'s public constructor takes `message` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `RpnLog` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: RpnProxy app/src/main/java/com/celzero/bravedns/database/RpnProxy.kt:51 — `RpnProxy`'s public constructor takes `name`, `configPath`, `serverResPath`, `misc`, … as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `RpnProxy` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: SmartDnsEndpoint app/src/main/java/com/celzero/bravedns/database/SmartDnsEndpoint.kt:23 — `SmartDnsEndpoint`'s public constructor takes `dnsName`, `dnsExplanation` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `SmartDnsEndpoint` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: SubscriptionStateHistory app/src/main/java/com/celzero/bravedns/database/SubscriptionStateHistory.kt:25 — `SubscriptionStateHistory`'s public constructor takes `reason` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `SubscriptionStateHistory` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: TcpProxyEndpoint app/src/main/java/com/celzero/bravedns/database/TcpProxyEndpoint.kt:40 — `TcpProxyEndpoint`'s public constructor takes `name`, `token`, `url` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `TcpProxyEndpoint` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • Constructible in an invalid state: WgConfigFiles app/src/main/java/com/celzero/bravedns/database/WgConfigFiles.kt:67 — `WgConfigFiles`'s public constructor takes `name`, `configPath`, `serverResponse`, `ssids` as raw primitives, and neither of the two things that would make that safe was found. What was searched, so you can tell an absence from a miss: for VALIDATION, the constructor body was scanned for `throw`, `Guard.`, `Ensure.`, `ArgumentNullException`, `ArgumentException`, `CheckRule` or `Requires.` — a guard reached through a helper method those tokens do not name is not seen; for a FACTORY, only this type's OWN static members were read, and only names beginning `Create`, `Of`, `From`, `New` or `Build` — one inherited from a base type, one on a companion builder, or one called `Parse`, `Make` or `Rehydrate` is not seen. If either exists, this row is wrong. If neither does, a caller can build a `WgConfigFiles` that breaks the rules it exists to enforce, and every rule downstream then has to cope with a state the model said was impossible. Guard in the constructor, take value objects that validate themselves, or make the constructor private behind a `Create` that can refuse.
  • + 2 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×27
  • Swallowed exception (caught, then discarded) app/src/main/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt:793 — `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/celzero/bravedns/adapter/ODoHEndpointAdapter.kt:298 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/celzero/bravedns/adapter/DohEndpointAdapter.kt:293 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:294 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/celzero/bravedns/adapter/DnsLogAdapter.kt:540 — `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt:210 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:298 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:279 — `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/celzero/bravedns/backup/BackupHelper.kt:145 — `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/celzero/bravedns/customdownloader/RetrofitManager.kt:283 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/celzero/bravedns/database/ProxyApplicationMapping.kt:72 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/celzero/bravedns/database/CustomIp.kt:90 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/celzero/bravedns/database/CountryConfig.kt:163 — `catch (_: Throwable)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/celzero/bravedns/database/AppInfo.kt:134 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/celzero/bravedns/database/AppDatabase.kt:103 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/celzero/bravedns/database/AppDatabase.kt:1605 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt:2050 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt:2476 — `catch (e: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt:3112 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/celzero/bravedns/rpnproxy/StateMachineDatabaseSyncService.kt:281 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/celzero/bravedns/rpnproxy/StateMachineDatabaseSyncService.kt:306 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/celzero/bravedns/rpnproxy/StateMachineDatabaseSyncService.kt:327 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:1182 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:2567 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) app/src/main/java/com/celzero/bravedns/service/TunFlowManager.kt:793 — `catch (_: Exception)` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • + 2 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×26
  • Hotspot: app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:1543 — app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 in BraveVPNService.onSharedPreferenceChanged at line 1543. 7 of those changes were fix/bug commits, and the other 25 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt:1530 — app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in GoVpnAdapter.pauseAndResumeProxies at line 1530. 4 of those changes were fix/bug commits, and the other 22 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/celzero/bravedns/ui/fragment/HomeScreenFragment.kt app/src/main/java/com/celzero/bravedns/ui/fragment/HomeScreenFragment.kt:3551 — app/src/main/java/com/celzero/bravedns/ui/fragment/HomeScreenFragment.kt changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in HomeScreenFragment.syncDnsStatus at line 3551. 8 of those changes were fix/bug commits, and the other 23 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/ui/fragment/HomeScreenFragment.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:926 — REDACTED changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 70 in InAppBillingHandler.handlePurchaseInternal at line 926. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:926 — app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 70 in InAppBillingHandler.handlePurchaseInternal at line 926. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/celzero/bravedns/ui/fragment/ServerSelectionFragment.kt app/src/main/java/com/celzero/bravedns/ui/fragment/ServerSelectionFragment.kt:1108 — app/src/main/java/com/celzero/bravedns/ui/fragment/ServerSelectionFragment.kt changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in ServerSelectionFragment.initServers at line 1108. 6 of those changes were fix/bug commits, and the other 26 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/ui/fragment/ServerSelectionFragment.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:1162 — app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in RpnProxyManager.registerProxy at line 1162. 3 of those changes were fix/bug commits, and the other 14 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/celzero/bravedns/tunnel/TunDnsManager.kt app/src/main/java/com/celzero/bravedns/tunnel/TunDnsManager.kt:327 — app/src/main/java/com/celzero/bravedns/tunnel/TunDnsManager.kt changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in TunDnsManager.getTransportIdForDnsFirewallMode at line 327. 5 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/tunnel/TunDnsManager.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:995 — app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in RpnConfigDetailActivity.setupClickListeners at line 995. 2 of those changes were fix/bug commits, and the other 21 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/celzero/bravedns/ui/activity/CustomerSupportActivity.kt app/src/main/java/com/celzero/bravedns/ui/activity/CustomerSupportActivity.kt:263 — app/src/main/java/com/celzero/bravedns/ui/activity/CustomerSupportActivity.kt changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in CustomerSupportActivity.collectAndSend at line 263. 2 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/ui/activity/CustomerSupportActivity.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/celzero/bravedns/ui/activity/TunnelSettingsActivity.kt app/src/main/java/com/celzero/bravedns/ui/activity/TunnelSettingsActivity.kt:1186 — app/src/main/java/com/celzero/bravedns/ui/activity/TunnelSettingsActivity.kt changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in TunnelSettingsActivity.collectLockdownChecks at line 1186. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/ui/activity/TunnelSettingsActivity.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:2587 — app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in SubscriptionStateMachineV2.handlePaymentSuccessful at line 2587. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt:593 — app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in WireguardManager.getAllPossibleConfigIdsForApp at line 593. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:153 — app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in RethinkPlusDashboardFragment.populateBanner at line 153. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/celzero/bravedns/ui/activity/MiscSettingsActivity.kt app/src/main/java/com/celzero/bravedns/ui/activity/MiscSettingsActivity.kt:199 — app/src/main/java/com/celzero/bravedns/ui/activity/MiscSettingsActivity.kt changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in MiscSettingsActivity.initView at line 199. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/ui/activity/MiscSettingsActivity.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt:130 — app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in RethinkPlusManagePurchaseFragment.populateView at line 130. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:801 — app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in ProxySettingsActivity.showSocks5ProxyDialog at line 801. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:685 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in BillingBackendClient.refreshIdentityLocked at line 685. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/celzero/bravedns/service/TunFirewallManager.kt app/src/main/java/com/celzero/bravedns/service/TunFirewallManager.kt:100 — app/src/main/java/com/celzero/bravedns/service/TunFirewallManager.kt changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 in TunFirewallManager.firewall at line 100. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/service/TunFirewallManager.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:685 — app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in BillingBackendClient.refreshIdentityLocked at line 685. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt app/src/main/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt:376 — app/src/main/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in AppNetworkActivityViewHolder.setName at line 376. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:335 — app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in ConnectionLogViewHolder.displaySummaryDetails at line 335. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/celzero/bravedns/service/DnsLogTracker.kt app/src/main/java/com/celzero/bravedns/service/DnsLogTracker.kt:145 — app/src/main/java/com/celzero/bravedns/service/DnsLogTracker.kt changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in DnsLogTracker.makeDnsLogObj at line 145. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/service/DnsLogTracker.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt:271 — app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in ConnectionTrackerViewHolder.displaySummaryDetails at line 271. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: app/src/main/java/com/celzero/bravedns/ui/fragment/RulesImportHelper.kt app/src/main/java/com/celzero/bravedns/ui/fragment/RulesImportHelper.kt:101 — app/src/main/java/com/celzero/bravedns/ui/fragment/RulesImportHelper.kt changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in RulesImportHelper.parseFile at line 101. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/ui/fragment/RulesImportHelper.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • + 1 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×26
  • Duplicated block (11 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:165 — app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:165-175 | app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt:112-122 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:165` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:178` calls `cancelBinding` and `app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt:125` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:300 — app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:300-310 | app/src/main/java/com/celzero/bravedns/adapter/ODoHEndpointAdapter.kt:304-314 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/ODoHEndpointAdapter.kt` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 178 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:597 — app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:597-607 | app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:806-817 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 168 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:806` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11 lines × 2) app/src/main/java/com/celzero/bravedns/database/RefreshDatabase.kt:437 — app/src/main/java/com/celzero/bravedns/database/RefreshDatabase.kt:437-447 | app/src/main/java/com/celzero/bravedns/database/RefreshDatabase.kt:452-462 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnHopManager.kt:83 — app/src/main/java/com/celzero/bravedns/rpnproxy/RpnHopManager.kt:83-93 | app/src/main/java/com/celzero/bravedns/wireguard/WgHopManager.kt:86-96 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/rpnproxy/RpnHopManager.kt` and `app/src/main/java/com/celzero/bravedns/wireguard/WgHopManager.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/AppInfoActivity.kt:903 — app/src/main/java/com/celzero/bravedns/ui/activity/AppInfoActivity.kt:903-913 | app/src/main/java/com/celzero/bravedns/ui/fragment/SummaryStatisticsFragment.kt:1070-1080 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/TunnelSettingsActivity.kt:663 — app/src/main/java/com/celzero/bravedns/ui/activity/TunnelSettingsActivity.kt:663-673 | app/src/main/java/com/celzero/bravedns/ui/fragment/DnsSettingsFragment.kt:702-712 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/activity/TunnelSettingsActivity.kt:663` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt:607 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt:607-617 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt:878-888 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt:607` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt:737 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt:737-747 | app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:1735-1745 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt:736` calls `show` and `app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:1734` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/DohListFragment.kt:231 — app/src/main/java/com/celzero/bravedns/ui/fragment/DohListFragment.kt:231-241 | app/src/main/java/com/celzero/bravedns/ui/fragment/ODoHListFragment.kt:209-219 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/fragment/DohListFragment.kt` and `app/src/main/java/com/celzero/bravedns/ui/fragment/ODoHListFragment.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) app/src/main/java/com/celzero/bravedns/util/UIUtils.kt:808 — app/src/main/java/com/celzero/bravedns/util/UIUtils.kt:808-818 | app/src/main/java/com/celzero/bravedns/util/UIUtils.kt:821-831 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) REDACTED:79 — REDACTED:79-89 | app/src/website/java/com/celzero/bravedns/adapter/GooglePlaySubsAdapter.kt:79-89 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/adapter/GooglePlaySubsAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:781 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:781-791 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:781-791 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:781` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) REDACTED:1452 — REDACTED:1452-1462 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:1452-1462 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:831 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:831-841 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:831-841 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:945 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:945-955 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:945-955 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgDetailScreen.kt:276 — app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgDetailScreen.kt:276-286 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgDetailScreen.kt:319-329 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgDetailScreen.kt:276` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgDetailScreen.kt:287` calls `Row`, `ActiveTile`, `Spacer` and `app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgDetailScreen.kt:330` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt:143 — app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt:143-153 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAppsScreen.kt:92-102 — before extracting anything, compare `app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt` and `app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAppsScreen.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 198 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt:143` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt:170 — app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt:170-180 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAppsScreen.kt:111-121 — before extracting anything, compare `app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt` and `app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAppsScreen.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 198 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `row` to `WgAppRow` in one and `RpnAppsScreenRow` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (11 lines × 2) app/src/main/java/com/celzero/bravedns/database/AppInfo.kt:127 — app/src/main/java/com/celzero/bravedns/database/AppInfo.kt:127-137 | app/src/main/java/com/celzero/bravedns/database/ProxyApplicationMapping.kt:62-75 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/PurchaseHistoryActivity.kt:237 — app/src/main/java/com/celzero/bravedns/ui/activity/PurchaseHistoryActivity.kt:237-247 | app/src/main/java/com/celzero/bravedns/ui/activity/ServerOrderHistoryActivity.kt:264-274 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/CustomDomainFragment.kt:89 — app/src/main/java/com/celzero/bravedns/ui/fragment/CustomDomainFragment.kt:89-99 | app/src/main/java/com/celzero/bravedns/ui/fragment/CustomIpFragment.kt:86-96 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/fragment/CustomDomainFragment.kt` and `app/src/main/java/com/celzero/bravedns/ui/fragment/CustomIpFragment.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) REDACTED:546 — REDACTED:546-556 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:546-556 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) REDACTED:3730 — REDACTED:3730-3740 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3730-3740 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1846 — app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1846-1856 | app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1958-1969 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1846` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • + 1 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×23
  • Duplicated block (6 lines × 2) app/src/main/java/com/celzero/bravedns/data/BlocklistStatsAggregator.kt:143 — app/src/main/java/com/celzero/bravedns/data/BlocklistStatsAggregator.kt:143-148 | app/src/main/java/com/celzero/bravedns/data/BlocklistStatsAggregator.kt:186-191 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:643 — app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:643-648 | app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt:559-564 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:643` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt:565` calls `setSpan`, `StyleSpan` and `app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:649` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/LogActivityIntervalBottomSheet.kt:327 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/LogActivityIntervalBottomSheet.kt:327-332 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/RpnLogActivityIntervalBottomSheet.kt:245-250 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/LogActivityIntervalBottomSheet.kt:327` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) app/src/main/java/com/celzero/bravedns/ui/dialog/RpnSsidDialog.kt:165 — app/src/main/java/com/celzero/bravedns/ui/dialog/RpnSsidDialog.kt:165-170 | app/src/main/java/com/celzero/bravedns/ui/dialog/WgSsidDialog.kt:104-109 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/dialog/RpnSsidDialog.kt` and `app/src/main/java/com/celzero/bravedns/ui/dialog/WgSsidDialog.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) REDACTED:319 — REDACTED:319-324 | app/src/website/java/com/celzero/bravedns/adapter/GooglePlaySubsAdapter.kt:319-324 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/adapter/GooglePlaySubsAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:319` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:470 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:470-475 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:470-475 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:470` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:970 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:970-975 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:970-975 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:970` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:657 — app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:657-662 | app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:657-662 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` and `app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 526 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:657` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/BugReportFilesBottomSheet.kt:99 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/BugReportFilesBottomSheet.kt:99-104 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/PcapFilesBottomSheet.kt:106-111 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt:647 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt:647-652 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/RethinkLogBottomSheet.kt:414-419 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt` and `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/RethinkLogBottomSheet.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/CustomDomainRulesBtmSheet.kt:169 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/CustomDomainRulesBtmSheet.kt:169-174 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/CustomIpRulesBtmSheet.kt:190-195 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/CustomDomainRulesBtmSheet.kt` and `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/CustomIpRulesBtmSheet.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) REDACTED:95 — REDACTED:95-100 | app/src/website/java/com/celzero/bravedns/adapter/GooglePlaySubsAdapter.kt:95-100 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/adapter/GooglePlaySubsAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:179 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:179-184 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:179-184 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1347 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1347-1352 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1347-1352 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) REDACTED:1691 — REDACTED:1691-1696 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:1691-1696 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1691` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) app/src/play/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt:137 — app/src/play/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt:137-142 | app/src/website/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt:137-142 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt` and `app/src/website/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:207 — app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:207-212 | app/src/website/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:207-212 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt` and `app/src/website/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 326 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:207` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) app/src/play/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:368 — app/src/play/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:368-373 | app/src/website/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:368-373 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt` and `app/src/website/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 245 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:575 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:575-580 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:575-580 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:718 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:718-723 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:718-723 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:961 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:961-966 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:961-966 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/WgMainActivity.kt:347 — app/src/main/java/com/celzero/bravedns/ui/activity/WgMainActivity.kt:347-352 | app/src/main/java/com/celzero/bravedns/ui/activity/WgMainActivity.kt:363-368 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/activity/WgMainActivity.kt:347` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) app/src/main/java/com/celzero/bravedns/service/IpRulesManager.kt:439 — app/src/main/java/com/celzero/bravedns/service/IpRulesManager.kt:439-444 | app/src/main/java/com/celzero/bravedns/service/IpRulesManager.kt:526-531 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/service/IpRulesManager.kt:439` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×22
  • Duplicated block (14 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:269 — app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:269-282 | app/src/main/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt:783-796 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:269` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:408 — app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:408-421 | app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:331-344 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 168 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:329` calls `d` and `app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:406` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt:1031 — app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt:1031-1044 | app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt:1103-1116 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt:1031` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt:1100` calls `i`, `updateSsids` and `app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt:1026` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/DeviceAuthErrorBottomSheet.kt:206 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/DeviceAuthErrorBottomSheet.kt:206-219 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/DeviceNotRegisteredBottomSheet.kt:204-217 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/DeviceAuthErrorBottomSheet.kt:206` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/CustomDomainFragment.kt:517 — app/src/main/java/com/celzero/bravedns/ui/fragment/CustomDomainFragment.kt:517-530 | app/src/main/java/com/celzero/bravedns/ui/fragment/CustomIpFragment.kt:484-497 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/fragment/CustomDomainFragment.kt` and `app/src/main/java/com/celzero/bravedns/ui/fragment/CustomIpFragment.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/HomeScreenFragment.kt:2968 — app/src/main/java/com/celzero/bravedns/ui/fragment/HomeScreenFragment.kt:2968-2981 | app/src/main/java/com/celzero/bravedns/ui/fragment/HomeScreenFragment.kt:3016-3029 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:555 — app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:555-568 | app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt:535-548 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt` and `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:192 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:192-205 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:192-205 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1008 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1008-1021 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1008-1021 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1008` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) app/src/play/java/com/celzero/bravedns/iab/QueryUtils.kt:83 — app/src/play/java/com/celzero/bravedns/iab/QueryUtils.kt:83-96 | app/src/website/java/com/celzero/bravedns/iab/QueryUtils.kt:83-96 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/QueryUtils.kt` and `app/src/website/java/com/celzero/bravedns/iab/QueryUtils.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/iab/QueryUtils.kt:83` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) app/src/play/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt:195 — app/src/play/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt:195-208 | app/src/website/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt:195-208 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt` and `app/src/website/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:448 — app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:448-461 | app/src/website/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:448-461 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt` and `app/src/website/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 326 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:220 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:220-233 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:220-233 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:726 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:726-739 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:726-739 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:900 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:900-913 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:900-913 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:114 — app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:114-127 | app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:114-127 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` and `app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 526 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:114` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:314 — app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:314-327 | app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:314-327 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` and `app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 526 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:378 — app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:378-391 | app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:378-391 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` and `app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 526 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:1635 — app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:1635-1648 | app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt:1416-1429 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (14 lines × 2) app/src/play/java/com/celzero/bravedns/iab/QueryUtils.kt:30 — app/src/play/java/com/celzero/bravedns/iab/QueryUtils.kt:30-43 | app/src/website/java/com/celzero/bravedns/iab/QueryUtils.kt:30-43 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/QueryUtils.kt` and `app/src/website/java/com/celzero/bravedns/iab/QueryUtils.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) app/src/play/java/com/celzero/bravedns/iab/QueryUtils.kt:45 — app/src/play/java/com/celzero/bravedns/iab/QueryUtils.kt:45-58 | app/src/website/java/com/celzero/bravedns/iab/QueryUtils.kt:45-58 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/QueryUtils.kt` and `app/src/website/java/com/celzero/bravedns/iab/QueryUtils.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 2) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:3702 — app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:3702-3715 | app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:3728-3741 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:3702` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×22
  • Duplicated block (12 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:362 — app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:362-373 | app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt:297-308 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:362` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:506 — app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:506-517 | app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt:435-446 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 195 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:519` calls `io`, `suspend`, `launch` and `app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt:447` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:305 — app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:305-316 | app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:452-463 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 168 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1793 — app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1793-1804 | app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1900-1911 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1793` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) app/src/main/java/com/celzero/bravedns/service/IpRulesManager.kt:573 — app/src/main/java/com/celzero/bravedns/service/IpRulesManager.kt:573-584 | app/src/main/java/com/celzero/bravedns/service/IpRulesManager.kt:592-603 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/BubbleActivity.kt:300 — app/src/main/java/com/celzero/bravedns/ui/activity/BubbleActivity.kt:300-311 | app/src/main/java/com/celzero/bravedns/ui/activity/BubbleActivity.kt:322-333 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/activity/BubbleActivity.kt:300` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/CustomRulesActivity.kt:83 — app/src/main/java/com/celzero/bravedns/ui/activity/CustomRulesActivity.kt:83-94 | app/src/main/java/com/celzero/bravedns/ui/activity/NetworkLogsActivity.kt:77-88 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/activity/CustomRulesActivity.kt` and `app/src/main/java/com/celzero/bravedns/ui/activity/NetworkLogsActivity.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/DnsLogFragment.kt:266 — app/src/main/java/com/celzero/bravedns/ui/fragment/DnsLogFragment.kt:266-277 | app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkBlocklistFragment.kt:738-749 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/fragment/DnsLogFragment.kt:266` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:575 — app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:575-586 | app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt:555-566 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt` and `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) REDACTED:302 — REDACTED:302-313 | app/src/website/java/com/celzero/bravedns/adapter/GooglePlaySubsAdapter.kt:302-313 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/adapter/GooglePlaySubsAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1274 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1274-1285 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1274-1285 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1274` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) REDACTED:2576 — REDACTED:2576-2587 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:2576-2587 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) REDACTED:3282 — REDACTED:3282-3293 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3282-3293 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:855 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:855-866 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:855-866 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) app/src/tv/java/com/celzero/bravedns/tv/ui/dns/DnsScreen.kt:473 — app/src/tv/java/com/celzero/bravedns/tv/ui/dns/DnsScreen.kt:473-484 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/ProxyScreen.kt:207-218 — before extracting anything, compare `app/src/tv/java/com/celzero/bravedns/tv/ui/dns/DnsScreen.kt` and `app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/ProxyScreen.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/dns/DnsScreen.kt:473` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt:205 — app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt:205-217 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAppsScreen.kt:127-138 — before extracting anything, compare `app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt` and `app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAppsScreen.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 198 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt:205` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) app/src/tv/java/com/celzero/bravedns/tv/ui/rules/CustomDomainRulesList.kt:177 — app/src/tv/java/com/celzero/bravedns/tv/ui/rules/CustomDomainRulesList.kt:177-188 | app/src/tv/java/com/celzero/bravedns/tv/ui/rules/CustomIpRulesList.kt:173-184 — before extracting anything, compare `app/src/tv/java/com/celzero/bravedns/tv/ui/rules/CustomDomainRulesList.kt` and `app/src/tv/java/com/celzero/bravedns/tv/ui/rules/CustomIpRulesList.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/rules/CustomDomainRulesList.kt:177` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:206 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:206-217 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:206-217 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:514 — app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:514-525 | app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:514-525 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` and `app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 526 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:1085 — app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:1085-1096 | app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:1511-1523 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:1085` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnHeatmap.kt:182 — app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnHeatmap.kt:182-193 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnSettingsScreen.kt:312-323 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnHeatmap.kt:182` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) app/src/tv/java/com/celzero/bravedns/tv/ui/rules/CustomDomainRulesList.kt:81 — app/src/tv/java/com/celzero/bravedns/tv/ui/rules/CustomDomainRulesList.kt:81-92 | app/src/tv/java/com/celzero/bravedns/tv/ui/rules/CustomIpRulesList.kt:86-97 — before extracting anything, compare `app/src/tv/java/com/celzero/bravedns/tv/ui/rules/CustomDomainRulesList.kt` and `app/src/tv/java/com/celzero/bravedns/tv/ui/rules/CustomIpRulesList.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/rules/CustomDomainRulesList.kt:81` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D15 · Churn × Complexity Hotspots · Repeated repair · ×18
  • Repeated repair: app/src/main/java/com/celzero/bravedns/util/Utilities.kt app/src/main/java/com/celzero/bravedns/util/Utilities.kt:355 — app/src/main/java/com/celzero/bravedns/util/Utilities.kt changed 11 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is Utilities.showToastUiCentered at line 355), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “ui: fix vpn service notif handler”; “bug-rpt: enhanced go-log auto reporting for play”; “fix: #3177, rmv floating text-selection toolbar on select devices”; “impl: minor fixes to limit battery usage”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/util/Utilities.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: app/src/main/java/com/celzero/bravedns/scheduler/EnhancedBugReport.kt app/src/main/java/com/celzero/bravedns/scheduler/EnhancedBugReport.kt:208 — app/src/main/java/com/celzero/bravedns/scheduler/EnhancedBugReport.kt changed 5 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is EnhancedBugReport.reportTombstonesToFirebaseOnStartup at line 208), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: rmv current file from deletion”; “bug-rpt: enhanced go-log auto reporting for play”; “improved enhanced bug report and add tests”; “fix: #2988, best effort exception parser”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/scheduler/EnhancedBugReport.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: app/src/main/java/com/celzero/bravedns/service/IpRulesManager.kt app/src/main/java/com/celzero/bravedns/service/IpRulesManager.kt:853 — app/src/main/java/com/celzero/bravedns/service/IpRulesManager.kt changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is IpRulesManager.splitHostPort at line 853), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “impl: minor fixes to limit battery usage”; “fix: initialize possible disk, db operations in IO on init”; “fix: #3060, ip2cidr handle invalid cidr”; “#2960 fix wildcard prefixes resulting in empty rules”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/service/IpRulesManager.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: app/src/main/java/com/celzero/bravedns/ui/fragment/CustomIpFragment.kt app/src/main/java/com/celzero/bravedns/ui/fragment/CustomIpFragment.kt:254 — app/src/main/java/com/celzero/bravedns/ui/fragment/CustomIpFragment.kt changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is CustomIpFragment.showAddIpDialog at line 254), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “ui: fix dialog size for foldable/tablet”; “ui: fix ip/domain add dialog for small screens”; “fix: #3060, ip2cidr handle invalid cidr”; “fix: #3000, handle all uiCtx with guard”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/ui/fragment/CustomIpFragment.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: app/src/main/java/com/celzero/bravedns/ui/fragment/DnsProxyListFragment.kt app/src/main/java/com/celzero/bravedns/ui/fragment/DnsProxyListFragment.kt:151 — app/src/main/java/com/celzero/bravedns/ui/fragment/DnsProxyListFragment.kt changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is DnsProxyListFragment.showAddDnsProxyDialog at line 151), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix #3029: add edge-edge, apply proper insets”; “ui: fix dialog size for foldable/tablet”; “fix: #3078, wrap custom dialogs into scrollview”; “fix: #3000, handle all uiCtx with guard”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/ui/fragment/DnsProxyListFragment.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: app/src/main/java/com/celzero/bravedns/ui/fragment/DohListFragment.kt app/src/main/java/com/celzero/bravedns/ui/fragment/DohListFragment.kt:76 — app/src/main/java/com/celzero/bravedns/ui/fragment/DohListFragment.kt changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is DohListFragment.initView at line 76), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix #3029: add edge-edge, apply proper insets”; “ui: fix dialog size for foldable/tablet”; “fix: #3078, wrap custom dialogs into scrollview”; “fix: #3000, handle all uiCtx with guard”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/ui/fragment/DohListFragment.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: app/src/main/java/com/celzero/bravedns/ui/fragment/DnsCryptListFragment.kt app/src/main/java/com/celzero/bravedns/ui/fragment/DnsCryptListFragment.kt:90 — app/src/main/java/com/celzero/bravedns/ui/fragment/DnsCryptListFragment.kt changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is DnsCryptListFragment.initView at line 90), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix #3029: add edge-edge, apply proper insets”; “ui: fix dialog size for foldable/tablet”; “fix: #3078, wrap custom dialogs into scrollview”; “fix: #3000, handle all uiCtx with guard”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/ui/fragment/DnsCryptListFragment.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: app/src/main/java/com/celzero/bravedns/ui/fragment/DoTListFragment.kt app/src/main/java/com/celzero/bravedns/ui/fragment/DoTListFragment.kt:74 — app/src/main/java/com/celzero/bravedns/ui/fragment/DoTListFragment.kt changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is DoTListFragment.initView at line 74), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix #3029: add edge-edge, apply proper insets”; “ui: fix dialog size for foldable/tablet”; “fix: #3078, wrap custom dialogs into scrollview”; “fix: #3000, handle all uiCtx with guard”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/ui/fragment/DoTListFragment.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: app/src/main/java/com/celzero/bravedns/ui/fragment/ODoHListFragment.kt app/src/main/java/com/celzero/bravedns/ui/fragment/ODoHListFragment.kt:76 — app/src/main/java/com/celzero/bravedns/ui/fragment/ODoHListFragment.kt changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is ODoHListFragment.initView at line 76), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix #3029: add edge-edge, apply proper insets”; “ui: fix dialog size for foldable/tablet”; “fix: #3078, wrap custom dialogs into scrollview”; “fix: #3000, handle all uiCtx with guard”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/ui/fragment/ODoHListFragment.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: app/src/play/java/com/celzero/bravedns/RethinkDnsApplicationPlay.kt app/src/play/java/com/celzero/bravedns/RethinkDnsApplicationPlay.kt:49 — app/src/play/java/com/celzero/bravedns/RethinkDnsApplicationPlay.kt changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is RethinkDnsApplicationPlay.onCreate at line 49), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix #3195: on demand initialization of WorkManager”; “fix #3195: initialize workmgr if self init never ran on this device”; “fix: initialize possible disk, db operations in IO on init”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/play/java/com/celzero/bravedns/RethinkDnsApplicationPlay.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt:83 — app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is AppWiseDomainLogsActivity.onCreate at line 83), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix #3029: add edge-edge, apply proper insets”; “fix: #3000, handle all uiCtx with guard”; “fix: #3000, handle all uiCtx with guard”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseIpLogsActivity.kt app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseIpLogsActivity.kt:82 — app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseIpLogsActivity.kt changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is AppWiseIpLogsActivity.onCreate at line 82), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix #3029: add edge-edge, apply proper insets”; “fix: #3000, handle all uiCtx with guard”; “fix: #3000, handle all uiCtx with guard”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseIpLogsActivity.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: app/src/main/java/com/celzero/bravedns/receiver/VPNControlReceiver.kt app/src/main/java/com/celzero/bravedns/receiver/VPNControlReceiver.kt:97 — app/src/main/java/com/celzero/bravedns/receiver/VPNControlReceiver.kt changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is VpnControlReceiver.onReceive at line 97), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: handle empty pkg names in automations”; “fix: restore external intent control when sender identity is absent”; “fix: handle exception during VpnService.prepare(); #2984”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/receiver/VPNControlReceiver.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigEditorActivity.kt app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigEditorActivity.kt:102 — app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigEditorActivity.kt changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is WgConfigEditorActivity.init at line 102), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix #3214, add default dns in case config has none”; “fix #3029: add edge-edge, apply proper insets”; “fix: #3000, handle all uiCtx with guard”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigEditorActivity.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: app/src/main/java/com/celzero/bravedns/ui/activity/DnsListActivity.kt app/src/main/java/com/celzero/bravedns/ui/activity/DnsListActivity.kt:201 — app/src/main/java/com/celzero/bravedns/ui/activity/DnsListActivity.kt changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is DnsListActivity.highlightSelectedUi at line 201), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix #3029: add edge-edge, apply proper insets”; “ui: dns option screen fix for foldable/tablet”; “fix: #3000, handle all uiCtx with guard”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/ui/activity/DnsListActivity.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: app/src/main/java/com/celzero/bravedns/ui/activity/WgMainActivity.kt app/src/main/java/com/celzero/bravedns/ui/activity/WgMainActivity.kt:332 — app/src/main/java/com/celzero/bravedns/ui/activity/WgMainActivity.kt changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is WgMainActivity.setupClickListeners at line 332), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix #3029: add edge-edge, apply proper insets”; “fix: #3070, add guards in places where updates return from diff ctx to ui ctx”; “fix: #3000, handle all uiCtx with guard”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/ui/activity/WgMainActivity.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: app/src/main/java/com/celzero/bravedns/adapter/CustomIpAdapter.kt app/src/main/java/com/celzero/bravedns/adapter/CustomIpAdapter.kt:220 — app/src/main/java/com/celzero/bravedns/adapter/CustomIpAdapter.kt changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is CustomIpsViewHolderWithHeader.update at line 220), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “ui: fix dialog size for foldable/tablet”; “fix: #3060, ip2cidr handle invalid cidr”; “fix: #3000, handle all uiCtx with guard”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/adapter/CustomIpAdapter.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: app/src/main/java/com/celzero/bravedns/ui/dialog/WgAddPeerDialog.kt app/src/main/java/com/celzero/bravedns/ui/dialog/WgAddPeerDialog.kt:118 — app/src/main/java/com/celzero/bravedns/ui/dialog/WgAddPeerDialog.kt changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is WgAddPeerDialog.setupClickListener at line 118), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “ui: fix dialog size for foldable/tablet”; “fix: #3019, do not resolve wg-endpoint in kotlin layer”; “fix: #3000, handle all uiCtx with guard”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-26..2026-10-24, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-26 02:11:06 +05:30' --until='2026-10-24 02:11:06 +05:30' --full-history --no-merges -- app/src/main/java/com/celzero/bravedns/ui/dialog/WgAddPeerDialog.kt`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×18
  • Duplicated block (16 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:116 — app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:116-131 | app/src/main/java/com/celzero/bravedns/adapter/AppWiseIpsAdapter.kt:76-91 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:342 — app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:342-357 | app/src/main/java/com/celzero/bravedns/adapter/RethinkLogAdapter.kt:246-261 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/RethinkLogAdapter.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 225 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:342` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/CustomDomainAdapter.kt:459 — app/src/main/java/com/celzero/bravedns/adapter/CustomDomainAdapter.kt:459-474 | app/src/main/java/com/celzero/bravedns/adapter/CustomDomainAdapter.kt:570-585 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/CustomDomainAdapter.kt:459` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:215 — app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:215-230 | app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt:131-146 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:215` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `endpoint` to `DnsCryptEndpoint` in one and `DnsCryptRelayEndpoint` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (16 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:301 — app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:301-316 | app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt:138-153 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 195 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:301` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:117 — app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:117-132 | app/src/main/java/com/celzero/bravedns/adapter/RemoteAdvancedViewAdapter.kt:119-134 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/RemoteAdvancedViewAdapter.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:117` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:557 — app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:557-572 | app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:788-803 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 168 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnHopManager.kt:200 — app/src/main/java/com/celzero/bravedns/rpnproxy/RpnHopManager.kt:200-215 | app/src/main/java/com/celzero/bravedns/wireguard/WgHopManager.kt:202-217 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/rpnproxy/RpnHopManager.kt` and `app/src/main/java/com/celzero/bravedns/wireguard/WgHopManager.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/rpnproxy/RpnHopManager.kt:200` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/ConnectionTrackerFragment.kt:338 — app/src/main/java/com/celzero/bravedns/ui/fragment/ConnectionTrackerFragment.kt:338-353 | app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkLogFragment.kt:140-155 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/fragment/ConnectionTrackerFragment.kt:338` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) REDACTED:1552 — REDACTED:1552-1567 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:1552-1567 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) REDACTED:1755 — REDACTED:1755-1770 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:1755-1770 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:747 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:747-762 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:747-762 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:397 — app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:397-412 | app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:397-412 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` and `app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 526 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:761 — app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:761-776 | app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:761-776 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` and `app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 526 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:424 — app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:424-439 | app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:592-607 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 168 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:456 — app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:456-471 | app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt:654-669 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16 lines × 2) REDACTED:113 — REDACTED:113-128 | app/src/website/java/com/celzero/bravedns/adapter/GooglePlaySubsAdapter.kt:113-128 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/adapter/GooglePlaySubsAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (16 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:148 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:148-163 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:148-163 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×18
  • Duplicated block (5 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:406 — app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:406-410 | app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt:347-351 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 195 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:406` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/AppInfoActivity.kt:883 — app/src/main/java/com/celzero/bravedns/ui/activity/AppInfoActivity.kt:883-887 | app/src/main/java/com/celzero/bravedns/ui/fragment/SummaryStatisticsFragment.kt:1014-1018 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note first that the copies are not typed on the same thing: `TOP_SLICES` names `com.celzero.bravedns.ui.activity.AppInfoActivity.Companion.TOP_SLICES` in one and `com.celzero.bravedns.ui.fragment.SummaryStatisticsFragment.Companion.TOP_SLICES` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (5 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:844 — app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:844-848 | app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:1086-1090 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:844` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:850` calls `setText`, `toString` and `app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:1092` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) app/src/main/java/com/celzero/bravedns/ui/dialog/RpnSsidDialog.kt:103 — app/src/main/java/com/celzero/bravedns/ui/dialog/RpnSsidDialog.kt:103-108 | app/src/main/java/com/celzero/bravedns/ui/dialog/WgSsidDialog.kt:80-84 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/dialog/RpnSsidDialog.kt` and `app/src/main/java/com/celzero/bravedns/ui/dialog/WgSsidDialog.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/celzero/bravedns/ui/dialog/WgSsidDialog.kt:86` calls `disableOrEnableRadioButtons` and `app/src/main/java/com/celzero/bravedns/ui/dialog/RpnSsidDialog.kt:112` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:188 — app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:188-192 | app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt:167-171 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt` and `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:188` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:312 — app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:312-316 | app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt:292-296 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt` and `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:312` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) app/src/play/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt:232 — app/src/play/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt:232-236 | app/src/website/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt:232-236 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt` and `app/src/website/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/LocalSimpleViewAdapter.kt:87 — app/src/main/java/com/celzero/bravedns/adapter/LocalSimpleViewAdapter.kt:87-91 | app/src/main/java/com/celzero/bravedns/adapter/RemoteSimpleViewAdapter.kt:86-90 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/LocalSimpleViewAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/RemoteSimpleViewAdapter.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `map` to `LocalBlocklistPacksMap` in one and `RemoteBlocklistPacksMap` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (5 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/LocalSimpleViewAdapter.kt:101 — app/src/main/java/com/celzero/bravedns/adapter/LocalSimpleViewAdapter.kt:101-105 | app/src/main/java/com/celzero/bravedns/adapter/RemoteSimpleViewAdapter.kt:100-104 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/LocalSimpleViewAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/RemoteSimpleViewAdapter.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `map` to `LocalBlocklistPacksMap` in one and `RemoteBlocklistPacksMap` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (5 lines × 2) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnHopManager.kt:137 — app/src/main/java/com/celzero/bravedns/rpnproxy/RpnHopManager.kt:137-141 | app/src/main/java/com/celzero/bravedns/wireguard/WgHopManager.kt:140-144 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/rpnproxy/RpnHopManager.kt` and `app/src/main/java/com/celzero/bravedns/wireguard/WgHopManager.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt:156 — app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt:156-162 | app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseIpLogsActivity.kt:185-189 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt` and `app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseIpLogsActivity.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt:164 — app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt:164-170 | app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseIpLogsActivity.kt:191-195 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt` and `app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseIpLogsActivity.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) REDACTED:107 — REDACTED:107-111 | app/src/website/java/com/celzero/bravedns/adapter/GooglePlaySubsAdapter.kt:107-111 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/adapter/GooglePlaySubsAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:363 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:363-367 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:363-367 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) app/src/play/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt:130 — app/src/play/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt:130-134 | app/src/website/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt:130-134 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt` and `app/src/website/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 103 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) app/src/play/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt:281 — app/src/play/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt:281-285 | app/src/website/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt:281-285 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt` and `app/src/website/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:1018 — app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:1018-1022 | app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:1382-1386 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:1018` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:3686 — app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:3686-3690 | app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:3701-3705 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:3686` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×14
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:192 — app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:192-257 | app/src/main/java/com/celzero/bravedns/adapter/DnsLogAdapter.kt:452-518 | app/src/main/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt:706-771 | app/src/main/java/com/celzero/bravedns/ui/adapter/AppActivityAdapter.kt:411-431 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt:215 — app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt:215-226 | app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:299-312 | app/src/main/java/com/celzero/bravedns/adapter/DohEndpointAdapter.kt:298-311 | app/src/main/java/com/celzero/bravedns/adapter/ODoHEndpointAdapter.kt:303-316 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:159 — app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:159-189 | app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:191-229 | app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:396-442 | app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt:201-239 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:113 — app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:113-132 | app/src/main/java/com/celzero/bravedns/adapter/LocalSimpleViewAdapter.kt:147-165 | app/src/main/java/com/celzero/bravedns/adapter/RemoteAdvancedViewAdapter.kt:115-134 | app/src/main/java/com/celzero/bravedns/adapter/RemoteSimpleViewAdapter.kt:146-164 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:140 — app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:140-150 | app/src/main/java/com/celzero/bravedns/adapter/LocalSimpleViewAdapter.kt:180-190 | app/src/main/java/com/celzero/bravedns/adapter/RemoteAdvancedViewAdapter.kt:192-202 | app/src/main/java/com/celzero/bravedns/adapter/RemoteSimpleViewAdapter.kt:179-189 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:191 — app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:191-201 | app/src/main/java/com/celzero/bravedns/adapter/LocalSimpleViewAdapter.kt:167-177 | app/src/main/java/com/celzero/bravedns/adapter/RemoteAdvancedViewAdapter.kt:141-151 | app/src/main/java/com/celzero/bravedns/adapter/RemoteSimpleViewAdapter.kt:166-176 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:339 — app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:339-364 | app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:524-555 | app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:633-672 | app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt:621-652 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1594 — app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1594-1737 | app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1792-1867 | app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1898-2103 | app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:2136-2152 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/viewmodel/AppConnectionsViewModel.kt:99 — app/src/main/java/com/celzero/bravedns/viewmodel/AppConnectionsViewModel.kt:99-124 | app/src/main/java/com/celzero/bravedns/viewmodel/DomainConnectionsViewModel.kt:147-164 | app/src/main/java/com/celzero/bravedns/viewmodel/SummaryStatisticsViewModel.kt:87-108 | app/src/main/java/com/celzero/bravedns/viewmodel/WgNwActivityViewModel.kt:73-90 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/viewmodel/AppInfoViewModel.kt:226 — app/src/main/java/com/celzero/bravedns/viewmodel/AppInfoViewModel.kt:226-247 | app/src/main/java/com/celzero/bravedns/viewmodel/AppInfoViewModel.kt:249-270 | app/src/main/java/com/celzero/bravedns/viewmodel/AppInfoViewModel.kt:272-293 | app/src/main/java/com/celzero/bravedns/viewmodel/AppInfoViewModel.kt:295-317 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED:929 — REDACTED:929-1360 | REDACTED:3802-3928 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:929-1360 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3802-3928 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED:1932 — REDACTED:1932-1945 | app/src/play/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:353-366 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:1932-1945 | app/src/website/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:353-366 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/play/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt:134 — app/src/play/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt:134-155 | app/src/play/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt:219-238 | app/src/website/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt:134-155 | app/src/website/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt:219-238 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) app/src/tv/java/com/celzero/bravedns/tv/ui/dns/OdohAddScreen.kt:207 — app/src/tv/java/com/celzero/bravedns/tv/ui/dns/OdohAddScreen.kt:207-224 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgImportScreen.kt:265-282 | app/src/tv/java/com/celzero/bravedns/tv/ui/settings/PauseVpnScreen.kt:103-141 | app/src/tv/java/com/celzero/bravedns/tv/ui/settings/PauseVpnScreen.kt:213-230 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×13
  • Duplicated block (19 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:194 — app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:194-212 | app/src/main/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt:708-726 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:194` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:438 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:438-456 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:438-456 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:630 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:630-648 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:630-648 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:850 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:850-868 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:850-868 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:850` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) REDACTED:874 — REDACTED:874-892 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:874-892 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) REDACTED:906 — REDACTED:906-924 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:906-924 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) REDACTED:2900 — REDACTED:2900-2918 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:2900-2918 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) REDACTED:2932 — REDACTED:2932-2950 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:2932-2950 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:112 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:112-130 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:112-130 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:662 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:662-680 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:662-680 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:693 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:693-711 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:693-711 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (19 lines × 2) app/src/main/java/com/celzero/bravedns/database/LocalBlocklistPacksMap.kt:27 — app/src/main/java/com/celzero/bravedns/database/LocalBlocklistPacksMap.kt:27-45 | app/src/main/java/com/celzero/bravedns/database/RemoteBlocklistPacksMap.kt:27-45 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/database/LocalBlocklistPacksMap.kt` and `app/src/main/java/com/celzero/bravedns/database/RemoteBlocklistPacksMap.kt` as WHOLE FILES: 94% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (19 lines × 2) app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:553 — app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:553-571 | app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:553-571 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` and `app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 526 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×13
  • Duplicated block (15 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:335 — app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:335-349 | app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt:275-289 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:335` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:326 — app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:326-340 | app/src/main/java/com/celzero/bravedns/adapter/ODoHEndpointAdapter.kt:330-344 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/ODoHEndpointAdapter.kt` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 178 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:326` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/LocalSimpleViewAdapter.kt:151 — app/src/main/java/com/celzero/bravedns/adapter/LocalSimpleViewAdapter.kt:151-165 | app/src/main/java/com/celzero/bravedns/adapter/RemoteSimpleViewAdapter.kt:150-164 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/LocalSimpleViewAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/RemoteSimpleViewAdapter.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/LocalSimpleViewAdapter.kt:151` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/AppInfoActivity.kt:1515 — app/src/main/java/com/celzero/bravedns/ui/activity/AppInfoActivity.kt:1515-1529 | app/src/main/java/com/celzero/bravedns/ui/activity/AppInfoActivity.kt:1544-1558 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/activity/AppInfoActivity.kt:1515` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/AppInfoActivity.kt:1573 — app/src/main/java/com/celzero/bravedns/ui/activity/AppInfoActivity.kt:1573-1587 | app/src/main/java/com/celzero/bravedns/ui/activity/AppInfoActivity.kt:1603-1617 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/activity/AppInfoActivity.kt:1573` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:877 — app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:877-891 | app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:1115-1129 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:664 — app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:664-678 | app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt:578-592 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (15 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt:345 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt:345-359 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/RethinkLogBottomSheet.kt:318-332 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt` and `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/RethinkLogBottomSheet.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) app/src/main/java/com/celzero/bravedns/util/BubbleHelper.kt:287 — app/src/main/java/com/celzero/bravedns/util/BubbleHelper.kt:287-301 | app/src/main/java/com/celzero/bravedns/util/BubbleHelper.kt:457-471 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) REDACTED:3190 — REDACTED:3190-3204 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3190-3204 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:88 — app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:88-102 | app/src/website/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:88-102 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt` and `app/src/website/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 326 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:287 — app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:287-301 | app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:287-301 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` and `app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 526 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 2) app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:806 — app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:806-820 | app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:806-820 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` and `app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 526 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D6 · Cohesion (LCOM4) · Low cohesion · ×13
  • Low cohesion: InAppBillingHandlerTest (LCOM4 17) app/src/testPlay/java/com/celzero/bravedns/iab/InAppBillingHandlerTest.kt:77 — InAppBillingHandlerTest's methods fall into 17 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 17 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: InAppBillingHandlerTest (LCOM4 17) app/src/testWebsite/java/com/celzero/bravedns/iab/InAppBillingHandlerTest.kt:77 — InAppBillingHandlerTest's methods fall into 17 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 17 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Builder (LCOM4 15) REDACTED:394 — Builder's methods fall into 15 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 15 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: PersistentState (LCOM4 7) app/src/main/java/com/celzero/bravedns/service/PersistentState.kt:46 — PersistentState's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: CustomDomainAdapter (LCOM4 6) app/src/main/java/com/celzero/bravedns/adapter/CustomDomainAdapter.kt:66 — CustomDomainAdapter's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: CustomIpAdapter (LCOM4 6) app/src/main/java/com/celzero/bravedns/adapter/CustomIpAdapter.kt:67 — CustomIpAdapter's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: FirewallAppListAdapter (LCOM4 6) app/src/main/java/com/celzero/bravedns/adapter/FirewallAppListAdapter.kt:60 — FirewallAppListAdapter's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: SummaryStatisticsAdapter (LCOM4 5) app/src/main/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt:68 — SummaryStatisticsAdapter's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Builder (LCOM4 5) app/src/main/java/com/celzero/bravedns/wireguard/Peer.kt:191 — Builder's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: WgNwStatsAdapter (LCOM4 4) app/src/main/java/com/celzero/bravedns/adapter/WgNwStatsAdapter.kt:45 — WgNwStatsAdapter's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Builder (LCOM4 4) app/src/main/java/com/celzero/bravedns/wireguard/Config.kt:141 — Builder's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: QueryUtils (LCOM4 4) app/src/play/java/com/celzero/bravedns/iab/QueryUtils.kt:26 — QueryUtils's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: QueryUtils (LCOM4 4) app/src/website/java/com/celzero/bravedns/iab/QueryUtils.kt:26 — QueryUtils's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
X3 · Exception handling · Swallowed exception (empty catch) · ×13
  • Swallowed exception (empty catch) app/src/main/java/com/celzero/bravedns/customdownloader/RetrofitManager.kt:223 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/celzero/bravedns/database/AppDatabase.kt:1260 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/celzero/bravedns/database/AppDatabase.kt:1299 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/celzero/bravedns/database/AppDatabase.kt:1302 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/celzero/bravedns/database/AppDatabase.kt:1305 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/celzero/bravedns/database/AppDatabase.kt:1308 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/celzero/bravedns/database/AppDatabase.kt:1311 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/celzero/bravedns/database/AppDatabase.kt:1314 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/celzero/bravedns/database/AppDatabase.kt:1317 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt:767 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt:1369 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt:3515 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) app/src/main/java/com/celzero/bravedns/service/GoLogFileDescriptorReader.kt:108 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×11
  • Duplicated block (18 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:406 — app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:406-423 | app/src/main/java/com/celzero/bravedns/adapter/AppWiseIpsAdapter.kt:200-217 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:406` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:125 — app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:125-142 | app/src/main/java/com/celzero/bravedns/adapter/RethinkEndpointAdapter.kt:135-152 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/RethinkEndpointAdapter.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:125` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `holder` to `DnsCryptEndpointViewHolder` in one and `RethinkEndpointViewHolder` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (18 lines × 2) app/src/main/java/com/celzero/bravedns/service/GoLogFileDescriptorReader.kt:152 — app/src/main/java/com/celzero/bravedns/service/GoLogFileDescriptorReader.kt:152-169 | app/src/main/java/com/celzero/bravedns/util/GoReportingHandler.kt:140-157 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/service/GoLogFileDescriptorReader.kt:152` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/AppInfoActivity.kt:1834 — app/src/main/java/com/celzero/bravedns/ui/activity/AppInfoActivity.kt:1834-1851 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt:628-645 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18 lines × 2) REDACTED:254 — REDACTED:254-271 | app/src/website/java/com/celzero/bravedns/adapter/GooglePlaySubsAdapter.kt:254-271 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/adapter/GooglePlaySubsAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18 lines × 2) REDACTED:453 — REDACTED:453-470 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:453-470 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18 lines × 2) REDACTED:1570 — REDACTED:1570-1587 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:1570-1587 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18 lines × 2) app/src/play/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:171 — app/src/play/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:171-188 | app/src/website/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:171-188 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt` and `app/src/website/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 245 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (18 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:877 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:877-894 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:877-894 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:1018 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:1018-1035 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:1018-1035 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18 lines × 2) app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:528 — app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:528-545 | app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:528-545 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` and `app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 526 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×11
  • Duplicated block (17 lines × 2) app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt:2820 — app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt:2820-2836 | app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt:2863-2879 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt:2820` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:3944 — app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:3944-3960 | app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt:1287-1303 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:3962` calls `toString`, `d` and `app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt:1305` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (17 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt:808 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt:808-824 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/DnsBlocklistBottomSheet.kt:731-747 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) app/src/main/java/com/celzero/bravedns/viewmodel/AppInfoViewModel.kt:343 — app/src/main/java/com/celzero/bravedns/viewmodel/AppInfoViewModel.kt:343-359 | app/src/main/java/com/celzero/bravedns/viewmodel/AppInfoViewModel.kt:409-425 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/viewmodel/AppInfoViewModel.kt:343` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (17 lines × 2) REDACTED:1533 — REDACTED:1533-1549 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:1533-1549 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) REDACTED:2551 — REDACTED:2551-2567 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:2551-2567 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) REDACTED:3207 — REDACTED:3207-3223 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3207-3223 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) app/src/play/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt:187 — app/src/play/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt:187-203 | app/src/website/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt:187-203 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt` and `app/src/website/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 103 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:132 — app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:132-148 | app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:132-148 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` and `app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 526 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:132` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:587 — app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:587-603 | app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:587-603 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` and `app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 526 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:970 — app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:970-986 | app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:970-986 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` and `app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 526 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×10
  • Duplicated block (22 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/CustomDomainFragment.kt:438 — app/src/main/java/com/celzero/bravedns/ui/fragment/CustomDomainFragment.kt:438-459 | app/src/main/java/com/celzero/bravedns/ui/fragment/CustomIpFragment.kt:396-417 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/fragment/CustomDomainFragment.kt` and `app/src/main/java/com/celzero/bravedns/ui/fragment/CustomIpFragment.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/fragment/CustomDomainFragment.kt:438` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1410 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1410-1431 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1410-1431 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (22 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1492 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1492-1513 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1492-1513 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1492` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1532 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1532-1553 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1532-1553 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1532` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) REDACTED:1837 — REDACTED:1837-1858 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:1837-1858 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (22 lines × 2) app/src/play/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt:101 — app/src/play/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt:101-122 | app/src/website/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt:101-122 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt` and `app/src/website/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 325 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (22 lines × 2) app/src/play/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt:134 — app/src/play/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt:134-155 | app/src/website/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt:134-155 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt` and `app/src/website/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (22 lines × 2) app/src/play/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt:239 — app/src/play/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt:239-260 | app/src/website/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt:239-260 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt` and `app/src/website/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt:239` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (22 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:920 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:920-941 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:920-941 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (22 lines × 2) app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:828 — app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:828-849 | app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:828-849 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` and `app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 526 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×10
  • Duplicated block (20 lines × 2) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnHopManager.kt:111 — app/src/main/java/com/celzero/bravedns/rpnproxy/RpnHopManager.kt:111-130 | app/src/main/java/com/celzero/bravedns/wireguard/WgHopManager.kt:114-133 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/rpnproxy/RpnHopManager.kt` and `app/src/main/java/com/celzero/bravedns/wireguard/WgHopManager.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/rpnproxy/RpnHopManager.kt:111` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (20 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/CustomDomainRulesBtmSheet.kt:148 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/CustomDomainRulesBtmSheet.kt:148-167 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/CustomIpRulesBtmSheet.kt:169-188 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/CustomDomainRulesBtmSheet.kt` and `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/CustomIpRulesBtmSheet.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (20 lines × 2) app/src/main/java/com/celzero/bravedns/viewmodel/EntitlementDetailViewModel.kt:140 — app/src/main/java/com/celzero/bravedns/viewmodel/EntitlementDetailViewModel.kt:140-159 | app/src/main/java/com/celzero/bravedns/viewmodel/ServerSelectionViewModel.kt:205-224 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (20 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1441 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1441-1460 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1441-1460 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (20 lines × 2) REDACTED:235 — REDACTED:235-254 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:235-254 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (20 lines × 2) REDACTED:2082 — REDACTED:2082-2101 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:2082-2101 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (20 lines × 2) REDACTED:3061 — REDACTED:3061-3080 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3061-3080 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (20 lines × 2) app/src/play/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt:219 — app/src/play/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt:219-238 | app/src/website/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt:219-238 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt` and `app/src/website/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (20 lines × 2) app/src/tv/java/com/celzero/bravedns/tv/ui/dns/OdohAddScreen.kt:184 — app/src/tv/java/com/celzero/bravedns/tv/ui/dns/OdohAddScreen.kt:184-203 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgImportScreen.kt:242-261 — before extracting anything, compare `app/src/tv/java/com/celzero/bravedns/tv/ui/dns/OdohAddScreen.kt` and `app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgImportScreen.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (20 lines × 2) app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAddLocationScreen.kt:289 — app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAddLocationScreen.kt:289-308 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnSettingsScreen.kt:356-375 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAddLocationScreen.kt:289` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×9
  • Duplicated block (24 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:319 — app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:319-342 | app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt:156-179 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 195 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:319` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (24 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1114 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1114-1137 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1114-1137 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1114` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (24 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1164 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1164-1187 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1164-1187 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1164` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (24 lines × 2) REDACTED:490 — REDACTED:490-513 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:490-513 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (24 lines × 2) REDACTED:1501 — REDACTED:1501-1524 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:1501-1524 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (24 lines × 2) REDACTED:3447 — REDACTED:3447-3470 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3447-3470 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3447` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (24 lines × 2) REDACTED:3530 — REDACTED:3530-3553 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3530-3553 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (24 lines × 2) REDACTED:3556 — REDACTED:3556-3579 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3556-3579 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (24 lines × 2) REDACTED:3664 — REDACTED:3664-3687 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3664-3687 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×9
  • Duplicated block (23 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:243 — app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:243-265 | app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt:253-275 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 195 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (23 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/ConnectionTrackerFragment.kt:219 — app/src/main/java/com/celzero/bravedns/ui/fragment/ConnectionTrackerFragment.kt:219-241 | app/src/main/java/com/celzero/bravedns/ui/fragment/ConnectionTrackerFragment.kt:275-297 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/fragment/ConnectionTrackerFragment.kt:219` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (23 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:149 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:149-171 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:149-171 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (23 lines × 2) REDACTED:2978 — REDACTED:2978-3000 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:2978-3000 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (23 lines × 2) REDACTED:3505 — REDACTED:3505-3527 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3505-3527 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (23 lines × 2) app/src/play/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt:157 — app/src/play/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt:157-179 | app/src/website/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt:157-179 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt` and `app/src/website/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 103 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (23 lines × 2) app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:228 — app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:228-250 | app/src/website/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:228-250 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt` and `app/src/website/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 326 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (23 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:166 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:166-188 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:166-188 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (23 lines × 2) app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:448 — app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:448-470 | app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:448-470 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` and `app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 526 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×8
  • Duplicated block (29 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:274 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:274-302 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:274-302 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (29 lines × 2) REDACTED:516 — REDACTED:516-544 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:516-544 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (29 lines × 2) REDACTED:1806 — REDACTED:1806-1834 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:1806-1834 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1806` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (29 lines × 2) REDACTED:1875 — REDACTED:1875-1903 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:1875-1903 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (29 lines × 2) REDACTED:2116 — REDACTED:2116-2144 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:2116-2144 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (29 lines × 2) REDACTED:2165 — REDACTED:2165-2193 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:2165-2193 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (29 lines × 2) app/src/play/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:235 — app/src/play/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:235-263 | app/src/website/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:235-263 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt` and `app/src/website/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 245 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (29 lines × 2) app/src/play/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt:99 — app/src/play/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt:99-127 | app/src/website/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt:99-127 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt` and `app/src/website/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 185 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×7
  • Duplicated block (26 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:368 — app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:368-393 | app/src/main/java/com/celzero/bravedns/adapter/RethinkLogAdapter.kt:265-290 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/RethinkLogAdapter.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 225 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:368` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (26 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:378 — app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:378-403 | app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt:319-344 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 195 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (26 lines × 2) REDACTED:1971 — REDACTED:1971-1996 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:1971-1996 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (26 lines × 2) REDACTED:2257 — REDACTED:2257-2282 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:2257-2282 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (26 lines × 2) REDACTED:3404 — REDACTED:3404-3429 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3404-3429 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3404` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (26 lines × 2) app/src/play/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt:227 — app/src/play/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt:227-252 | app/src/website/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt:227-252 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt` and `app/src/website/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 185 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (26 lines × 2) app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:625 — app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:625-650 | app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:625-650 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` and `app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 526 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D35 · Change Coupling · Change coupling · ×6
  • Change coupling: ConnectionTrackerRepository.kt ↔ DnsLogRepository.kt app/src/main/java/com/celzero/bravedns/database/ConnectionTrackerRepository.kt:1 — `app/src/main/java/com/celzero/bravedns/database/ConnectionTrackerRepository.kt` and `app/src/main/java/com/celzero/bravedns/database/DnsLogRepository.kt` change together 80% of the time (8 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `40a5957b` ui: home screen stats histogram on apps; `d03958f2` ui: revamp log aggregator btm sheet ui; `5c42c595` db: dao/repo new or changes for log aggrgator — run `git show` on any of them.
  • Change coupling: RethinkLocalFileTagDao.kt ↔ RethinkRemoteFileTagDao.kt app/src/main/java/com/celzero/bravedns/database/RethinkLocalFileTagDao.kt:1 — `app/src/main/java/com/celzero/bravedns/database/RethinkLocalFileTagDao.kt` and `app/src/main/java/com/celzero/bravedns/database/RethinkRemoteFileTagDao.kt` change together 73% of the time (8 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `b2731c20` rethink blocklists screen ui revamp; `42c59a9a` checkpoint and vacuum on single dao; `5bddfec0` configure blocklist ui changes — run `git show` on any of them.
  • Change coupling: ConnectionTrackerFragment.kt ↔ RethinkLogFragment.kt app/src/main/java/com/celzero/bravedns/ui/fragment/ConnectionTrackerFragment.kt:1 — `app/src/main/java/com/celzero/bravedns/ui/fragment/ConnectionTrackerFragment.kt` and `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkLogFragment.kt` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `b2cc8be9` Fix: #1664; add state flow to handle search with delay (at that commit the files were still `app/src/full/java/com/celzero/bravedns/ui/fragment/ConnectionTrackerFragment.kt` and `app/src/full/java/com/celzero/bravedns/ui/fragment/RethinkLogFragment.kt`); `519a7634` fix: #1939: workaround to restart the IME process (at that commit the files were still `app/src/full/java/com/celzero/bravedns/ui/fragment/ConnectionTrackerFragment.kt` and `app/src/full/java/com/celzero/bravedns/ui/fragment/RethinkLogFragment.kt`); `189f8f0f` ui: add consistent behavior in search option in logs (at that commit the files were still `app/src/full/java/com/celzero/bravedns/ui/fragment/ConnectionTrackerFragment.kt` and `app/src/full/java/com/celzero/bravedns/ui/fragment/RethinkLogFragment.kt`) — run `git show` on any of them.
  • Change coupling: ProxyAppMappingRepository.kt ↔ RefreshDatabase.kt app/src/main/java/com/celzero/bravedns/database/ProxyAppMappingRepository.kt:1 — `app/src/main/java/com/celzero/bravedns/database/ProxyAppMappingRepository.kt` and `app/src/main/java/com/celzero/bravedns/database/RefreshDatabase.kt` change together 54% of the time (7 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `13ac75d9` impl: handle db failures gracefully-constratint ex; `4d58eec9` proxy: fix app-proxy mapping list; `96b8c4dd` app: tombstone apps feature behind a setting — run `git show` on any of them.
  • Change coupling: SummaryStatisticsAdapter.kt ↔ DetailedStatisticsViewModel.kt app/src/main/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt:1 — `app/src/main/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt` and `app/src/main/java/com/celzero/bravedns/viewmodel/DetailedStatisticsViewModel.kt` change together 53% of the time (8 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `f90ee68a` ui: stats screen filter, new blocklists stats; `0725de1e` stats: add active conns list and pagination for other lists (at that commit the files were still `app/src/full/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt` and `app/src/full/java/com/celzero/bravedns/viewmodel/DetailedStatisticsViewModel.kt`); `dd2f29cc` ui: stats for most contacted and blocked asn (at that commit the files were still `app/src/full/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt` and `app/src/full/java/com/celzero/bravedns/viewmodel/DetailedStatisticsViewModel.kt`) — run `git show` on any of them.
  • Change coupling: CustomDomainAdapter.kt ↔ CustomIp.kt app/src/main/java/com/celzero/bravedns/adapter/CustomDomainAdapter.kt:1 — `app/src/main/java/com/celzero/bravedns/adapter/CustomDomainAdapter.kt` and `app/src/main/java/com/celzero/bravedns/database/CustomIp.kt` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `3516126c` ui: issue fix for multi selection delete & changing the app rule need… (at that commit the file was still `app/src/full/java/com/celzero/bravedns/adapter/CustomDomainAdapter.kt`); `b37a6beb` ui: add btmsht for selecting proxy/country forwarding (at that commit the file was still `app/src/full/java/com/celzero/bravedns/adapter/CustomDomainAdapter.kt`); `fd66e9c0` ui: improvements in recycler view's DIFF_CALLBACK (at that commit the file was still `app/src/full/java/com/celzero/bravedns/adapter/CustomDomainAdapter.kt`) — run `git show` on any of them.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×6
  • Duplicated block (11 lines × 3) app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:267 — app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:267-277 | app/src/main/java/com/celzero/bravedns/adapter/DnsLogAdapter.kt:528-538 | app/src/main/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt:781-791 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:267` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 3) app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:418 — app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:418-428 | app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt:354-364 | app/src/main/java/com/celzero/bravedns/adapter/RethinkLogAdapter.kt:309-319 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:418` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) app/src/main/java/com/celzero/bravedns/database/RefreshDatabase.kt:760 — app/src/main/java/com/celzero/bravedns/database/RefreshDatabase.kt:760-770 | app/src/main/java/com/celzero/bravedns/database/RefreshDatabase.kt:847-857 | app/src/main/java/com/celzero/bravedns/database/RefreshDatabase.kt:973-983 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (11 lines × 3) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt:299 — app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt:299-309 | app/src/main/java/com/celzero/bravedns/adapter/DnsProxyEndpointAdapter.kt:306-316 | app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:523-533 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/celzero/bravedns/adapter/DnsProxyEndpointAdapter.kt:318` calls `io`, `suspend`, `withContext` and `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt:310` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 3) app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:218 — app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:218-228 | app/src/main/java/com/celzero/bravedns/adapter/DohEndpointAdapter.kt:222-232 | app/src/main/java/com/celzero/bravedns/adapter/ODoHEndpointAdapter.kt:211-221 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/DohEndpointAdapter.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 149 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `endpoint` to `DoTEndpoint` in one and `DoHEndpoint` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (11 lines × 3) app/src/main/java/com/celzero/bravedns/ui/activity/AppInfoActivity.kt:1853 — app/src/main/java/com/celzero/bravedns/ui/activity/AppInfoActivity.kt:1853-1863 | app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt:238-248 | app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseIpLogsActivity.kt:210-220 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×6
  • Duplicated block (8 lines × 4) app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:143 — app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:143-150 | app/src/main/java/com/celzero/bravedns/adapter/LocalSimpleViewAdapter.kt:183-190 | app/src/main/java/com/celzero/bravedns/adapter/RemoteAdvancedViewAdapter.kt:195-202 | app/src/main/java/com/celzero/bravedns/adapter/RemoteSimpleViewAdapter.kt:182-189 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/LocalSimpleViewAdapter.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:143` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 4) app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:194 — app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:194-201 | app/src/main/java/com/celzero/bravedns/adapter/LocalSimpleViewAdapter.kt:170-177 | app/src/main/java/com/celzero/bravedns/adapter/RemoteAdvancedViewAdapter.kt:144-151 | app/src/main/java/com/celzero/bravedns/adapter/RemoteSimpleViewAdapter.kt:169-176 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/LocalSimpleViewAdapter.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:194` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 4) app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:1732 — app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:1732-1739 | app/src/main/java/com/celzero/bravedns/ui/fragment/DnsProxyListFragment.kt:153-160 | app/src/main/java/com/celzero/bravedns/ui/fragment/DoTListFragment.kt:129-136 | app/src/main/java/com/celzero/bravedns/ui/fragment/DohListFragment.kt:138-145 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/fragment/DoTListFragment.kt` and `app/src/main/java/com/celzero/bravedns/ui/fragment/DohListFragment.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/celzero/bravedns/ui/fragment/DnsProxyListFragment.kt:163` calls `setSoftInputMode` and `app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:1740` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 4) app/src/tv/java/com/celzero/bravedns/tv/ui/dns/DnsScreen.kt:475 — app/src/tv/java/com/celzero/bravedns/tv/ui/dns/DnsScreen.kt:475-482 | app/src/tv/java/com/celzero/bravedns/tv/ui/dns/OdohAddScreen.kt:187-194 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/ProxyScreen.kt:209-216 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgImportScreen.kt:245-252 — before extracting anything, compare `app/src/tv/java/com/celzero/bravedns/tv/ui/dns/DnsScreen.kt` and `app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/ProxyScreen.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/dns/DnsScreen.kt:475` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 4) app/src/main/java/com/celzero/bravedns/service/BraveTileService.kt:87 — app/src/main/java/com/celzero/bravedns/service/BraveTileService.kt:87-94 | app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:1043-1050 | app/src/main/java/com/celzero/bravedns/ui/HomeScreenActivity.kt:192-199 | app/src/main/java/com/celzero/bravedns/ui/activity/AppLockActivity.kt:190-197 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 4) app/src/main/java/com/celzero/bravedns/ui/HomeScreenActivity.kt:362 — app/src/main/java/com/celzero/bravedns/ui/HomeScreenActivity.kt:362-369 | app/src/main/java/com/celzero/bravedns/ui/activity/CustomRulesActivity.kt:139-146 | app/src/main/java/com/celzero/bravedns/ui/activity/FirewallActivity.kt:106-113 | app/src/main/java/com/celzero/bravedns/ui/activity/NetworkLogsActivity.kt:243-250 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/activity/CustomRulesActivity.kt` and `app/src/main/java/com/celzero/bravedns/ui/activity/NetworkLogsActivity.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/celzero/bravedns/ui/activity/CustomRulesActivity.kt:134` calls `setCurrentItem` and `app/src/main/java/com/celzero/bravedns/ui/activity/FirewallActivity.kt:101` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×5
  • Duplicated block (31 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:309 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:309-339 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:309-339 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (31 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:792 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:792-822 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:792-822 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:792` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (31 lines × 2) REDACTED:3103 — REDACTED:3103-3133 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3103-3133 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (31 lines × 2) app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:256 — app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:256-286 | app/src/website/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:256-286 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt` and `app/src/website/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 326 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (31 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/DoTListFragment.kt:74 — app/src/main/java/com/celzero/bravedns/ui/fragment/DoTListFragment.kt:74-104 | app/src/main/java/com/celzero/bravedns/ui/fragment/ODoHListFragment.kt:76-106 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/fragment/DoTListFragment.kt` and `app/src/main/java/com/celzero/bravedns/ui/fragment/ODoHListFragment.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/celzero/bravedns/ui/fragment/ODoHListFragment.kt:110` calls `bringToFront` and `app/src/main/java/com/celzero/bravedns/ui/fragment/DoTListFragment.kt:107` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×5
  • Duplicated block (25 lines × 2) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnHopManager.kt:145 — app/src/main/java/com/celzero/bravedns/rpnproxy/RpnHopManager.kt:145-169 | app/src/main/java/com/celzero/bravedns/wireguard/WgHopManager.kt:148-172 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/rpnproxy/RpnHopManager.kt` and `app/src/main/java/com/celzero/bravedns/wireguard/WgHopManager.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/rpnproxy/RpnHopManager.kt:145` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (25 lines × 2) REDACTED:1906 — REDACTED:1906-1930 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:1906-1930 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (25 lines × 2) REDACTED:3694 — REDACTED:3694-3718 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3694-3718 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (25 lines × 2) app/src/play/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt:84 — app/src/play/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt:84-108 | app/src/website/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt:84-108 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt` and `app/src/website/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 103 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (25 lines × 2) app/src/play/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:76 — app/src/play/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:76-100 | app/src/website/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:76-100 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt` and `app/src/website/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 245 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×5
  • Duplicated block (12 lines × 3) app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:384 — app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:384-395 | app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt:319-330 | app/src/main/java/com/celzero/bravedns/adapter/RethinkLogAdapter.kt:281-292 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:384` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) app/src/main/java/com/celzero/bravedns/customdownloader/LocalBlocklistCoordinator.kt:588 — app/src/main/java/com/celzero/bravedns/customdownloader/LocalBlocklistCoordinator.kt:588-599 | app/src/main/java/com/celzero/bravedns/customdownloader/LocalBlocklistCoordinator.kt:604-615 | app/src/main/java/com/celzero/bravedns/customdownloader/LocalBlocklistCoordinator.kt:620-631 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/customdownloader/LocalBlocklistCoordinator.kt:588` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt:994 — app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt:994-1005 | app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt:1030-1041 | app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt:1102-1113 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt:994` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt:1100` calls `i`, `updateSsids` and `app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt:1026` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 3) app/src/tv/java/com/celzero/bravedns/tv/ui/logs/LogsScreen.kt:567 — app/src/tv/java/com/celzero/bravedns/tv/ui/logs/LogsScreen.kt:567-580 | app/src/tv/java/com/celzero/bravedns/tv/ui/rules/CustomDomainRulesList.kt:155-168 | app/src/tv/java/com/celzero/bravedns/tv/ui/stats/StatsScreen.kt:327-338 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (12 lines × 3) app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:237 — app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:237-248 | app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:287-298 | app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:330-341 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:237` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (34 lines × 2) · ×4
  • Duplicated block (34 lines × 2) REDACTED:1465 — REDACTED:1465-1498 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:1465-1498 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (34 lines × 2) REDACTED:3240 — REDACTED:3240-3273 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3240-3273 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (34 lines × 2) app/src/play/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt:267 — app/src/play/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt:267-300 | app/src/website/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt:267-300 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt` and `app/src/website/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 325 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (34 lines × 2) app/src/play/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:189 — app/src/play/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:189-222 | app/src/website/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:189-222 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt` and `app/src/website/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 245 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:189` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×4
  • Duplicated block (28 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/LocalSimpleViewAdapter.kt:118 — app/src/main/java/com/celzero/bravedns/adapter/LocalSimpleViewAdapter.kt:118-145 | app/src/main/java/com/celzero/bravedns/adapter/RemoteSimpleViewAdapter.kt:117-144 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/LocalSimpleViewAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/RemoteSimpleViewAdapter.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `map` to `LocalBlocklistPacksMap` in one and `RemoteBlocklistPacksMap` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (28 lines × 2) app/src/play/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt:45 — app/src/play/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt:45-72 | app/src/website/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt:45-72 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt` and `app/src/website/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (28 lines × 2) app/src/play/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt:153 — app/src/play/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt:153-180 | app/src/website/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt:153-180 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt` and `app/src/website/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (28 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:540 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:540-567 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:540-567 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×4
  • Duplicated block (27 lines × 2) REDACTED:1717 — REDACTED:1717-1743 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:1717-1743 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (27 lines × 2) REDACTED:3160 — REDACTED:3160-3186 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3160-3186 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3160` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (27 lines × 2) app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:53 — app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:53-79 | app/src/website/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:53-79 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt` and `app/src/website/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 326 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (27 lines × 2) app/src/play/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt:70 — app/src/play/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt:70-96 | app/src/website/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt:70-96 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt` and `app/src/website/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 185 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×4
  • Duplicated block (21 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:149 — app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:149-169 | app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:150-170 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 168 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (21 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt:182 — app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt:182-202 | app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseIpLogsActivity.kt:141-161 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt` and `app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseIpLogsActivity.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt:182` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:178 — app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:178-198 | app/src/website/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:178-198 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt` and `app/src/website/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 326 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (21 lines × 2) app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:479 — app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:479-499 | app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:479-499 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` and `app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 526 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×4
  • Duplicated block (10 lines × 3) app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:323 — app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:323-332 | app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:508-517 | app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt:672-681 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 168 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 3) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:639 — app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:639-648 | app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:436-445 | app/src/website/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:436-445 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt` and `app/src/website/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 326 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:639` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:226 — app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:226-235 | app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:276-285 | app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:319-328 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:226` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 3) app/src/main/java/com/celzero/bravedns/ui/NotificationHandlerActivity.kt:219 — app/src/main/java/com/celzero/bravedns/ui/NotificationHandlerActivity.kt:219-228 | app/src/main/java/com/celzero/bravedns/ui/NotificationHandlerActivity.kt:258-267 | app/src/main/java/com/celzero/bravedns/ui/NotificationHandlerActivity.kt:305-314 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/NotificationHandlerActivity.kt:219` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (5 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:258 — app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:258-283 | app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt:172-195 | app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:259-280 | app/src/main/java/com/celzero/bravedns/adapter/DohEndpointAdapter.kt:261-279 | app/src/main/java/com/celzero/bravedns/adapter/ODoHEndpointAdapter.kt:263-284 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:285 — app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:285-301 | app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt:197-213 | app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:282-297 | app/src/main/java/com/celzero/bravedns/adapter/DohEndpointAdapter.kt:281-296 | app/src/main/java/com/celzero/bravedns/adapter/ODoHEndpointAdapter.kt:286-301 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:323 — app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:323-349 | app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt:263-289 | app/src/main/java/com/celzero/bravedns/adapter/DnsProxyEndpointAdapter.kt:160-186 | app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:314-340 | app/src/main/java/com/celzero/bravedns/adapter/ODoHEndpointAdapter.kt:318-344 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Duplicated block (40 lines × 2) · ×3
  • Duplicated block (40 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:620 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:620-659 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:620-659 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (40 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:783 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:783-822 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:783-822 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (40 lines × 2) app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:333 — app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:333-372 | app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:333-372 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` and `app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 526 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (37 lines × 2) · ×3
  • Duplicated block (37 lines × 2) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnHopManager.kt:44 — app/src/main/java/com/celzero/bravedns/rpnproxy/RpnHopManager.kt:44-80 | app/src/main/java/com/celzero/bravedns/wireguard/WgHopManager.kt:47-83 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/rpnproxy/RpnHopManager.kt` and `app/src/main/java/com/celzero/bravedns/wireguard/WgHopManager.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (37 lines × 2) app/src/play/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt:67 — app/src/play/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt:67-103 | app/src/website/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt:67-103 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt` and `app/src/website/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (37 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:318 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:318-354 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:318-354 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (36 lines × 2) · ×3
  • Duplicated block (36 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/CustomIpAdapter.kt:243 — app/src/main/java/com/celzero/bravedns/adapter/CustomIpAdapter.kt:243-278 | app/src/main/java/com/celzero/bravedns/adapter/CustomIpAdapter.kt:425-460 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/celzero/bravedns/adapter/CustomIpAdapter.kt:280` calls `openAppWiseRulesActivity` and `app/src/main/java/com/celzero/bravedns/adapter/CustomIpAdapter.kt:462` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (36 lines × 2) REDACTED:3022 — REDACTED:3022-3057 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3022-3057 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (36 lines × 2) app/src/play/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt:136 — app/src/play/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt:136-171 | app/src/website/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt:136-171 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt` and `app/src/website/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 325 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (35 lines × 2) · ×3
  • Duplicated block (35 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:424 — app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:424-458 | app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt:365-399 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 195 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:424` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (35 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:225 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:225-259 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:225-259 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (35 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:503 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:503-537 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:503-537 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×3
  • Duplicated block (16–17 lines × 2) app/src/main/java/com/celzero/bravedns/service/NetworkLifecycleObserver.kt:103 — app/src/main/java/com/celzero/bravedns/service/NetworkLifecycleObserver.kt:103-118 | app/src/main/java/com/celzero/bravedns/service/NetworkLifecycleObserver.kt:121-137 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/service/NetworkLifecycleObserver.kt:121` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16–17 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/DnsBlocklistBottomSheet.kt:920 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/DnsBlocklistBottomSheet.kt:920-935 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/DnsBlocklistBottomSheet.kt:954-970 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/DnsBlocklistBottomSheet.kt:920` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (16–17 lines × 2) app/src/main/java/com/celzero/bravedns/util/GoMemoryProfiler.kt:56 — app/src/main/java/com/celzero/bravedns/util/GoMemoryProfiler.kt:56-71 | app/src/main/java/com/celzero/bravedns/util/MemoryProfiler.kt:43-59 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/util/GoMemoryProfiler.kt:56` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×3
  • Duplicated block (7 lines × 3) app/src/main/java/com/celzero/bravedns/database/RefreshDatabase.kt:776 — app/src/main/java/com/celzero/bravedns/database/RefreshDatabase.kt:776-783 | app/src/main/java/com/celzero/bravedns/database/RefreshDatabase.kt:863-870 | app/src/main/java/com/celzero/bravedns/database/RefreshDatabase.kt:937-943 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 3) app/src/tv/java/com/celzero/bravedns/tv/ui/dns/OdohAddScreen.kt:214 — app/src/tv/java/com/celzero/bravedns/tv/ui/dns/OdohAddScreen.kt:214-220 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgImportScreen.kt:272-278 | app/src/tv/java/com/celzero/bravedns/tv/ui/settings/PauseVpnScreen.kt:220-226 — before extracting anything, compare `app/src/tv/java/com/celzero/bravedns/tv/ui/dns/OdohAddScreen.kt` and `app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgImportScreen.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/dns/OdohAddScreen.kt:214` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7 lines × 3) app/src/main/java/com/celzero/bravedns/ui/activity/AppListActivity.kt:624 — app/src/main/java/com/celzero/bravedns/ui/activity/AppListActivity.kt:624-630 | app/src/main/java/com/celzero/bravedns/ui/activity/RpnBypassAppsActivity.kt:183-190 | app/src/main/java/com/celzero/bravedns/ui/activity/WgIncludeAppsActivity.kt:201-209 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (5 lines × 5) · ×3
  • Duplicated block (5 lines × 5) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:263 — app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:263-272 | app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt:177-186 | app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:263-271 | app/src/main/java/com/celzero/bravedns/adapter/DohEndpointAdapter.kt:266-270 | app/src/main/java/com/celzero/bravedns/adapter/ODoHEndpointAdapter.kt:267-275 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:263` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 5) app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:809 — app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:809-813 | app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:1733-1737 | app/src/main/java/com/celzero/bravedns/ui/fragment/DnsProxyListFragment.kt:154-158 | app/src/main/java/com/celzero/bravedns/ui/fragment/DoTListFragment.kt:130-134 | app/src/main/java/com/celzero/bravedns/ui/fragment/DohListFragment.kt:139-143 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/fragment/DoTListFragment.kt` and `app/src/main/java/com/celzero/bravedns/ui/fragment/DohListFragment.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/celzero/bravedns/ui/fragment/DnsProxyListFragment.kt:163` calls `setSoftInputMode` and `app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:1740` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 5) app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:309 — app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:309-314 | app/src/tv/java/com/celzero/bravedns/tv/ui/dns/OdohAddScreen.kt:195-199 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgImportScreen.kt:253-257 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt:335-340 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAppsScreen.kt:248-253 — before extracting anything, compare `app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt` and `app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 189 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:309` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×3
  • Outbound HTTP without resilience app/src/fdroid/java/com/celzero/bravedns/iab/stripe/RetrofitInstance.kt:22 — `Retrofit.Builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/src/fdroid/java/com/celzero/bravedns/iab/stripe/RetrofitInstance.kt:44 — `Retrofit.Builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience app/src/main/java/com/celzero/bravedns/customdownloader/IpInfoDownloader.kt:86 — `Retrofit.Builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
D1 · Cyclomatic Complexity · InAppBillingHandler.handlePurchaseInternal (cyclomatic 70) · ×2
  • InAppBillingHandler.handlePurchaseInternal (cyclomatic 70) REDACTED:926 — InAppBillingHandler.handlePurchaseInternal has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • InAppBillingHandler.handlePurchaseInternal (cyclomatic 70) app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:926 — InAppBillingHandler.handlePurchaseInternal has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RpnPurchaseRouteKt.RpnPurchaseRoute (cyclomatic 29) · ×2
  • RpnPurchaseRouteKt.RpnPurchaseRoute (cyclomatic 29) app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:72 — RpnPurchaseRouteKt.RpnPurchaseRoute has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • RpnPurchaseRouteKt.RpnPurchaseRoute (cyclomatic 29) app/src/websiteTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:72 — RpnPurchaseRouteKt.RpnPurchaseRoute has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SubscriptionCheckWorker.resolveEntitlementExpiry (cyclomatic 21) · ×2
  • SubscriptionCheckWorker.resolveEntitlementExpiry (cyclomatic 21) app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:303 — SubscriptionCheckWorker.resolveEntitlementExpiry has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • SubscriptionCheckWorker.resolveEntitlementExpiry (cyclomatic 21) app/src/website/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:303 — SubscriptionCheckWorker.resolveEntitlementExpiry has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InAppBillingHandler.validateSubsWithServerBeforeExpiry (cyclomatic 20) · ×2
  • InAppBillingHandler.validateSubsWithServerBeforeExpiry (cyclomatic 20) REDACTED:3802 — InAppBillingHandler.validateSubsWithServerBeforeExpiry has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • InAppBillingHandler.validateSubsWithServerBeforeExpiry (cyclomatic 20) app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3802 — InAppBillingHandler.validateSubsWithServerBeforeExpiry has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BillingBackendClient.refreshIdentityLocked (cyclomatic 18) · ×2
  • BillingBackendClient.refreshIdentityLocked (cyclomatic 18) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:685 — BillingBackendClient.refreshIdentityLocked has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • BillingBackendClient.refreshIdentityLocked (cyclomatic 18) app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:685 — BillingBackendClient.refreshIdentityLocked has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · OneTimePurchaseProcessor.processInAppPurchased (cyclomatic 17) · ×2
  • OneTimePurchaseProcessor.processInAppPurchased (cyclomatic 17) app/src/play/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt:302 — OneTimePurchaseProcessor.processInAppPurchased has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • OneTimePurchaseProcessor.processInAppPurchased (cyclomatic 17) app/src/website/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt:302 — OneTimePurchaseProcessor.processInAppPurchased has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · BillingBackendClient.executeAckWithRetry (cyclomatic 16) · ×2
  • BillingBackendClient.executeAckWithRetry (cyclomatic 16) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:889 — BillingBackendClient.executeAckWithRetry has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • BillingBackendClient.executeAckWithRetry (cyclomatic 16) app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:889 — BillingBackendClient.executeAckWithRetry has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BillingBackendClient.queryEntitlement (cyclomatic 16) · ×2
  • BillingBackendClient.queryEntitlement (cyclomatic 16) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1003 — BillingBackendClient.queryEntitlement has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • BillingBackendClient.queryEntitlement (cyclomatic 16) app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1003 — BillingBackendClient.queryEntitlement has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · InAppBillingHandler.purchaseOneTime (cyclomatic 16) · ×2
  • InAppBillingHandler.purchaseOneTime (cyclomatic 16) REDACTED:2716 — InAppBillingHandler.purchaseOneTime has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • InAppBillingHandler.purchaseOneTime (cyclomatic 16) app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:2716 — InAppBillingHandler.purchaseOneTime has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · InAppBillingHandler.launchFlow (cyclomatic 16) · ×2
  • InAppBillingHandler.launchFlow (cyclomatic 16) REDACTED:2797 — InAppBillingHandler.launchFlow has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • InAppBillingHandler.launchFlow (cyclomatic 16) app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:2797 — InAppBillingHandler.launchFlow has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D2 · Cognitive Complexity · InAppBillingHandler.handlePurchaseInternal (cognitive 203) · ×2
  • InAppBillingHandler.handlePurchaseInternal (cognitive 203) REDACTED:926 — InAppBillingHandler.handlePurchaseInternal has cognitive complexity 203 (threshold 15). Drivers by points: if/else 49 (146 pts), error handling 9 (34 pts), match/switch 3 (9 pts), boolean chains 8, loops 2 (6 pts) (nesting depth added 132). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • InAppBillingHandler.handlePurchaseInternal (cognitive 203) app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:926 — InAppBillingHandler.handlePurchaseInternal has cognitive complexity 203 (threshold 15). Drivers by points: if/else 49 (146 pts), error handling 9 (34 pts), match/switch 3 (9 pts), boolean chains 8, loops 2 (6 pts) (nesting depth added 132). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SubscriptionCheckWorker.resolveEntitlementExpiry (cognitive 35) · ×2
  • SubscriptionCheckWorker.resolveEntitlementExpiry (cognitive 35) app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:303 — SubscriptionCheckWorker.resolveEntitlementExpiry has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (24 pts), error handling 3 (6 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • SubscriptionCheckWorker.resolveEntitlementExpiry (cognitive 35) app/src/website/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:303 — SubscriptionCheckWorker.resolveEntitlementExpiry has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (24 pts), error handling 3 (6 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · RpnPurchaseRouteKt.RpnPurchaseRoute (cognitive 28) · ×2
  • RpnPurchaseRouteKt.RpnPurchaseRoute (cognitive 28) app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:72 — RpnPurchaseRouteKt.RpnPurchaseRoute has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 3, match/switch 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • RpnPurchaseRouteKt.RpnPurchaseRoute (cognitive 28) app/src/websiteTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:72 — RpnPurchaseRouteKt.RpnPurchaseRoute has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 3, match/switch 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BillingBackendClient.executeAckWithRetry (cognitive 27) · ×2
  • BillingBackendClient.executeAckWithRetry (cognitive 27) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:889 — BillingBackendClient.executeAckWithRetry has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), error handling 4 (8 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • BillingBackendClient.executeAckWithRetry (cognitive 27) app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:889 — BillingBackendClient.executeAckWithRetry has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), error handling 4 (8 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InAppBillingHandler.purchaseSubs (cognitive 26) · ×2
  • InAppBillingHandler.purchaseSubs (cognitive 26) REDACTED:2618 — InAppBillingHandler.purchaseSubs has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), error handling 5 (9 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • InAppBillingHandler.purchaseSubs (cognitive 26) app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:2618 — InAppBillingHandler.purchaseSubs has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), error handling 5 (9 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InAppBillingHandler.validateSubsWithServerBeforeExpiry (cognitive 26) · ×2
  • InAppBillingHandler.validateSubsWithServerBeforeExpiry (cognitive 26) REDACTED:3802 — InAppBillingHandler.validateSubsWithServerBeforeExpiry has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (16 pts), error handling 3 (5 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • InAppBillingHandler.validateSubsWithServerBeforeExpiry (cognitive 26) app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3802 — InAppBillingHandler.validateSubsWithServerBeforeExpiry has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (16 pts), error handling 3 (5 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BillingBackendClient.refreshIdentityLocked (cognitive 25) · ×2
  • BillingBackendClient.refreshIdentityLocked (cognitive 25) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:685 — BillingBackendClient.refreshIdentityLocked has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (16 pts), match/switch 2 (4 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • BillingBackendClient.refreshIdentityLocked (cognitive 25) app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:685 — BillingBackendClient.refreshIdentityLocked has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (16 pts), match/switch 2 (4 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · InAppBillingHandler.purchaseOneTime (cognitive 25) · ×2
  • InAppBillingHandler.purchaseOneTime (cognitive 25) REDACTED:2716 — InAppBillingHandler.purchaseOneTime has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 5 (9 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • InAppBillingHandler.purchaseOneTime (cognitive 25) app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:2716 — InAppBillingHandler.purchaseOneTime has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 5 (9 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InAppBillingHandler.launchFlow (cognitive 21) · ×2
  • InAppBillingHandler.launchFlow (cognitive 21) REDACTED:2797 — InAppBillingHandler.launchFlow has cognitive complexity 21 (threshold 15). Drivers by points: error handling 7 (13 pts), if/else 7, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • InAppBillingHandler.launchFlow (cognitive 21) app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:2797 — InAppBillingHandler.launchFlow has cognitive complexity 21 (threshold 15). Drivers by points: error handling 7 (13 pts), if/else 7, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OneTimePurchaseProcessor.processInAppPurchased (cognitive 21) · ×2
  • OneTimePurchaseProcessor.processInAppPurchased (cognitive 21) app/src/play/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt:302 — OneTimePurchaseProcessor.processInAppPurchased has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (12 pts), error handling 3 (6 pts), match/switch 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • OneTimePurchaseProcessor.processInAppPurchased (cognitive 21) app/src/website/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt:302 — OneTimePurchaseProcessor.processInAppPurchased has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (12 pts), error handling 3 (6 pts), match/switch 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · InAppBillingHandler.queryPurchases (cognitive 20) · ×2
  • InAppBillingHandler.queryPurchases (cognitive 20) REDACTED:2195 — InAppBillingHandler.queryPurchases has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (15 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • InAppBillingHandler.queryPurchases (cognitive 20) app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:2195 — InAppBillingHandler.queryPurchases has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (15 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SubscriptionPurchaseProcessor.processSubsPurchased (cognitive 19) · ×2
  • SubscriptionPurchaseProcessor.processSubsPurchased (cognitive 19) app/src/play/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:265 — SubscriptionPurchaseProcessor.processSubsPurchased has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, error handling 3 (5 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • SubscriptionPurchaseProcessor.processSubsPurchased (cognitive 19) app/src/website/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:265 — SubscriptionPurchaseProcessor.processSubsPurchased has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11, error handling 3 (5 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SubscriptionPlansViewHolder.bind (cognitive 18) · ×2
  • SubscriptionPlansViewHolder.bind (cognitive 18) REDACTED:139 — SubscriptionPlansViewHolder.bind has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 3, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • SubscriptionPlansViewHolder.bind (cognitive 18) app/src/website/java/com/celzero/bravedns/adapter/GooglePlaySubsAdapter.kt:139 — SubscriptionPlansViewHolder.bind has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 3, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · InAppBillingHandler.reconcilePurchase (cognitive 18) · ×2
  • InAppBillingHandler.reconcilePurchase (cognitive 18) REDACTED:1604 — InAppBillingHandler.reconcilePurchase has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 pts), error handling 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • InAppBillingHandler.reconcilePurchase (cognitive 18) app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:1604 — InAppBillingHandler.reconcilePurchase has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 pts), error handling 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InAppBillingHandler.processProductList (cognitive 17) · ×2
  • InAppBillingHandler.processProductList (cognitive 17) REDACTED:2371 — InAppBillingHandler.processProductList has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • InAppBillingHandler.processProductList (cognitive 17) app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:2371 — InAppBillingHandler.processProductList has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InAppBillingHandler.queryEntitlementFromServer (cognitive 16) · ×2
  • InAppBillingHandler.queryEntitlementFromServer (cognitive 16) REDACTED:3581 — InAppBillingHandler.queryEntitlementFromServer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 1 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • InAppBillingHandler.queryEntitlementFromServer (cognitive 16) app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3581 — InAppBillingHandler.queryEntitlementFromServer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 1 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (81 lines × 2) · ×2
  • Duplicated block (81 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:686 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:686-766 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:686-766 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (81 lines × 2) app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:203 — app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:203-283 | app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:203-283 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` and `app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 526 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (75 lines × 2) · ×2
  • Duplicated block (75 lines × 2) REDACTED:2717 — REDACTED:2717-2791 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:2717-2791 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (75 lines × 2) REDACTED:3582 — REDACTED:3582-3656 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3582-3656 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (63 lines × 2) · ×2
  • Duplicated block (63 lines × 2) app/src/play/java/com/celzero/bravedns/iab/DeviceNotRegisteredNotifier.kt:66 — app/src/play/java/com/celzero/bravedns/iab/DeviceNotRegisteredNotifier.kt:66-128 | app/src/website/java/com/celzero/bravedns/iab/DeviceNotRegisteredNotifier.kt:66-128 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/DeviceNotRegisteredNotifier.kt` and `app/src/website/java/com/celzero/bravedns/iab/DeviceNotRegisteredNotifier.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (63 lines × 2) app/src/play/java/com/celzero/bravedns/iab/PurchaseConflictNotifier.kt:78 — app/src/play/java/com/celzero/bravedns/iab/PurchaseConflictNotifier.kt:78-140 | app/src/website/java/com/celzero/bravedns/iab/PurchaseConflictNotifier.kt:78-140 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/PurchaseConflictNotifier.kt` and `app/src/website/java/com/celzero/bravedns/iab/PurchaseConflictNotifier.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 99 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (52 lines × 2) · ×2
  • Duplicated block (52 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1209 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1209-1260 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1209-1260 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1209` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (52 lines × 2) app/src/play/java/com/celzero/bravedns/iab/Result.kt:47 — app/src/play/java/com/celzero/bravedns/iab/Result.kt:47-98 | app/src/website/java/com/celzero/bravedns/iab/Result.kt:47-98 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/Result.kt` and `app/src/website/java/com/celzero/bravedns/iab/Result.kt` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (48 lines × 2) · ×2
  • Duplicated block (48 lines × 2) REDACTED:401 — REDACTED:401-448 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:401-448 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (48 lines × 2) app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:108 — app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:108-155 | app/src/website/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:108-155 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt` and `app/src/website/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 326 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (45 lines × 2) · ×2
  • Duplicated block (45 lines × 2) REDACTED:3301 — REDACTED:3301-3345 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3301-3345 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (45 lines × 2) app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:327 — app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:327-371 | app/src/websiteTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:327-371 — before extracting anything, compare `app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt` and `app/src/websiteTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 322 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (39 lines × 2) · ×2
  • Duplicated block (39 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:380 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:380-418 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:380-418 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (39 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:273 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:273-311 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:273-311 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (30 lines × 2) · ×2
  • Duplicated block (30 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/CustomDomainAdapter.kt:476 — app/src/main/java/com/celzero/bravedns/adapter/CustomDomainAdapter.kt:476-505 | app/src/main/java/com/celzero/bravedns/adapter/CustomDomainAdapter.kt:587-616 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/CustomDomainAdapter.kt:476` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (30 lines × 2) REDACTED:1773 — REDACTED:1773-1802 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:1773-1802 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (20 lines × 3) · ×2
  • Duplicated block (20 lines × 3) app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:215 — app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:215-234 | app/src/main/java/com/celzero/bravedns/adapter/DnsLogAdapter.kt:476-495 | app/src/main/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt:729-748 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:215` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (20 lines × 3) app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:238 — app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:238-257 | app/src/main/java/com/celzero/bravedns/adapter/DnsLogAdapter.kt:499-518 | app/src/main/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt:752-771 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:238` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×2
  • Duplicated block (15–17 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt:172 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt:172-186 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/RethinkLogBottomSheet.kt:172-188 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt` and `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/RethinkLogBottomSheet.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15–17 lines × 2) app/src/main/java/com/celzero/bravedns/util/BubbleHelper.kt:315 — app/src/main/java/com/celzero/bravedns/util/BubbleHelper.kt:315-329 | app/src/main/java/com/celzero/bravedns/util/BubbleHelper.kt:471-487 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/util/BubbleHelper.kt:471` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/celzero/bravedns/util/BubbleHelper.kt:303` calls `buildBubbleDeletePendingIntent`, `Builder` and `app/src/main/java/com/celzero/bravedns/util/BubbleHelper.kt:471` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×2
  • Duplicated block (15–16 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:97 — app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:97-111 | app/src/main/java/com/celzero/bravedns/adapter/RemoteAdvancedViewAdapter.kt:98-113 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/RemoteAdvancedViewAdapter.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `filetag` to `RethinkLocalFileTag` in one and `RethinkRemoteFileTag` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (15–16 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:851 — app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:851-866 | app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:1092-1106 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:851` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:849` calls `setText`, `toString` and `app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:1090` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×2
  • Duplicated block (15 lines × 3) app/src/main/java/com/celzero/bravedns/ui/fragment/DoTListFragment.kt:133 — app/src/main/java/com/celzero/bravedns/ui/fragment/DoTListFragment.kt:133-147 | app/src/main/java/com/celzero/bravedns/ui/fragment/DohListFragment.kt:142-156 | app/src/main/java/com/celzero/bravedns/ui/fragment/ODoHListFragment.kt:138-152 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/fragment/DoTListFragment.kt` and `app/src/main/java/com/celzero/bravedns/ui/fragment/DohListFragment.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/celzero/bravedns/ui/fragment/ODoHListFragment.kt:136` calls `show` and `app/src/main/java/com/celzero/bravedns/ui/fragment/DoTListFragment.kt:131` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 3) app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:249 — app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:249-267 | app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:299-313 | app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:342-357 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:249` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×2
  • Duplicated block (14 lines × 3) app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:326 — app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:326-339 | app/src/main/java/com/celzero/bravedns/adapter/DohEndpointAdapter.kt:328-341 | app/src/main/java/com/celzero/bravedns/adapter/ODoHEndpointAdapter.kt:330-343 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/DohEndpointAdapter.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 149 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (14 lines × 3) app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:393 — app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:393-406 | app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:314-327 | app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt:487-500 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 168 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:329` calls `d` and `app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:408` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×2
  • Duplicated block (13–14 lines × 2) app/src/main/java/com/celzero/bravedns/service/ProxyManager.kt:142 — app/src/main/java/com/celzero/bravedns/service/ProxyManager.kt:142-155 | app/src/main/java/com/celzero/bravedns/service/ProxyManager.kt:177-189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/service/ProxyManager.kt:142` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–14 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:426 — app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:426-438 | app/src/main/java/com/celzero/bravedns/ui/fragment/ServerSelectionFragment.kt:3991-4004 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:426` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×2
  • Duplicated block (11–12 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/ConfigureOtherDnsActivity.kt:81 — app/src/main/java/com/celzero/bravedns/ui/activity/ConfigureOtherDnsActivity.kt:81-91 | app/src/main/java/com/celzero/bravedns/ui/activity/SmartDnsListActivity.kt:47-58 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/celzero/bravedns/ui/activity/ConfigureOtherDnsActivity.kt:92` calls `getIntExtra` and `app/src/main/java/com/celzero/bravedns/ui/activity/SmartDnsListActivity.kt:59` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11–12 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/TunnelSettingsActivity.kt:850 — app/src/main/java/com/celzero/bravedns/ui/activity/TunnelSettingsActivity.kt:850-861 | app/src/main/java/com/celzero/bravedns/ui/activity/TunnelSettingsActivity.kt:906-916 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/activity/TunnelSettingsActivity.kt:906` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×2
  • Duplicated block (10 lines × 4) app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:179 — app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:179-188 | app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:219-228 | app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:416-425 | app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt:229-238 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 195 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:179` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 4) app/src/play/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt:137 — app/src/play/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt:137-146 | app/src/play/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt:223-232 | app/src/website/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt:137-146 | app/src/website/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt:223-232 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt` and `app/src/website/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/play/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt:147` calls `optStringOrNull` and `app/src/play/java/com/celzero/bravedns/iab/RpnPurchaseAckServerResponse.kt:233` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×2
  • Duplicated block (9 lines × 3) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:263 — app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:263-272 | app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:263-271 | app/src/main/java/com/celzero/bravedns/adapter/ODoHEndpointAdapter.kt:267-275 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:263` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:410 — app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:410-418 | app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:333-341 | app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt:504-512 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 168 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:410` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:329` calls `d` and `app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:406` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×2
  • Duplicated block (8 lines × 5) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:324 — app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:324-331 | app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt:264-271 | app/src/main/java/com/celzero/bravedns/adapter/DnsProxyEndpointAdapter.kt:161-168 | app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:315-322 | app/src/main/java/com/celzero/bravedns/adapter/ODoHEndpointAdapter.kt:319-326 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:324` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `endpoint` to `DnsCryptEndpoint` in one and `DnsCryptRelayEndpoint` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (8 lines × 5) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/BlockFreeDnsModeBottomSheet.kt:70 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/BlockFreeDnsModeBottomSheet.kt:70-77 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/FirewallAppFilterBottomSheet.kt:62-69 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/RethinkListBottomSheet.kt:69-76 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/RethinkPlusFilterBottomSheet.kt:86-93 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/SummaryStatsFilterBottomSheet.kt:73-80 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×2
  • Duplicated block (8 lines × 3) app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:610 — app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:610-617 | app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:671-678 | app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt:585-592 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (8 lines × 3) app/src/main/java/com/celzero/bravedns/ui/activity/WgIncludeAppsActivity.kt:183 — app/src/main/java/com/celzero/bravedns/ui/activity/WgIncludeAppsActivity.kt:183-190 | app/src/main/java/com/celzero/bravedns/ui/fragment/DnsLogFragment.kt:265-272 | app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkBlocklistFragment.kt:737-744 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/activity/WgIncludeAppsActivity.kt:183` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/celzero/bravedns/ui/activity/WgIncludeAppsActivity.kt:191` calls `colorUpChipIcon` and `app/src/main/java/com/celzero/bravedns/ui/fragment/DnsLogFragment.kt:273` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D1 · Cyclomatic Complexity · BraveVPNService.onSharedPreferenceChanged (cyclomatic 61) · ×1
  • BraveVPNService.onSharedPreferenceChanged (cyclomatic 61) app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:1543 — BraveVPNService.onSharedPreferenceChanged has cyclomatic complexity 61 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · TunFirewallManager.firewall (cyclomatic 61) · ×1
  • TunFirewallManager.firewall (cyclomatic 61) app/src/main/java/com/celzero/bravedns/service/TunFirewallManager.kt:100 — TunFirewallManager.firewall has cyclomatic complexity 61 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SubscriptionStateMachineV2.handlePaymentSuccessful (cyclomatic 45) · ×1
  • SubscriptionStateMachineV2.handlePaymentSuccessful (cyclomatic 45) app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:2587 — SubscriptionStateMachineV2.handlePaymentSuccessful has cyclomatic complexity 45 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TunFlowManager.determineProxyDetails (cyclomatic 45) · ×1
  • TunFlowManager.determineProxyDetails (cyclomatic 45) app/src/main/java/com/celzero/bravedns/service/TunFlowManager.kt:1113 — TunFlowManager.determineProxyDetails has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SubscriptionStateMachineV2.reconcileWithPlayBilling (cyclomatic 44) · ×1
  • SubscriptionStateMachineV2.reconcileWithPlayBilling (cyclomatic 44) app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1192 — SubscriptionStateMachineV2.reconcileWithPlayBilling has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NetworkRequestHandler.repopulateTrackedNetworks (cyclomatic 42) · ×1
  • NetworkRequestHandler.repopulateTrackedNetworks (cyclomatic 42) app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:1471 — NetworkRequestHandler.repopulateTrackedNetworks has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GoVpnAdapter.pauseAndResumeProxies (cyclomatic 41) · ×1
  • GoVpnAdapter.pauseAndResumeProxies (cyclomatic 41) app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt:1530 — GoVpnAdapter.pauseAndResumeProxies has cyclomatic complexity 41 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · CustomerSupportActivity.collectAndSend (cyclomatic 39) · ×1
  • CustomerSupportActivity.collectAndSend (cyclomatic 39) app/src/main/java/com/celzero/bravedns/ui/activity/CustomerSupportActivity.kt:263 — CustomerSupportActivity.collectAndSend has cyclomatic complexity 39 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SubscriptionStateMachineV2.expireStaleInAppFromDb (cyclomatic 37) · ×1
  • SubscriptionStateMachineV2.expireStaleInAppFromDb (cyclomatic 37) app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1895 — SubscriptionStateMachineV2.expireStaleInAppFromDb has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HomeScreenFragment.syncDnsStatus (cyclomatic 31) · ×1
  • HomeScreenFragment.syncDnsStatus (cyclomatic 31) app/src/main/java/com/celzero/bravedns/ui/fragment/HomeScreenFragment.kt:3551 — HomeScreenFragment.syncDnsStatus has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · HomeScreenFragment.updateUiWithProxyStates (cyclomatic 30) · ×1
  • HomeScreenFragment.updateUiWithProxyStates (cyclomatic 30) app/src/main/java/com/celzero/bravedns/ui/fragment/HomeScreenFragment.kt:1092 — HomeScreenFragment.updateUiWithProxyStates has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RpnManagePurchaseScreenKt.RpnManagePurchaseScreen (cyclomatic 29) · ×1
  • RpnManagePurchaseScreenKt.RpnManagePurchaseScreen (cyclomatic 29) app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnManagePurchaseScreen.kt:66 — RpnManagePurchaseScreenKt.RpnManagePurchaseScreen has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · RpnProxyManager.registerProxy (cyclomatic 28) · ×1
  • RpnProxyManager.registerProxy (cyclomatic 28) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:1162 — RpnProxyManager.registerProxy has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RpnProxyManager.resetAndRefetchRpn (cyclomatic 27) · ×1
  • RpnProxyManager.resetAndRefetchRpn (cyclomatic 27) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:671 — RpnProxyManager.resetAndRefetchRpn has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RpnProxyManager.handleStateChange (cyclomatic 26) · ×1
  • RpnProxyManager.handleStateChange (cyclomatic 26) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:2127 — RpnProxyManager.handleStateChange has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TunDnsManager.getTransportIdForDnsFirewallMode (cyclomatic 26) · ×1
  • TunDnsManager.getTransportIdForDnsFirewallMode (cyclomatic 26) app/src/main/java/com/celzero/bravedns/tunnel/TunDnsManager.kt:327 — TunDnsManager.getTransportIdForDnsFirewallMode has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ServerSelectionFragment.updateSubscriptionBanner (cyclomatic 25) · ×1
  • ServerSelectionFragment.updateSubscriptionBanner (cyclomatic 25) app/src/main/java/com/celzero/bravedns/ui/fragment/ServerSelectionFragment.kt:3610 — ServerSelectionFragment.updateSubscriptionBanner has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BraveVPNService.interestingNetworkChanges (cyclomatic 24) · ×1
  • BraveVPNService.interestingNetworkChanges (cyclomatic 24) app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:2691 — BraveVPNService.interestingNetworkChanges has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TunDnsManager.determineDnsTransportIdForDFMode (cyclomatic 24) · ×1
  • TunDnsManager.determineDnsTransportIdForDFMode (cyclomatic 24) app/src/main/java/com/celzero/bravedns/tunnel/TunDnsManager.kt:466 — TunDnsManager.determineDnsTransportIdForDFMode has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SubscriptionStateMachineV2.expireStaleSubsFromDb (cyclomatic 23) · ×1
  • SubscriptionStateMachineV2.expireStaleSubsFromDb (cyclomatic 23) app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1589 — SubscriptionStateMachineV2.expireStaleSubsFromDb has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RpnProxyManager.updateWinProxy (cyclomatic 22) · ×1
  • RpnProxyManager.updateWinProxy (cyclomatic 22) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:2381 — RpnProxyManager.updateWinProxy has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RethinkPlusManagePurchaseFragment.populateView (cyclomatic 22) · ×1
  • RethinkPlusManagePurchaseFragment.populateView (cyclomatic 22) app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt:130 — RethinkPlusManagePurchaseFragment.populateView has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · RpnProxyManager.processRpnPurchase (cyclomatic 21) · ×1
  • RpnProxyManager.processRpnPurchase (cyclomatic 21) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:1969 — RpnProxyManager.processRpnPurchase has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BraveVPNService.newBuilder (cyclomatic 21) · ×1
  • BraveVPNService.newBuilder (cyclomatic 21) app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:601 — BraveVPNService.newBuilder has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DnsLogTracker.makeDnsLogObj (cyclomatic 21) · ×1
  • DnsLogTracker.makeDnsLogObj (cyclomatic 21) app/src/main/java/com/celzero/bravedns/service/DnsLogTracker.kt:145 — DnsLogTracker.makeDnsLogObj has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GoMemoryProfiler.captureGoHeapDump (cyclomatic 21) · ×1
  • GoMemoryProfiler.captureGoHeapDump (cyclomatic 21) app/src/main/java/com/celzero/bravedns/util/GoMemoryProfiler.kt:55 — GoMemoryProfiler.captureGoHeapDump has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RpnHomeScreenKt.RpnHomeScreen (cyclomatic 21) · ×1
  • RpnHomeScreenKt.RpnHomeScreen (cyclomatic 21) app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnHomeScreen.kt:80 — RpnHomeScreenKt.RpnHomeScreen has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ConnectionLogViewHolder.displaySummaryDetails (cyclomatic 20) · ×1
  • ConnectionLogViewHolder.displaySummaryDetails (cyclomatic 20) app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:335 — ConnectionLogViewHolder.displaySummaryDetails has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RpnProxyManager.refreshWinEntitlement (cyclomatic 20) · ×1
  • RpnProxyManager.refreshWinEntitlement (cyclomatic 20) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:1478 — RpnProxyManager.refreshWinEntitlement has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TunDnsManager.decideUpstreamAnswer (cyclomatic 20) · ×1
  • TunDnsManager.decideUpstreamAnswer (cyclomatic 20) app/src/main/java/com/celzero/bravedns/tunnel/TunDnsManager.kt:976 — TunDnsManager.decideUpstreamAnswer has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ConnectionTrackerViewHolder.displaySummaryDetails (cyclomatic 19) · ×1
  • ConnectionTrackerViewHolder.displaySummaryDetails (cyclomatic 19) app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt:271 — ConnectionTrackerViewHolder.displaySummaryDetails has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DownloadWatcher.checkForDownload (cyclomatic 19) · ×1
  • DownloadWatcher.checkForDownload (cyclomatic 19) app/src/main/java/com/celzero/bravedns/download/DownloadWatcher.kt:144 — DownloadWatcher.checkForDownload has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConnectionTracer.getUidQ (cyclomatic 19) · ×1
  • ConnectionTracer.getUidQ (cyclomatic 19) app/src/main/java/com/celzero/bravedns/net/manager/ConnectionTracer.kt:40 — ConnectionTracer.getUidQ has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RpnProxyManager.load (cyclomatic 19) · ×1
  • RpnProxyManager.load (cyclomatic 19) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:1050 — RpnProxyManager.load has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TunFlowManager.handleFlow (cyclomatic 19) · ×1
  • TunFlowManager.handleFlow (cyclomatic 19) app/src/main/java/com/celzero/bravedns/service/TunFlowManager.kt:336 — TunFlowManager.handleFlow has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WireguardManager.getAllPossibleConfigIdsForApp (cyclomatic 19) · ×1
  • WireguardManager.getAllPossibleConfigIdsForApp (cyclomatic 19) app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt:593 — WireguardManager.getAllPossibleConfigIdsForApp has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RethinkPlusDashboardFragment.populateBanner (cyclomatic 19) · ×1
  • RethinkPlusDashboardFragment.populateBanner (cyclomatic 19) app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:153 — RethinkPlusDashboardFragment.populateBanner has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ServerSelectionFragment.redriveProxyStartStopState (cyclomatic 19) · ×1
  • ServerSelectionFragment.redriveProxyStartStopState (cyclomatic 19) app/src/main/java/com/celzero/bravedns/ui/fragment/ServerSelectionFragment.kt:880 — ServerSelectionFragment.redriveProxyStartStopState has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProxyEditorScreenKt.ProxyEditorScreen (cyclomatic 19) · ×1
  • ProxyEditorScreenKt.ProxyEditorScreen (cyclomatic 19) app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/ProxyEditorScreen.kt:86 — ProxyEditorScreenKt.ProxyEditorScreen has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · HopViewHolder.handleWgHop (cyclomatic 18) · ×1
  • HopViewHolder.handleWgHop (cyclomatic 18) app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:376 — HopViewHolder.handleWgHop has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HopViewHolder.handleHop (cyclomatic 18) · ×1
  • HopViewHolder.handleHop (cyclomatic 18) app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt:318 — HopViewHolder.handleHop has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StateMachineDatabaseSyncService.determineStateFromSubscription (cyclomatic 18) · ×1
  • StateMachineDatabaseSyncService.determineStateFromSubscription (cyclomatic 18) app/src/main/java/com/celzero/bravedns/rpnproxy/StateMachineDatabaseSyncService.kt:73 — StateMachineDatabaseSyncService.determineStateFromSubscription has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · BraveVPNService.calculatePtMode (cyclomatic 18) · ×1
  • BraveVPNService.calculatePtMode (cyclomatic 18) app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:2069 — BraveVPNService.calculatePtMode has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProxySettingsActivity.showSocks5ProxyDialog (cyclomatic 18) · ×1
  • ProxySettingsActivity.showSocks5ProxyDialog (cyclomatic 18) app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:801 — ProxySettingsActivity.showSocks5ProxyDialog has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LocalBlocklistsBottomSheet.observeWorkManager (cyclomatic 18) · ×1
  • LocalBlocklistsBottomSheet.observeWorkManager (cyclomatic 18) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/LocalBlocklistsBottomSheet.kt:705 — LocalBlocklistsBottomSheet.observeWorkManager has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · NetworkReachabilityDialog.saveIps (cyclomatic 18) · ×1
  • NetworkReachabilityDialog.saveIps (cyclomatic 18) app/src/main/java/com/celzero/bravedns/ui/dialog/NetworkReachabilityDialog.kt:313 — NetworkReachabilityDialog.saveIps has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AboutFragment.showProcDialog (cyclomatic 18) · ×1
  • AboutFragment.showProcDialog (cyclomatic 18) app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:1210 — AboutFragment.showProcDialog has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: AboutFragment.onClick (cyclomatic 38) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · HomeScreenFragment.getProxyStatus (cyclomatic 18) · ×1
  • HomeScreenFragment.getProxyStatus (cyclomatic 18) app/src/main/java/com/celzero/bravedns/ui/fragment/HomeScreenFragment.kt:1255 — HomeScreenFragment.getProxyStatus has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ServerSelectionFragment.showServerLoadingDialog (cyclomatic 18) · ×1
  • ServerSelectionFragment.showServerLoadingDialog (cyclomatic 18) app/src/main/java/com/celzero/bravedns/ui/fragment/ServerSelectionFragment.kt:3839 — ServerSelectionFragment.showServerLoadingDialog has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ManagePurchaseViewModel.launchOperation (cyclomatic 18) · ×1
  • ManagePurchaseViewModel.launchOperation (cyclomatic 18) app/src/main/java/com/celzero/bravedns/viewmodel/ManagePurchaseViewModel.kt:104 — ManagePurchaseViewModel.launchOperation has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DnsLogViewHolder.displayUnicodeIfNeeded (cyclomatic 17) · ×1
  • DnsLogViewHolder.displayUnicodeIfNeeded (cyclomatic 17) app/src/main/java/com/celzero/bravedns/adapter/DnsLogAdapter.kt:182 — DnsLogViewHolder.displayUnicodeIfNeeded has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RethinkLogViewHolder.displaySummaryDetails (cyclomatic 17) · ×1
  • RethinkLogViewHolder.displaySummaryDetails (cyclomatic 17) app/src/main/java/com/celzero/bravedns/adapter/RethinkLogAdapter.kt:241 — RethinkLogViewHolder.displaySummaryDetails has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AppNetworkActivityViewHolder.setupClickListeners (cyclomatic 17) · ×1
  • AppNetworkActivityViewHolder.setupClickListeners (cyclomatic 17) app/src/main/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt:478 — AppNetworkActivityViewHolder.setupClickListeners has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · RethinkLocalFileTag.<init> (cyclomatic 17) · ×1
  • RethinkLocalFileTag.<init> (cyclomatic 17) app/src/main/java/com/celzero/bravedns/database/RethinkLocalFileTag.kt:80 — RethinkLocalFileTag.<init> has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · BraveVPNService.establishVpn (cyclomatic 17) · ×1
  • BraveVPNService.establishVpn (cyclomatic 17) app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:3255 — BraveVPNService.establishVpn has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TunDnsManager.proxyIdForOnQuery (cyclomatic 17) · ×1
  • TunDnsManager.proxyIdForOnQuery (cyclomatic 17) app/src/main/java/com/celzero/bravedns/tunnel/TunDnsManager.kt:665 — TunDnsManager.proxyIdForOnQuery has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RpnConfigDetailActivity.setupClickListeners (cyclomatic 17) · ×1
  • RpnConfigDetailActivity.setupClickListeners (cyclomatic 17) app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:995 — RpnConfigDetailActivity.setupClickListeners has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RulesImportHelper.parseFile (cyclomatic 17) · ×1
  • RulesImportHelper.parseFile (cyclomatic 17) app/src/main/java/com/celzero/bravedns/ui/fragment/RulesImportHelper.kt:101 — RulesImportHelper.parseFile has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ServerSelectionFragment.observeResetState (cyclomatic 17) · ×1
  • ServerSelectionFragment.observeResetState (cyclomatic 17) app/src/main/java/com/celzero/bravedns/ui/fragment/ServerSelectionFragment.kt:777 — ServerSelectionFragment.observeResetState has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Logger.log (cyclomatic 17) · ×1
  • Logger.log (cyclomatic 17) app/src/main/java/com/celzero/bravedns/util/Logger.kt:350 — Logger.log has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TunnelImporter.importTunnel (cyclomatic 17) · ×1
  • TunnelImporter.importTunnel (cyclomatic 17) app/src/main/java/com/celzero/bravedns/util/TunnelImporter.kt:45 — TunnelImporter.importTunnel has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RpnPlusDashboardScreenKt.RpnPlusDashboardScreen (cyclomatic 17) · ×1
  • RpnPlusDashboardScreenKt.RpnPlusDashboardScreen (cyclomatic 17) app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnPlusDashboardScreen.kt:72 — RpnPlusDashboardScreenKt.RpnPlusDashboardScreen has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AppNetworkActivityViewHolder.setName (cyclomatic 16) · ×1
  • AppNetworkActivityViewHolder.setName (cyclomatic 16) app/src/main/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt:376 — AppNetworkActivityViewHolder.setName has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · SubscriptionStateMachineV2.handleSubscriptionRestored (cyclomatic 16) · ×1
  • SubscriptionStateMachineV2.handleSubscriptionRestored (cyclomatic 16) app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:3081 — SubscriptionStateMachineV2.handleSubscriptionRestored has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AntiCensorshipActivity.setupClickListeners (cyclomatic 16) · ×1
  • AntiCensorshipActivity.setupClickListeners (cyclomatic 16) app/src/main/java/com/celzero/bravedns/ui/activity/AntiCensorshipActivity.kt:193 — AntiCensorshipActivity.setupClickListeners has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · NetworkLogsActivity.getFragment (cyclomatic 16) · ×1
  • NetworkLogsActivity.getFragment (cyclomatic 16) app/src/main/java/com/celzero/bravedns/ui/activity/NetworkLogsActivity.kt:157 — NetworkLogsActivity.getFragment has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · OrbotBottomSheet.setupClickListeners (cyclomatic 16) · ×1
  • OrbotBottomSheet.setupClickListeners (cyclomatic 16) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/OrbotBottomSheet.kt:146 — OrbotBottomSheet.setupClickListeners has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AboutFragment.hasAnyLogsAvailable (cyclomatic 16) · ×1
  • AboutFragment.hasAnyLogsAvailable (cyclomatic 16) app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:1637 — AboutFragment.hasAnyLogsAvailable has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: AboutFragment.onClick (cyclomatic 38) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · RpnBypassAppsScreenKt.RpnBypassAppsScreen (cyclomatic 16) · ×1
  • RpnBypassAppsScreenKt.RpnBypassAppsScreen (cyclomatic 16) app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:100 — RpnBypassAppsScreenKt.RpnBypassAppsScreen has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · WgIncludeAppsScreenKt.WgIncludeAppsScreen (cyclomatic 16) · ×1
  • WgIncludeAppsScreenKt.WgIncludeAppsScreen (cyclomatic 16) app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt:108 — WgIncludeAppsScreenKt.WgIncludeAppsScreen has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TunFlowManager.determineProxyDetails (cognitive 84) · ×1
  • TunFlowManager.determineProxyDetails (cognitive 84) app/src/main/java/com/celzero/bravedns/service/TunFlowManager.kt:1113 — TunFlowManager.determineProxyDetails has cognitive complexity 84 (threshold 15). Drivers by points: if/else 52 (79 pts), boolean chains 5 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RpnProxyManager.registerProxy (cognitive 69) · ×1
  • RpnProxyManager.registerProxy (cognitive 69) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:1162 — RpnProxyManager.registerProxy has cognitive complexity 69 (threshold 15). Drivers by points: if/else 23 (50 pts), error handling 3 (10 pts), boolean chains 8, match/switch 1 (nesting depth added 34). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · TunFirewallManager.firewall (cognitive 61) · ×1
  • TunFirewallManager.firewall (cognitive 61) app/src/main/java/com/celzero/bravedns/service/TunFirewallManager.kt:100 — TunFirewallManager.firewall has cognitive complexity 61 (threshold 15). Drivers by points: if/else 35 (42 pts), boolean chains 12, match/switch 6, error handling 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SubscriptionStateMachineV2.handlePaymentSuccessful (cognitive 59) · ×1
  • SubscriptionStateMachineV2.handlePaymentSuccessful (cognitive 59) app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:2587 — SubscriptionStateMachineV2.handlePaymentSuccessful has cognitive complexity 59 (threshold 15). Drivers by points: if/else 26 (33 pts), boolean chains 17, error handling 4 (7 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · NetworkRequestHandler.repopulateTrackedNetworks (cognitive 56) · ×1
  • NetworkRequestHandler.repopulateTrackedNetworks (cognitive 56) app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:1471 — NetworkRequestHandler.repopulateTrackedNetworks has cognitive complexity 56 (threshold 15). Drivers by points: if/else 21 (35 pts), boolean chains 21 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SubscriptionStateMachineV2.reconcileWithPlayBilling (cognitive 55) · ×1
  • SubscriptionStateMachineV2.reconcileWithPlayBilling (cognitive 55) app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1192 — SubscriptionStateMachineV2.reconcileWithPlayBilling has cognitive complexity 55 (threshold 15). Drivers by points: if/else 27 (37 pts), boolean chains 13, match/switch 3 (4 pts), error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SubscriptionStateMachineV2.expireStaleInAppFromDb (cognitive 55) · ×1
  • SubscriptionStateMachineV2.expireStaleInAppFromDb (cognitive 55) app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1895 — SubscriptionStateMachineV2.expireStaleInAppFromDb has cognitive complexity 55 (threshold 15). Drivers by points: if/else 18 (29 pts), boolean chains 12, error handling 4 (10 pts), match/switch 2 (4 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CustomerSupportActivity.collectAndSend (cognitive 49) · ×1
  • CustomerSupportActivity.collectAndSend (cognitive 49) app/src/main/java/com/celzero/bravedns/ui/activity/CustomerSupportActivity.kt:263 — CustomerSupportActivity.collectAndSend has cognitive complexity 49 (threshold 15). Drivers by points: if/else 28 (30 pts), boolean chains 16, error handling 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HomeScreenFragment.updateUiWithProxyStates (cognitive 49) · ×1
  • HomeScreenFragment.updateUiWithProxyStates (cognitive 49) app/src/main/java/com/celzero/bravedns/ui/fragment/HomeScreenFragment.kt:1092 — HomeScreenFragment.updateUiWithProxyStates has cognitive complexity 49 (threshold 15). Drivers by points: if/else 26 (38 pts), boolean chains 11 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GoVpnAdapter.pauseAndResumeProxies (cognitive 47) · ×1
  • GoVpnAdapter.pauseAndResumeProxies (cognitive 47) app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt:1530 — GoVpnAdapter.pauseAndResumeProxies has cognitive complexity 47 (threshold 15). Drivers by points: boolean chains 24, if/else 21 (23 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · TunDnsManager.determineDnsTransportIdForDFMode (cognitive 46) · ×1
  • TunDnsManager.determineDnsTransportIdForDFMode (cognitive 46) app/src/main/java/com/celzero/bravedns/tunnel/TunDnsManager.kt:466 — TunDnsManager.determineDnsTransportIdForDFMode has cognitive complexity 46 (threshold 15). Drivers by points: if/else 28 (40 pts), boolean chains 6 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RpnProxyManager.handleStateChange (cognitive 44) · ×1
  • RpnProxyManager.handleStateChange (cognitive 44) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:2127 — RpnProxyManager.handleStateChange has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (26 pts), error handling 5 (11 pts), boolean chains 6, match/switch 1 (nesting depth added 19). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · DnsLogTracker.makeDnsLogObj (cognitive 43) · ×1
  • DnsLogTracker.makeDnsLogObj (cognitive 43) app/src/main/java/com/celzero/bravedns/service/DnsLogTracker.kt:145 — DnsLogTracker.makeDnsLogObj has cognitive complexity 43 (threshold 15). Drivers by points: if/else 23 (38 pts), boolean chains 5 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RpnProxyManager.processRpnPurchase (cognitive 42) · ×1
  • RpnProxyManager.processRpnPurchase (cognitive 42) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:1969 — RpnProxyManager.processRpnPurchase has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 7, error handling 3 (7 pts) (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ServerSelectionFragment.redriveProxyStartStopState (cognitive 42) · ×1
  • ServerSelectionFragment.redriveProxyStartStopState (cognitive 42) app/src/main/java/com/celzero/bravedns/ui/fragment/ServerSelectionFragment.kt:880 — ServerSelectionFragment.redriveProxyStartStopState has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (30 pts), error handling 2 (8 pts), boolean chains 4 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RpnProxyManager.updateWinProxy (cognitive 40) · ×1
  • RpnProxyManager.updateWinProxy (cognitive 40) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:2381 — RpnProxyManager.updateWinProxy has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (26 pts), error handling 5 (10 pts), boolean chains 2, loops 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServerSelectionFragment.updateSubscriptionBanner (cognitive 40) · ×1
  • ServerSelectionFragment.updateSubscriptionBanner (cognitive 40) app/src/main/java/com/celzero/bravedns/ui/fragment/ServerSelectionFragment.kt:3610 — ServerSelectionFragment.updateSubscriptionBanner has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (28 pts), boolean chains 8, match/switch 3 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NetworkReachabilityDialog.saveIps (cognitive 38) · ×1
  • NetworkReachabilityDialog.saveIps (cognitive 38) app/src/main/java/com/celzero/bravedns/ui/dialog/NetworkReachabilityDialog.kt:313 — NetworkReachabilityDialog.saveIps has cognitive complexity 38 (threshold 15). Drivers by points: if/else 27 (36 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RpnProxyManager.load (cognitive 37) · ×1
  • RpnProxyManager.load (cognitive 37) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:1050 — RpnProxyManager.load has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (18 pts), error handling 8 (16 pts), boolean chains 2, match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HomeScreenFragment.syncDnsStatus (cognitive 37) · ×1
  • HomeScreenFragment.syncDnsStatus (cognitive 37) app/src/main/java/com/celzero/bravedns/ui/fragment/HomeScreenFragment.kt:3551 — HomeScreenFragment.syncDnsStatus has cognitive complexity 37 (threshold 15). Drivers by points: if/else 26 (28 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AboutFragment.showProcDialog (cognitive 36) · ×1
  • AboutFragment.showProcDialog (cognitive 36) app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:1210 — AboutFragment.showProcDialog has cognitive complexity 36 (threshold 15). Drivers by points: if/else 21 (34 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DownloadWatcher.checkForDownload (cognitive 35) · ×1
  • DownloadWatcher.checkForDownload (cognitive 35) app/src/main/java/com/celzero/bravedns/download/DownloadWatcher.kt:144 — DownloadWatcher.checkForDownload has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (28 pts), match/switch 1 (3 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TunDnsManager.getTransportIdForDnsFirewallMode (cognitive 34) · ×1
  • TunDnsManager.getTransportIdForDnsFirewallMode (cognitive 34) app/src/main/java/com/celzero/bravedns/tunnel/TunDnsManager.kt:327 — TunDnsManager.getTransportIdForDnsFirewallMode has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 6, match/switch 2 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BraveVPNService.newBuilder (cognitive 32) · ×1
  • BraveVPNService.newBuilder (cognitive 32) app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:601 — BraveVPNService.newBuilder has cognitive complexity 32 (threshold 15). Drivers by points: if/else 22 (27 pts), boolean chains 5 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TunnelImporter.importTunnel (cognitive 32) · ×1
  • TunnelImporter.importTunnel (cognitive 32) app/src/main/java/com/celzero/bravedns/util/TunnelImporter.kt:45 — TunnelImporter.importTunnel has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (25 pts), error handling 2 (4 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SubscriptionStateMachineV2.handleSubscriptionRestored (cognitive 31) · ×1
  • SubscriptionStateMachineV2.handleSubscriptionRestored (cognitive 31) app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:3081 — SubscriptionStateMachineV2.handleSubscriptionRestored has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (20 pts), error handling 3 (7 pts), boolean chains 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProxySettingsActivity.showSocks5ProxyDialog (cognitive 31) · ×1
  • ProxySettingsActivity.showSocks5ProxyDialog (cognitive 31) app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:801 — ProxySettingsActivity.showSocks5ProxyDialog has cognitive complexity 31 (threshold 15). Drivers by points: if/else 19 (25 pts), loops 1 (3 pts), boolean chains 2, error handling 1 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ServerSelectionFragment.showServerLoadingDialog (cognitive 31) · ×1
  • ServerSelectionFragment.showServerLoadingDialog (cognitive 31) app/src/main/java/com/celzero/bravedns/ui/fragment/ServerSelectionFragment.kt:3839 — ServerSelectionFragment.showServerLoadingDialog has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (20 pts), error handling 4 (9 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RpnProxyManager.refreshWinEntitlement (cognitive 30) · ×1
  • RpnProxyManager.refreshWinEntitlement (cognitive 30) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:1478 — RpnProxyManager.refreshWinEntitlement has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (16 pts), error handling 4 (10 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RulesImportHelper.parseFile (cognitive 30) · ×1
  • RulesImportHelper.parseFile (cognitive 30) app/src/main/java/com/celzero/bravedns/ui/fragment/RulesImportHelper.kt:101 — RulesImportHelper.parseFile has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 5, error handling 2, match/switch 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConnectionLogViewHolder.displaySummaryDetails (cognitive 29) · ×1
  • ConnectionLogViewHolder.displaySummaryDetails (cognitive 29) app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:335 — ConnectionLogViewHolder.displaySummaryDetails has cognitive complexity 29 (threshold 15). Drivers by points: if/else 21 (27 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ConnectionTrackerViewHolder.displaySummaryDetails (cognitive 28) · ×1
  • ConnectionTrackerViewHolder.displaySummaryDetails (cognitive 28) app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt:271 — ConnectionTrackerViewHolder.displaySummaryDetails has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20 (26 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HopViewHolder.handleWgHop (cognitive 28) · ×1
  • HopViewHolder.handleWgHop (cognitive 28) app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:376 — HopViewHolder.handleWgHop has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HopViewHolder.handleHop (cognitive 28) · ×1
  • HopViewHolder.handleHop (cognitive 28) app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt:318 — HopViewHolder.handleHop has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RpnProxyManager.getAllPossibleConfigIdsForApp (cognitive 28) · ×1
  • RpnProxyManager.getAllPossibleConfigIdsForApp (cognitive 28) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:3484 — RpnProxyManager.getAllPossibleConfigIdsForApp has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (21 pts), error handling 3, boolean chains 2, loops 1 (2 pts) (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · TunFlowManager.handleFlow (cognitive 28) · ×1
  • TunFlowManager.handleFlow (cognitive 28) app/src/main/java/com/celzero/bravedns/service/TunFlowManager.kt:336 — TunFlowManager.handleFlow has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServerSelectionFragment.onServerSelected (cognitive 28) · ×1
  • ServerSelectionFragment.onServerSelected (cognitive 28) app/src/main/java/com/celzero/bravedns/ui/fragment/ServerSelectionFragment.kt:3250 — ServerSelectionFragment.onServerSelected has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (28 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GoMemoryProfiler.captureGoHeapDump (cognitive 28) · ×1
  • GoMemoryProfiler.captureGoHeapDump (cognitive 28) app/src/main/java/com/celzero/bravedns/util/GoMemoryProfiler.kt:55 — GoMemoryProfiler.captureGoHeapDump has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 6, error handling 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BraveVPNService.interestingNetworkChanges (cognitive 27) · ×1
  • BraveVPNService.interestingNetworkChanges (cognitive 27) app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:2691 — BraveVPNService.interestingNetworkChanges has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 10 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · HomeScreenFragment.getProxyStatus (cognitive 27) · ×1
  • HomeScreenFragment.getProxyStatus (cognitive 27) app/src/main/java/com/celzero/bravedns/ui/fragment/HomeScreenFragment.kt:1255 — HomeScreenFragment.getProxyStatus has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RpnProxyManager.resetAndRefetchRpn (cognitive 26) · ×1
  • RpnProxyManager.resetAndRefetchRpn (cognitive 26) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:671 — RpnProxyManager.resetAndRefetchRpn has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15, error handling 7 (8 pts), boolean chains 2, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SubscriptionStateMachineV2.expireStaleSubsFromDb (cognitive 26) · ×1
  • SubscriptionStateMachineV2.expireStaleSubsFromDb (cognitive 26) app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1589 — SubscriptionStateMachineV2.expireStaleSubsFromDb has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 10, error handling 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TunDnsManager.proxyIdForOnQuery (cognitive 26) · ×1
  • TunDnsManager.proxyIdForOnQuery (cognitive 26) app/src/main/java/com/celzero/bravedns/tunnel/TunDnsManager.kt:665 — TunDnsManager.proxyIdForOnQuery has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20 (24 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · RpnHomeScreenKt.RpnHomeScreen (cognitive 26) · ×1
  • RpnHomeScreenKt.RpnHomeScreen (cognitive 26) app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnHomeScreen.kt:80 — RpnHomeScreenKt.RpnHomeScreen has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20 (21 pts), boolean chains 2, loops 2, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · BraveVPNService.onSharedPreferenceChanged (cognitive 25) · ×1
  • BraveVPNService.onSharedPreferenceChanged (cognitive 25) app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:1543 — BraveVPNService.onSharedPreferenceChanged has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (20 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · WireguardManager.getAllPossibleConfigIdsForApp (cognitive 25) · ×1
  • WireguardManager.getAllPossibleConfigIdsForApp (cognitive 25) app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt:593 — WireguardManager.getAllPossibleConfigIdsForApp has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExceptionParser.parseGoDump (cognitive 25) · ×1
  • ExceptionParser.parseGoDump (cognitive 25) app/src/main/java/com/celzero/bravedns/util/ExceptionParser.kt:224 — ExceptionParser.parseGoDump has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (22 pts), boolean chains 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BraveVPNService.makeOrUpdateVpnAdapter (cognitive 24) · ×1
  • BraveVPNService.makeOrUpdateVpnAdapter (cognitive 24) app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:2300 — BraveVPNService.makeOrUpdateVpnAdapter has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 pts), error handling 2, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MiscSettingsActivity.initView (cognitive 24) · ×1
  • MiscSettingsActivity.initView (cognitive 24) app/src/main/java/com/celzero/bravedns/ui/activity/MiscSettingsActivity.kt:199 — MiscSettingsActivity.initView has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18 (20 pts), error handling 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PingTestActivity.performTest (cognitive 24) · ×1
  • PingTestActivity.performTest (cognitive 24) app/src/main/java/com/celzero/bravedns/ui/activity/PingTestActivity.kt:290 — PingTestActivity.performTest has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (17 pts), match/switch 2 (4 pts), boolean chains 2, error handling 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SummaryStatisticsFragment.applyStatFilters (cognitive 24) · ×1
  • SummaryStatisticsFragment.applyStatFilters (cognitive 24) app/src/main/java/com/celzero/bravedns/ui/fragment/SummaryStatisticsFragment.kt:328 — SummaryStatisticsFragment.applyStatFilters has cognitive complexity 24 (threshold 15). Drivers by points: if/else 24. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · BraveVPNService.establishVpn (cognitive 23) · ×1
  • BraveVPNService.establishVpn (cognitive 23) app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:3255 — BraveVPNService.establishVpn has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 5, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TunFlowManager.persistAndConstructFlowResponse (cognitive 23) · ×1
  • TunFlowManager.persistAndConstructFlowResponse (cognitive 23) app/src/main/java/com/celzero/bravedns/service/TunFlowManager.kt:1030 — TunFlowManager.persistAndConstructFlowResponse has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProxySettingsActivity.showHttpProxyDialog (cognitive 23) · ×1
  • ProxySettingsActivity.showHttpProxyDialog (cognitive 23) app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:1020 — ProxySettingsActivity.showHttpProxyDialog has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RethinkLogViewHolder.displaySummaryDetails (cognitive 22) · ×1
  • RethinkLogViewHolder.displaySummaryDetails (cognitive 22) app/src/main/java/com/celzero/bravedns/adapter/RethinkLogAdapter.kt:241 — RethinkLogViewHolder.displaySummaryDetails has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · CountryConfig.writeToParcel (cognitive 22) · ×1
  • CountryConfig.writeToParcel (cognitive 22) app/src/main/java/com/celzero/bravedns/database/CountryConfig.kt:102 — CountryConfig.writeToParcel has cognitive complexity 22 (threshold 15). Drivers by points: if/else 22. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ConnectionTracer.getUidQ (cognitive 22) · ×1
  • ConnectionTracer.getUidQ (cognitive 22) app/src/main/java/com/celzero/bravedns/net/manager/ConnectionTracer.kt:40 — ConnectionTracer.getUidQ has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (13 pts), error handling 6, match/switch 2 (3 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · BraveVPNService.calculatePtMode (cognitive 22) · ×1
  • BraveVPNService.calculatePtMode (cognitive 22) app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:2069 — BraveVPNService.calculatePtMode has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 7, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WireguardManager.load (cognitive 22) · ×1
  • WireguardManager.load (cognitive 22) app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt:96 — WireguardManager.load has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 5, error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DolphinOceanView.calculateDolphinPose (cognitive 22) · ×1
  • DolphinOceanView.calculateDolphinPose (cognitive 22) app/src/main/java/com/celzero/bravedns/ui/custom/DolphinOceanView.kt:585 — DolphinOceanView.calculateDolphinPose has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (21 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RpnManagePurchaseScreenKt.RpnManagePurchaseScreen (cognitive 22) · ×1
  • RpnManagePurchaseScreenKt.RpnManagePurchaseScreen (cognitive 22) app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnManagePurchaseScreen.kt:66 — RpnManagePurchaseScreenKt.RpnManagePurchaseScreen has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 5, match/switch 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · RpnProxyManager.fetchAndConstructWinLocations (cognitive 21) · ×1
  • RpnProxyManager.fetchAndConstructWinLocations (cognitive 21) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:2817 — RpnProxyManager.fetchAndConstructWinLocations has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 4 (5 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TunDnsManager.decideUpstreamAnswer (cognitive 21) · ×1
  • TunDnsManager.decideUpstreamAnswer (cognitive 21) app/src/main/java/com/celzero/bravedns/tunnel/TunDnsManager.kt:976 — TunDnsManager.decideUpstreamAnswer has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 5, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · RpnConfigDetailActivity.setupSsidSectionUI (cognitive 21) · ×1
  • RpnConfigDetailActivity.setupSsidSectionUI (cognitive 21) app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:1387 — RpnConfigDetailActivity.setupSsidSectionUI has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · LocalBlocklistsBottomSheet.observeWorkManager (cognitive 21) · ×1
  • LocalBlocklistsBottomSheet.observeWorkManager (cognitive 21) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/LocalBlocklistsBottomSheet.kt:705 — LocalBlocklistsBottomSheet.observeWorkManager has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 9 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · RethinkPlusManagePurchaseFragment.populateView (cognitive 21) · ×1
  • RethinkPlusManagePurchaseFragment.populateView (cognitive 21) app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt:130 — RethinkPlusManagePurchaseFragment.populateView has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 3 (4 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DnsLogViewHolder.displayUnicodeIfNeeded (cognitive 20) · ×1
  • DnsLogViewHolder.displayUnicodeIfNeeded (cognitive 20) app/src/main/java/com/celzero/bravedns/adapter/DnsLogAdapter.kt:182 — DnsLogViewHolder.displayUnicodeIfNeeded has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · FirewallManager.snapshotAppInfos (cognitive 20) · ×1
  • FirewallManager.snapshotAppInfos (cognitive 20) app/src/main/java/com/celzero/bravedns/service/FirewallManager.kt:1244 — FirewallManager.snapshotAppInfos has cognitive complexity 20 (threshold 15). Drivers by points: error handling 8 (17 pts), loops 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TunFlowManager.parseIpAndPort (cognitive 20) · ×1
  • TunFlowManager.parseIpAndPort (cognitive 20) app/src/main/java/com/celzero/bravedns/service/TunFlowManager.kt:751 — TunFlowManager.parseIpAndPort has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 2, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AboutFragment.hasAnyLogsAvailable (cognitive 20) · ×1
  • AboutFragment.hasAnyLogsAvailable (cognitive 20) app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:1637 — AboutFragment.hasAnyLogsAvailable has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 8 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DnsProxyListFragment.showAddDnsProxyDialog (cognitive 20) · ×1
  • DnsProxyListFragment.showAddDnsProxyDialog (cognitive 20) app/src/main/java/com/celzero/bravedns/ui/fragment/DnsProxyListFragment.kt:151 — DnsProxyListFragment.showAddDnsProxyDialog has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 2, boolean chains 1, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServerSelectionFragment.observeResetState (cognitive 20) · ×1
  • ServerSelectionFragment.observeResetState (cognitive 20) app/src/main/java/com/celzero/bravedns/ui/fragment/ServerSelectionFragment.kt:777 — ServerSelectionFragment.observeResetState has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 5, match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ManagePurchaseViewModel.launchOperation (cognitive 20) · ×1
  • ManagePurchaseViewModel.launchOperation (cognitive 20) app/src/main/java/com/celzero/bravedns/viewmodel/ManagePurchaseViewModel.kt:104 — ManagePurchaseViewModel.launchOperation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (15 pts), error handling 3, boolean chains 1, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Config.parse (cognitive 20) · ×1
  • Config.parse (cognitive 20) app/src/main/java/com/celzero/bravedns/wireguard/Config.kt:222 — Config.parse has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OrderViewHolder.bindDates (cognitive 19) · ×1
  • OrderViewHolder.bindDates (cognitive 19) app/src/main/java/com/celzero/bravedns/adapter/ServerOrderHistoryAdapter.kt:198 — OrderViewHolder.bindDates has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TunFlowManager.isSpecialApp (cognitive 19) · ×1
  • TunFlowManager.isSpecialApp (cognitive 19) app/src/main/java/com/celzero/bravedns/service/TunFlowManager.kt:1371 — TunFlowManager.isSpecialApp has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppListActivity.getBulkActionDialogTitle (cognitive 19) · ×1
  • AppListActivity.getBulkActionDialogTitle (cognitive 19) app/src/main/java/com/celzero/bravedns/ui/activity/AppListActivity.kt:395 — AppListActivity.getBulkActionDialogTitle has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (18 pts), match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: one other method here (AppListActivity.getBulkActionDialogMessage) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · AppListActivity.getBulkActionDialogMessage (cognitive 19) · ×1
  • AppListActivity.getBulkActionDialogMessage (cognitive 19) app/src/main/java/com/celzero/bravedns/ui/activity/AppListActivity.kt:442 — AppListActivity.getBulkActionDialogMessage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (18 pts), match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: one other method here (AppListActivity.getBulkActionDialogTitle) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · NetworkLogsActivity.getFragment (cognitive 19) · ×1
  • NetworkLogsActivity.getFragment (cognitive 19) app/src/main/java/com/celzero/bravedns/ui/activity/NetworkLogsActivity.kt:157 — NetworkLogsActivity.getFragment has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), match/switch 3 (5 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · RpnConfigDetailActivity.setupClickListeners (cognitive 19) · ×1
  • RpnConfigDetailActivity.setupClickListeners (cognitive 19) app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:995 — RpnConfigDetailActivity.setupClickListeners has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ServerViewHolder.bind (cognitive 19) · ×1
  • ServerViewHolder.bind (cognitive 19) app/src/main/java/com/celzero/bravedns/ui/adapter/VpnServerAdapter.kt:449 — ServerViewHolder.bind has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17 (19 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · BugReportFilesBottomSheet.collectAllBugReportFiles (cognitive 19) · ×1
  • BugReportFilesBottomSheet.collectAllBugReportFiles (cognitive 19) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/BugReportFilesBottomSheet.kt:217 — BugReportFilesBottomSheet.collectAllBugReportFiles has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 6 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AboutFragment.buildTableDump (cognitive 19) · ×1
  • AboutFragment.buildTableDump (cognitive 19) app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:1565 — AboutFragment.buildTableDump has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 1 (3 pts), loops 2, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServerSelectionFragment.initServers (cognitive 19) · ×1
  • ServerSelectionFragment.initServers (cognitive 19) app/src/main/java/com/celzero/bravedns/ui/fragment/ServerSelectionFragment.kt:1108 — ServerSelectionFragment.initServers has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WgInterfaceViewHolder.updateStatusUi (cognitive 18) · ×1
  • WgInterfaceViewHolder.updateStatusUi (cognitive 18) app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:444 — WgInterfaceViewHolder.updateStatusUi has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BugReportZipper.rezipAll (cognitive 18) · ×1
  • BugReportZipper.rezipAll (cognitive 18) app/src/main/java/com/celzero/bravedns/scheduler/BugReportZipper.kt:177 — BugReportZipper.rezipAll has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TunFlowManager.handlePostflow (cognitive 18) · ×1
  • TunFlowManager.handlePostflow (cognitive 18) app/src/main/java/com/celzero/bravedns/service/TunFlowManager.kt:187 — TunFlowManager.handlePostflow has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AppInfoActivity.setupClickListeners (cognitive 18) · ×1
  • AppInfoActivity.setupClickListeners (cognitive 18) app/src/main/java/com/celzero/bravedns/ui/activity/AppInfoActivity.kt:1022 — AppInfoActivity.setupClickListeners has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · RulesImportHelper.importRules (cognitive 18) · ×1
  • RulesImportHelper.importRules (cognitive 18) app/src/main/java/com/celzero/bravedns/ui/fragment/RulesImportHelper.kt:191 — RulesImportHelper.importRules has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServerSelectionFragment.retryLoadingServers (cognitive 18) · ×1
  • ServerSelectionFragment.retryLoadingServers (cognitive 18) app/src/main/java/com/celzero/bravedns/ui/fragment/ServerSelectionFragment.kt:2815 — ServerSelectionFragment.retryLoadingServers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 pts), error handling 3 (4 pts), boolean chains 2, match/switch 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · WgIncludeAppsScreenKt.WgIncludeAppsScreen (cognitive 18) · ×1
  • WgIncludeAppsScreenKt.WgIncludeAppsScreen (cognitive 18) app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt:108 — WgIncludeAppsScreenKt.WgIncludeAppsScreen has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, match/switch 3, error handling 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · RpnLocationDetailScreenKt.RpnLocationDetailScreen (cognitive 18) · ×1
  • RpnLocationDetailScreenKt.RpnLocationDetailScreen (cognitive 18) app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnLocationDetailScreen.kt:78 — RpnLocationDetailScreenKt.RpnLocationDetailScreen has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (17 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · RpnSettingsScreenKt.RpnSettingsScreen (cognitive 18) · ×1
  • RpnSettingsScreenKt.RpnSettingsScreen (cognitive 18) app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnSettingsScreen.kt:67 — RpnSettingsScreenKt.RpnSettingsScreen has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16 (18 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · RpnProxyManager.storeWinEntitlement (cognitive 17) · ×1
  • RpnProxyManager.storeWinEntitlement (cognitive 17) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:930 — RpnProxyManager.storeWinEntitlement has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), error handling 5 (7 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · BraveVPNService.getUnderlays (cognitive 17) · ×1
  • BraveVPNService.getUnderlays (cognitive 17) app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:2527 — BraveVPNService.getUnderlays has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · BraveVPNService.screenUnlock (cognitive 17) · ×1
  • BraveVPNService.screenUnlock (cognitive 17) app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:4589 — BraveVPNService.screenUnlock has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WireguardManager.performRestore (cognitive 17) · ×1
  • WireguardManager.performRestore (cognitive 17) app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt:1334 — WireguardManager.performRestore has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 2, error handling 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · HomeScreenSettingBottomSheet.initializeClickListeners (cognitive 17) · ×1
  • HomeScreenSettingBottomSheet.initializeClickListeners (cognitive 17) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/HomeScreenSettingBottomSheet.kt:156 — HomeScreenSettingBottomSheet.initializeClickListeners has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 1, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AppHistogramView.onDraw (cognitive 17) · ×1
  • AppHistogramView.onDraw (cognitive 17) app/src/main/java/com/celzero/bravedns/ui/custom/AppHistogramView.kt:266 — AppHistogramView.onDraw has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConnectionTrackerFragment.setupConnectionTrackerRecyclerView (cognitive 17) · ×1
  • ConnectionTrackerFragment.setupConnectionTrackerRecyclerView (cognitive 17) app/src/main/java/com/celzero/bravedns/ui/fragment/ConnectionTrackerFragment.kt:188 — ConnectionTrackerFragment.setupConnectionTrackerRecyclerView has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, error handling 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ConnectionTrackerFragment.setupMergedRecyclerView) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · ConnectionTrackerFragment.setupMergedRecyclerView (cognitive 17) · ×1
  • ConnectionTrackerFragment.setupMergedRecyclerView (cognitive 17) app/src/main/java/com/celzero/bravedns/ui/fragment/ConnectionTrackerFragment.kt:243 — ConnectionTrackerFragment.setupMergedRecyclerView has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, error handling 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ConnectionTrackerFragment.setupConnectionTrackerRecyclerView) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · ProcessInfoCollector.threadsSection (cognitive 17) · ×1
  • ProcessInfoCollector.threadsSection (cognitive 17) app/src/main/java/com/celzero/bravedns/util/ProcessInfoCollector.kt:113 — ProcessInfoCollector.threadsSection has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RpnAddLocationScreenKt.RpnAddLocationScreen (cognitive 17) · ×1
  • RpnAddLocationScreenKt.RpnAddLocationScreen (cognitive 17) app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAddLocationScreen.kt:72 — RpnAddLocationScreenKt.RpnAddLocationScreen has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · RpnSupportScreenKt.RpnSupportScreen (cognitive 17) · ×1
  • RpnSupportScreenKt.RpnSupportScreen (cognitive 17) app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnSupportScreen.kt:103 — RpnSupportScreenKt.RpnSupportScreen has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · RefreshDatabase.process (cognitive 16) · ×1
  • RefreshDatabase.process (cognitive 16) app/src/main/java/com/celzero/bravedns/database/RefreshDatabase.kt:132 — RefreshDatabase.process has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 5, error handling 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · RpnProxyManager.migrateRpnFilesToInternalIfNeeded (cognitive 16) · ×1
  • RpnProxyManager.migrateRpnFilesToInternalIfNeeded (cognitive 16) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:2557 — RpnProxyManager.migrateRpnFilesToInternalIfNeeded has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 3 (5 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RpnProxyManager.updateWinConfigState (cognitive 16) · ×1
  • RpnProxyManager.updateWinConfigState (cognitive 16) app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt:2724 — RpnProxyManager.updateWinConfigState has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, error handling 5 (7 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · StateMachineDatabaseSyncService.determineStateFromSubscription (cognitive 16) · ×1
  • StateMachineDatabaseSyncService.determineStateFromSubscription (cognitive 16) app/src/main/java/com/celzero/bravedns/rpnproxy/StateMachineDatabaseSyncService.kt:73 — StateMachineDatabaseSyncService.determineStateFromSubscription has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), match/switch 3 (5 pts), boolean chains 4 (nesting depth added 4). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · BraveVPNService.updateNotificationBuilder (cognitive 16) · ×1
  • BraveVPNService.updateNotificationBuilder (cognitive 16) app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:903 — BraveVPNService.updateNotificationBuilder has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), match/switch 2, boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · BraveVPNService.setNetworkAndDefaultDnsIfNeeded (cognitive 16) · ×1
  • BraveVPNService.setNetworkAndDefaultDnsIfNeeded (cognitive 16) app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:2811 — BraveVPNService.setNetworkAndDefaultDnsIfNeeded has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · BraveVPNService.route6 (cognitive 16) · ×1
  • BraveVPNService.route6 (cognitive 16) app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:3342 — BraveVPNService.route6 has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: one other method here (BraveVPNService.route4) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · BraveVPNService.route4 (cognitive 16) · ×1
  • BraveVPNService.route4 (cognitive 16) app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt:3456 — BraveVPNService.route4 has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: one other method here (BraveVPNService.route6) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · GoMemLogConsumer.processSlot (cognitive 16) · ×1
  • GoMemLogConsumer.processSlot (cognitive 16) app/src/main/java/com/celzero/bravedns/service/GoMemLogConsumer.kt:249 — GoMemLogConsumer.processSlot has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 1, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WireguardManager.migrateEncryptedConfigsIfNeeded (cognitive 16) · ×1
  • WireguardManager.migrateEncryptedConfigsIfNeeded (cognitive 16) app/src/main/java/com/celzero/bravedns/service/WireguardManager.kt:177 — WireguardManager.migrateEncryptedConfigsIfNeeded has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, error handling 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TunDnsManager.getTransportIdToBypass (cognitive 16) · ×1
  • TunDnsManager.getTransportIdToBypass (cognitive 16) app/src/main/java/com/celzero/bravedns/tunnel/TunDnsManager.kt:773 — TunDnsManager.getTransportIdToBypass has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · BubbleActivity.setupLoadStateListeners (cognitive 16) · ×1
  • BubbleActivity.setupLoadStateListeners (cognitive 16) app/src/main/java/com/celzero/bravedns/ui/activity/BubbleActivity.kt:339 — BubbleActivity.setupLoadStateListeners has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RpnConfigDetailActivity.init (cognitive 16) · ×1
  • RpnConfigDetailActivity.init (cognitive 16) app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:269 — RpnConfigDetailActivity.init has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TunnelSettingsActivity.collectLockdownChecks (cognitive 16) · ×1
  • TunnelSettingsActivity.collectLockdownChecks (cognitive 16) app/src/main/java/com/celzero/bravedns/ui/activity/TunnelSettingsActivity.kt:1186 — TunnelSettingsActivity.collectLockdownChecks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · OrbotBottomSheet.setupClickListeners (cognitive 16) · ×1
  • OrbotBottomSheet.setupClickListeners (cognitive 16) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/OrbotBottomSheet.kt:146 — OrbotBottomSheet.setupClickListeners has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · AboutFragment.openStatsDialog (cognitive 16) · ×1
  • AboutFragment.openStatsDialog (cognitive 16) app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:1067 — AboutFragment.openStatsDialog has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 1, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · HomeScreenFragment.observeDnsStates (cognitive 16) · ×1
  • HomeScreenFragment.observeDnsStates (cognitive 16) app/src/main/java/com/celzero/bravedns/ui/fragment/HomeScreenFragment.kt:2285 — HomeScreenFragment.observeDnsStates has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BubbleHelper.showBubble (cognitive 16) · ×1
  • BubbleHelper.showBubble (cognitive 16) app/src/main/java/com/celzero/bravedns/util/BubbleHelper.kt:240 — BubbleHelper.showBubble has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 2, error handling 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ExceptionParser.parseJava (cognitive 16) · ×1
  • ExceptionParser.parseJava (cognitive 16) app/src/main/java/com/celzero/bravedns/util/ExceptionParser.kt:289 — ExceptionParser.parseJava has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RpnBypassAppsScreenKt.RpnBypassAppsScreen (cognitive 16) · ×1
  • RpnBypassAppsScreenKt.RpnBypassAppsScreen (cognitive 16) app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:100 — RpnBypassAppsScreenKt.RpnBypassAppsScreen has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, match/switch 3, error handling 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ProxyEditorScreenKt.ProxyEditorScreen (cognitive 16) · ×1
  • ProxyEditorScreenKt.ProxyEditorScreen (cognitive 16) app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/ProxyEditorScreen.kt:86 — ProxyEditorScreenKt.ProxyEditorScreen has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, match/switch 6 (7 pts), boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · RpnPlusDashboardScreenKt.RpnPlusDashboardScreen (cognitive 16) · ×1
  • RpnPlusDashboardScreenKt.RpnPlusDashboardScreen (cognitive 16) app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnPlusDashboardScreen.kt:72 — RpnPlusDashboardScreenKt.RpnPlusDashboardScreen has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 6, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D35 · Change Coupling · Change-coupling hub · ×1
  • Change-coupling hub: ConnectionTrackerDAO.kt → DnsLogDAO.kt, DnsLogRepository.kt, RethinkLogDao.kt app/src/main/java/com/celzero/bravedns/database/ConnectionTrackerDAO.kt — `app/src/main/java/com/celzero/bravedns/database/ConnectionTrackerDAO.kt` changes together with 3 other files — `app/src/main/java/com/celzero/bravedns/database/DnsLogDAO.kt`, `app/src/main/java/com/celzero/bravedns/database/DnsLogRepository.kt`, `app/src/main/java/com/celzero/bravedns/database/RethinkLogDao.kt` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (6 members, 23 shared lines) · ×1
  • Near-duplicate member family (6 members, 23 shared lines) app/src/play/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt:63 — app/src/play/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt:63-127 | app/src/play/java/com/celzero/bravedns/iab/DeviceNotRegisteredNotifier.kt:65-128 | app/src/play/java/com/celzero/bravedns/iab/PurchaseConflictNotifier.kt:77-140 | app/src/website/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt:63-127 | app/src/website/java/com/celzero/bravedns/iab/DeviceNotRegisteredNotifier.kt:65-128 | app/src/website/java/com/celzero/bravedns/iab/PurchaseConflictNotifier.kt:77-140 — These 6 members are variants of one another: a block of 23 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Near-duplicate member family (4 members, 38 shared lines) · ×1
  • Near-duplicate member family (4 members, 38 shared lines) app/src/tv/java/com/celzero/bravedns/tv/ui/apps/AppsScreen.kt:167 — app/src/tv/java/com/celzero/bravedns/tv/ui/apps/AppsScreen.kt:167-213 | app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:329-375 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt:356-402 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAppsScreen.kt:266-326 — These 4 members are variants of one another: a block of 38 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 37 shared lines) · ×1
  • Near-duplicate member family (3 members, 37 shared lines) app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:335 — app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:335-485 | app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt:271-424 | app/src/main/java/com/celzero/bravedns/adapter/RethinkLogAdapter.kt:241-377 — These 3 members are variants of one another: a block of 37 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 28 shared lines) · ×1
  • Near-duplicate member family (3 members, 28 shared lines) app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:100 — app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:100-259 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt:108-285 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAppsScreen.kt:65-198 — These 3 members are variants of one another: a block of 28 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member pair (66 shared lines) · ×1
  • Near-duplicate member pair (66 shared lines) app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:376 — app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:376-464 | app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt:318-404 — These two members are variants of one another: 66 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (28 shared lines) · ×1
  • Near-duplicate member pair (28 shared lines) app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:159 — app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:159-221 | app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt:137-227 — These two members are variants of one another: 28 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Members sharing a duplicated core (24 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (24 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/ui/activity/AdvancedSettingActivity.kt:52 — app/src/main/java/com/celzero/bravedns/ui/activity/AdvancedSettingActivity.kt:52-65 | app/src/main/java/com/celzero/bravedns/ui/activity/AntiCensorshipActivity.kt:88-102 | app/src/main/java/com/celzero/bravedns/ui/activity/AppInfoActivity.kt:221-248 | app/src/main/java/com/celzero/bravedns/ui/activity/AppListActivity.kt:220-237 | app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt:83-118 | app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseIpLogsActivity.kt:82-123 | app/src/main/java/com/celzero/bravedns/ui/activity/BlockFreeDnsActivity.kt:55-72 | app/src/main/java/com/celzero/bravedns/ui/activity/CheckoutActivity.kt:68-97 | app/src/main/java/com/celzero/bravedns/ui/activity/ConsoleLogActivity.kt:131-146 | app/src/main/java/com/celzero/bravedns/ui/activity/CustomRulesActivity.kt:81-98 | app/src/main/java/com/celzero/bravedns/ui/activity/DetailedStatisticsActivity.kt:71-109 | app/src/main/java/com/celzero/bravedns/ui/activity/DnsDetailActivity.kt:53-67 | app/src/main/java/com/celzero/bravedns/ui/activity/DnsListActivity.kt:56-71 | app/src/main/java/com/celzero/bravedns/ui/activity/DomainConnectionsActivity.kt:88-145 | app/src/main/java/com/celzero/bravedns/ui/activity/EventsActivity.kt:101-116 | app/src/main/java/com/celzero/bravedns/ui/activity/FirewallActivity.kt:56-70 | app/src/main/java/com/celzero/bravedns/ui/activity/NetworkLogsActivity.kt:75-98 | app/src/main/java/com/celzero/bravedns/ui/activity/PauseActivity.kt:63-81 | app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:115-131 | app/src/main/java/com/celzero/bravedns/ui/activity/RpnBypassAppsActivity.kt:115-138 | app/src/main/java/com/celzero/bravedns/ui/activity/RpnWinProxyDetailsActivity.kt:63-78 | app/src/main/java/com/celzero/bravedns/ui/activity/TcpProxyMainActivity.kt:39-53 | app/src/main/java/com/celzero/bravedns/ui/activity/TunnelSettingsActivity.kt:111-127 | app/src/main/java/com/celzero/bravedns/ui/activity/UniversalFirewallSettingsActivity.kt:70-83 — These 24 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 24 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 24 times.
D4 · Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (8 members, 50+ identical tokens) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:117 — app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:117-142 | app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:117-142 | app/src/main/java/com/celzero/bravedns/adapter/DohEndpointAdapter.kt:114-140 | app/src/main/java/com/celzero/bravedns/adapter/ODoHEndpointAdapter.kt:118-144 | app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:148-169 | app/src/main/java/com/celzero/bravedns/adapter/RethinkEndpointAdapter.kt:127-152 | app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:149-170 | app/src/main/java/com/celzero/bravedns/ui/adapter/VpnServerAdapter.kt:334-360 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (6 members, 50+ identical tokens) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1101 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1101-1137 | app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1152-1187 | app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1274-1320 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1101-1137 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1152-1187 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1274-1320 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Duplicated block (431 lines × 2) · ×1
  • Duplicated block (431 lines × 2) REDACTED:930 — REDACTED:930-1360 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:930-1360 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (212 lines × 2) · ×1
  • Duplicated block (212 lines × 2) app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:73 — app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:73-284 | app/src/websiteTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:73-284 — before extracting anything, compare `app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt` and `app/src/websiteTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 322 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (166 lines × 2) · ×1
  • Duplicated block (166 lines × 2) REDACTED:2372 — REDACTED:2372-2537 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:2372-2537 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (126 lines × 2) · ×1
  • Duplicated block (126 lines × 2) REDACTED:3803 — REDACTED:3803-3928 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3803-3928 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (123 lines × 2) · ×1
  • Duplicated block (123 lines × 2) REDACTED:567 — REDACTED:567-689 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:567-689 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (118 lines × 2) · ×1
  • Duplicated block (118 lines × 2) app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:304 — app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:304-421 | app/src/website/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:304-421 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt` and `app/src/website/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 326 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (95 lines × 2) · ×1
  • Duplicated block (95 lines × 2) app/src/play/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt:303 — app/src/play/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt:303-397 | app/src/website/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt:303-397 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt` and `app/src/website/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 325 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (92 lines × 2) · ×1
  • Duplicated block (92 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:895 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:895-986 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:895-986 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (91 lines × 2) · ×1
  • Duplicated block (91 lines × 2) REDACTED:2624 — REDACTED:2624-2714 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:2624-2714 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (88 lines × 2) · ×1
  • Duplicated block (88 lines × 2) REDACTED:140 — REDACTED:140-227 | app/src/website/java/com/celzero/bravedns/adapter/GooglePlaySubsAdapter.kt:140-227 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/adapter/GooglePlaySubsAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (85 lines × 2) · ×1
  • Duplicated block (85 lines × 2) REDACTED:2802 — REDACTED:2802-2886 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:2802-2886 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (84 lines × 2) · ×1
  • Duplicated block (84 lines × 2) REDACTED:2285 — REDACTED:2285-2368 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:2285-2368 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (82 lines × 2) · ×1
  • Duplicated block (82 lines × 2) REDACTED:1605 — REDACTED:1605-1686 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:1605-1686 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (77 lines × 2) · ×1
  • Duplicated block (77 lines × 2) app/src/play/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:266 — app/src/play/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:266-342 | app/src/website/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:266-342 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt` and `app/src/website/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 245 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (76 lines × 2) · ×1
  • Duplicated block (76 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:357 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:357-432 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:357-432 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (68–71 lines × 2) · ×1
  • Duplicated block (68–71 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:409 — app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:409-476 | app/src/main/java/com/celzero/bravedns/adapter/RethinkLogAdapter.kt:300-370 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/RethinkLogAdapter.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 225 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (69 lines × 2) · ×1
  • Duplicated block (69 lines × 2) app/src/play/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt:185 — app/src/play/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt:185-253 | app/src/website/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt:185-253 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt` and `app/src/website/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 325 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (68 lines × 2) · ×1
  • Duplicated block (68 lines × 2) REDACTED:1369 — REDACTED:1369-1436 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:1369-1436 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (66 lines × 2) · ×1
  • Duplicated block (66 lines × 2) app/src/play/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt:130 — app/src/play/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt:130-195 | app/src/website/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt:130-195 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt` and `app/src/website/java/com/celzero/bravedns/sponsor/billing/SponsorBillingManagerImpl.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 185 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (65 lines × 2) · ×1
  • Duplicated block (65 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1022 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1022-1086 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1022-1086 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1022` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (64 lines × 2) · ×1
  • Duplicated block (64 lines × 2) app/src/play/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt:64 — app/src/play/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt:64-127 | app/src/website/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt:64-127 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt` and `app/src/website/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (60 lines × 2) · ×1
  • Duplicated block (60 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:556 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:556-615 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:556-615 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:556` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (59 lines × 2) · ×1
  • Duplicated block (59 lines × 2) REDACTED:2196 — REDACTED:2196-2254 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:2196-2254 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (57 lines × 2) · ×1
  • Duplicated block (57 lines × 2) app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:689 — app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:689-745 | app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:689-745 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` and `app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 526 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (56 lines × 2) · ×1
  • Duplicated block (56 lines × 2) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:475 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:475-530 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:475-530 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:475` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (55 lines × 2) · ×1
  • Duplicated block (55 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/CustomIpAdapter.kt:358 — app/src/main/java/com/celzero/bravedns/adapter/CustomIpAdapter.kt:358-412 | app/src/main/java/com/celzero/bravedns/adapter/CustomIpAdapter.kt:505-559 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (51 lines × 2) · ×1
  • Duplicated block (51 lines × 2) REDACTED:2023 — REDACTED:2023-2073 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:2023-2073 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (45–49 lines × 2) · ×1
  • Duplicated block (45–49 lines × 2) app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:220 — app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:220-268 | app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:314-358 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:220` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (46 lines × 2) · ×1
  • Duplicated block (46 lines × 2) app/src/play/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:113 — app/src/play/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:113-158 | app/src/website/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:113-158 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt` and `app/src/website/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 245 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (41 lines × 2) · ×1
  • Duplicated block (41 lines × 2) app/src/play/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt:420 — app/src/play/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt:420-460 | app/src/website/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt:420-460 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt` and `app/src/website/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 325 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (32–38 lines × 2) · ×1
  • Duplicated block (32–38 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/DomainConnectionsActivity.kt:247 — app/src/main/java/com/celzero/bravedns/ui/activity/DomainConnectionsActivity.kt:247-284 | app/src/main/java/com/celzero/bravedns/ui/activity/DomainConnectionsActivity.kt:314-345 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/activity/DomainConnectionsActivity.kt:247` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (38 lines × 2) · ×1
  • Duplicated block (38 lines × 2) app/src/play/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt:283 — app/src/play/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt:283-320 | app/src/website/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt:283-320 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt` and `app/src/website/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt:283` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (35–37 lines × 2) · ×1
  • Duplicated block (35–37 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:310 — app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:310-346 | app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt:252-286 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:310` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (36 lines × 4) · ×1
  • Duplicated block (36 lines × 4) app/src/tv/java/com/celzero/bravedns/tv/ui/apps/AppsScreen.kt:172 — app/src/tv/java/com/celzero/bravedns/tv/ui/apps/AppsScreen.kt:172-207 | app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:334-369 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt:361-396 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAppsScreen.kt:271-306 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/apps/AppsScreen.kt:172` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `row` to `AppRow` in one and `RpnBypassRow` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (33–35 lines × 2) · ×1
  • Duplicated block (33–35 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/AppDomainRulesBottomSheet.kt:144 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/AppDomainRulesBottomSheet.kt:144-178 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/AppIpRulesBottomSheet.kt:155-187 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/AppDomainRulesBottomSheet.kt` and `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/AppIpRulesBottomSheet.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (3–35 lines × 6) · ×1
  • Duplicated block (3–35 lines × 6) app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1111 — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1111-1113 | app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1161-1163 | app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1286-1320 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1111-1113 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1161-1163 | app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1286-1320 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt` and `app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt` as WHOLE FILES: this scan already matched 37 separate duplicated blocks between them, totalling at least 955 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:1286` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×1
  • Duplicated block (32 lines × 2) app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:236 — app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:236-267 | app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt:236-267 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` and `app/src/website/java/com/celzero/bravedns/ui/fragment/RethinkPlusFragment.kt` as WHOLE FILES: this scan already matched 41 separate duplicated blocks between them, totalling at least 730 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (28–29 lines × 3) · ×1
  • Duplicated block (28–29 lines × 3) app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:223 — app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:223-251 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt:249-277 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAppsScreen.kt:165-192 — before extracting anything, compare `app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt` and `app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 189 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:223` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (29 lines × 3) · ×1
  • Duplicated block (29 lines × 3) app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:292 — app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:292-320 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt:318-346 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAppsScreen.kt:231-259 — before extracting anything, compare `app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt` and `app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 189 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (27–28 lines × 3) · ×1
  • Duplicated block (27–28 lines × 3) app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:307 — app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:307-333 | app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt:242-269 | app/src/main/java/com/celzero/bravedns/adapter/RethinkLogAdapter.kt:212-239 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:307` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `ruleName` to `String?` in one and `String` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (24–27 lines × 2) · ×1
  • Duplicated block (24–27 lines × 2) app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:1548 — app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:1548-1574 | app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:1606-1629 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:1548` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:1578` calls `i` and `app/src/main/java/com/celzero/bravedns/service/ConnectionMonitor.kt:1632` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (22–23 lines × 2) · ×1
  • Duplicated block (22–23 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/ConnectionTrackerFragment.kt:196 — app/src/main/java/com/celzero/bravedns/ui/fragment/ConnectionTrackerFragment.kt:196-217 | app/src/main/java/com/celzero/bravedns/ui/fragment/ConnectionTrackerFragment.kt:251-273 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/fragment/ConnectionTrackerFragment.kt:196` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (18–22 lines × 4) · ×1
  • Duplicated block (18–22 lines × 4) REDACTED:1015 — REDACTED:1015-1036 | REDACTED:3844-3861 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:1015-1036 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:3844-3861 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1015` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×1
  • Duplicated block (21–22 lines × 2) app/src/tv/java/com/celzero/bravedns/tv/ui/dns/DnsScreen.kt:287 — app/src/tv/java/com/celzero/bravedns/tv/ui/dns/DnsScreen.kt:287-308 | app/src/tv/java/com/celzero/bravedns/tv/ui/rules/RulesScreen.kt:78-98 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/dns/DnsScreen.kt:287` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (18–21 lines × 2) · ×1
  • Duplicated block (18–21 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/CustomDomainFragment.kt:467 — app/src/main/java/com/celzero/bravedns/ui/fragment/CustomDomainFragment.kt:467-484 | app/src/main/java/com/celzero/bravedns/ui/fragment/CustomIpFragment.kt:426-446 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/fragment/CustomDomainFragment.kt` and `app/src/main/java/com/celzero/bravedns/ui/fragment/CustomIpFragment.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 78 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (19–20 lines × 3) · ×1
  • Duplicated block (19–20 lines × 3) app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:197 — app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:197-216 | app/src/main/java/com/celzero/bravedns/adapter/DohEndpointAdapter.kt:202-220 | app/src/main/java/com/celzero/bravedns/adapter/ODoHEndpointAdapter.kt:190-209 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/DohEndpointAdapter.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 149 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:197` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `endpoint` to `DoTEndpoint` in one and `DoHEndpoint` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (15–20 lines × 2) · ×1
  • Duplicated block (15–20 lines × 2) app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1643 — app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1643-1657 | app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1831-1850 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1643` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1660` calls `add` and `app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1853` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (18–19 lines × 6) · ×1
  • Duplicated block (18–19 lines × 6) app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:215 — app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:215-232 | app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:238-256 | app/src/main/java/com/celzero/bravedns/adapter/DnsLogAdapter.kt:476-493 | app/src/main/java/com/celzero/bravedns/adapter/DnsLogAdapter.kt:499-517 | app/src/main/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt:729-746 | app/src/main/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt:752-770 — there are 6 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:215` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (18–19 lines × 3) · ×1
  • Duplicated block (18–19 lines × 3) app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:125 — app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:125-142 | app/src/main/java/com/celzero/bravedns/adapter/DohEndpointAdapter.kt:122-140 | app/src/main/java/com/celzero/bravedns/adapter/ODoHEndpointAdapter.kt:126-144 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/DohEndpointAdapter.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 149 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:125` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `holder` to `DoTEndpointViewHolder` in one and `DoHEndpointViewHolder` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (18–19 lines × 2) · ×1
  • Duplicated block (18–19 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:900 — app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:900-918 | app/src/main/java/com/celzero/bravedns/util/ProcessInfoCollector.kt:177-194 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/util/ProcessInfoCollector.kt:177` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13–19 lines × 2) · ×1
  • Duplicated block (13–19 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/SummaryStatisticsFragment.kt:619 — app/src/main/java/com/celzero/bravedns/ui/fragment/SummaryStatisticsFragment.kt:619-637 | app/src/main/java/com/celzero/bravedns/ui/fragment/SummaryStatisticsFragment.kt:824-836 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/fragment/SummaryStatisticsFragment.kt:619` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (18 lines × 7) · ×1
  • Duplicated block (18 lines × 7) app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:214 — app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:214-231 | app/src/main/java/com/celzero/bravedns/adapter/AppWiseDomainsAdapter.kt:237-254 | app/src/main/java/com/celzero/bravedns/adapter/DnsLogAdapter.kt:475-492 | app/src/main/java/com/celzero/bravedns/adapter/DnsLogAdapter.kt:498-515 | app/src/main/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt:728-745 | app/src/main/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt:751-768 | app/src/main/java/com/celzero/bravedns/ui/adapter/AppActivityAdapter.kt:413-430 — there are 7 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (18 lines × 6) · ×1
  • Duplicated block (18 lines × 6) app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:305 — app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:305-322 | app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:270-287 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt:296-313 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAppsScreen.kt:209-226 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnSupportScreen.kt:73-90 | app/src/websiteTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:305-322 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 6 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:305` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×1
  • Duplicated block (17–18 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:229 — app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:229-245 | app/src/main/java/com/celzero/bravedns/adapter/RethinkLogAdapter.kt:147-164 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/RethinkLogAdapter.kt` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 225 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:229` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `log` to `MergedConnectionLog` in one and `RethinkLog` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (12–17 lines × 4) · ×1
  • Duplicated block (12–17 lines × 4) app/src/main/java/com/celzero/bravedns/viewmodel/AppConnectionsViewModel.kt:100 — app/src/main/java/com/celzero/bravedns/viewmodel/AppConnectionsViewModel.kt:100-116 | app/src/main/java/com/celzero/bravedns/viewmodel/DomainConnectionsViewModel.kt:148-159 | app/src/main/java/com/celzero/bravedns/viewmodel/SummaryStatisticsViewModel.kt:88-99 | app/src/main/java/com/celzero/bravedns/viewmodel/WgNwActivityViewModel.kt:74-88 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (17 lines × 3) · ×1
  • Duplicated block (17 lines × 3) app/src/main/java/com/celzero/bravedns/scheduler/RpnProxyUpdateWorker.kt:90 — app/src/main/java/com/celzero/bravedns/scheduler/RpnProxyUpdateWorker.kt:90-109 | app/src/play/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt:89-105 | app/src/website/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt:89-105 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt` and `app/src/website/java/com/celzero/bravedns/iab/PendingPurchaseWorker.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 103 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/scheduler/RpnProxyUpdateWorker.kt:90` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (14–17 lines × 2) · ×1
  • Duplicated block (14–17 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/DnsBlocklistBottomSheet.kt:902 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/DnsBlocklistBottomSheet.kt:902-918 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/DnsBlocklistBottomSheet.kt:939-952 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/DnsBlocklistBottomSheet.kt:902` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–16 lines × 5) · ×1
  • Duplicated block (15–16 lines × 5) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:286 — app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:286-301 | app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt:198-213 | app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:283-297 | app/src/main/java/com/celzero/bravedns/adapter/DohEndpointAdapter.kt:282-296 | app/src/main/java/com/celzero/bravedns/adapter/ODoHEndpointAdapter.kt:287-301 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (16 lines × 4) · ×1
  • Duplicated block (16 lines × 4) app/src/tv/java/com/celzero/bravedns/tv/ui/apps/AppDetailScreen.kt:237 — app/src/tv/java/com/celzero/bravedns/tv/ui/apps/AppDetailScreen.kt:237-252 | app/src/tv/java/com/celzero/bravedns/tv/ui/console/ConsoleLogScreen.kt:151-166 | app/src/tv/java/com/celzero/bravedns/tv/ui/logs/LogsScreen.kt:415-430 | app/src/tv/java/com/celzero/bravedns/tv/ui/settings/SettingsScreen.kt:360-375 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/apps/AppDetailScreen.kt:237` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–16 lines × 3) · ×1
  • Duplicated block (14–16 lines × 3) app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:470 — app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:470-485 | app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt:409-424 | app/src/main/java/com/celzero/bravedns/adapter/RethinkLogAdapter.kt:364-377 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:470` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–15 lines × 4) · ×1
  • Duplicated block (10–15 lines × 4) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:265 — app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:265-279 | app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt:179-193 | app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:265-278 | app/src/main/java/com/celzero/bravedns/adapter/DohEndpointAdapter.kt:268-277 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:265` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (12–15 lines × 2) · ×1
  • Duplicated block (12–15 lines × 2) app/src/main/java/com/celzero/bravedns/customdownloader/LocalBlocklistCoordinator.kt:460 — app/src/main/java/com/celzero/bravedns/customdownloader/LocalBlocklistCoordinator.kt:460-471 | app/src/main/java/com/celzero/bravedns/download/FileHandleWorker.kt:203-217 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/download/FileHandleWorker.kt:203` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×1
  • Duplicated block (14–15 lines × 2) app/src/main/java/com/celzero/bravedns/ui/dialog/RpnSsidDialog.kt:77 — app/src/main/java/com/celzero/bravedns/ui/dialog/RpnSsidDialog.kt:77-91 | app/src/main/java/com/celzero/bravedns/ui/dialog/WgSsidDialog.kt:63-76 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/dialog/RpnSsidDialog.kt` and `app/src/main/java/com/celzero/bravedns/ui/dialog/WgSsidDialog.kt` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (13–15 lines × 2) · ×1
  • Duplicated block (13–15 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:160 — app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt:160-172 | app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt:138-152 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusDashboardFragment.kt` and `app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10–14 lines × 6) · ×1
  • Duplicated block (10–14 lines × 6) app/src/play/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt:105 — app/src/play/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt:105-118 | app/src/play/java/com/celzero/bravedns/iab/DeviceNotRegisteredNotifier.kt:105-118 | app/src/play/java/com/celzero/bravedns/iab/PurchaseConflictNotifier.kt:122-131 | app/src/website/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt:105-118 | app/src/website/java/com/celzero/bravedns/iab/DeviceNotRegisteredNotifier.kt:105-118 | app/src/website/java/com/celzero/bravedns/iab/PurchaseConflictNotifier.kt:122-131 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt` and `app/src/website/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt:105` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×1
  • Duplicated block (14 lines × 4) app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:114 — app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:114-127 | app/src/main/java/com/celzero/bravedns/adapter/LocalSimpleViewAdapter.kt:148-161 | app/src/main/java/com/celzero/bravedns/adapter/RemoteAdvancedViewAdapter.kt:116-129 | app/src/main/java/com/celzero/bravedns/adapter/RemoteSimpleViewAdapter.kt:147-160 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/LocalSimpleViewAdapter.kt` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:114` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/celzero/bravedns/adapter/LocalAdvancedViewAdapter.kt:128` calls `fetchColor`, `setBackgroundColor` and `app/src/main/java/com/celzero/bravedns/adapter/LocalSimpleViewAdapter.kt:163` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13–14 lines × 4) · ×1
  • Duplicated block (13–14 lines × 4) app/src/main/java/com/celzero/bravedns/viewmodel/AppInfoViewModel.kt:235 — app/src/main/java/com/celzero/bravedns/viewmodel/AppInfoViewModel.kt:235-247 | app/src/main/java/com/celzero/bravedns/viewmodel/AppInfoViewModel.kt:258-270 | app/src/main/java/com/celzero/bravedns/viewmodel/AppInfoViewModel.kt:281-293 | app/src/main/java/com/celzero/bravedns/viewmodel/AppInfoViewModel.kt:304-317 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/viewmodel/AppInfoViewModel.kt:235` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 6) · ×1
  • Duplicated block (13 lines × 6) app/src/play/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt:88 — app/src/play/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt:88-100 | app/src/play/java/com/celzero/bravedns/iab/DeviceNotRegisteredNotifier.kt:88-100 | app/src/play/java/com/celzero/bravedns/iab/PurchaseConflictNotifier.kt:105-117 | app/src/website/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt:88-100 | app/src/website/java/com/celzero/bravedns/iab/DeviceNotRegisteredNotifier.kt:88-100 | app/src/website/java/com/celzero/bravedns/iab/PurchaseConflictNotifier.kt:105-117 — before extracting anything, compare `app/src/play/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt` and `app/src/website/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/play/java/com/celzero/bravedns/iab/DeviceAuthErrorNotifier.kt:88` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–13 lines × 2) · ×1
  • Duplicated block (10–13 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:290 — app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:290-299 | app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt:222-234 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:290` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×1
  • Duplicated block (11–13 lines × 2) app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:953 — app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:953-965 | app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:1113-1123 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/fragment/AboutFragment.kt:953` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×1
  • Duplicated block (12–13 lines × 2) app/src/tv/java/com/celzero/bravedns/tv/ui/dns/DnsScreen.kt:300 — app/src/tv/java/com/celzero/bravedns/tv/ui/dns/DnsScreen.kt:300-311 | app/src/tv/java/com/celzero/bravedns/tv/ui/settings/SettingsScreen.kt:370-382 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/dns/DnsScreen.kt:300` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (12 lines × 7) · ×1
  • Duplicated block (12 lines × 7) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:123 — app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:123-134 | app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:123-134 | app/src/main/java/com/celzero/bravedns/adapter/DohEndpointAdapter.kt:120-131 | app/src/main/java/com/celzero/bravedns/adapter/ODoHEndpointAdapter.kt:124-135 | app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:154-165 | app/src/main/java/com/celzero/bravedns/adapter/RethinkEndpointAdapter.kt:133-144 | app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:155-166 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:123` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `holder` to `DnsCryptEndpointViewHolder` in one and `DoTEndpointViewHolder` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (10–12 lines × 6) · ×1
  • Duplicated block (10–12 lines × 6) app/src/main/java/com/celzero/bravedns/ui/activity/AdvancedSettingActivity.kt:54 — app/src/main/java/com/celzero/bravedns/ui/activity/AdvancedSettingActivity.kt:54-63 | app/src/main/java/com/celzero/bravedns/ui/activity/AntiCensorshipActivity.kt:90-100 | app/src/main/java/com/celzero/bravedns/ui/activity/ConsoleLogActivity.kt:133-143 | app/src/main/java/com/celzero/bravedns/ui/activity/EventsActivity.kt:103-114 | app/src/main/java/com/celzero/bravedns/ui/activity/PauseActivity.kt:65-76 | app/src/main/java/com/celzero/bravedns/ui/activity/TunnelSettingsActivity.kt:114-125 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 6 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (11–12 lines × 5) · ×1
  • Duplicated block (11–12 lines × 5) app/src/main/java/com/celzero/bravedns/ui/activity/CheckoutActivity.kt:70 — app/src/main/java/com/celzero/bravedns/ui/activity/CheckoutActivity.kt:70-80 | app/src/main/java/com/celzero/bravedns/ui/activity/DnsDetailActivity.kt:55-66 | app/src/main/java/com/celzero/bravedns/ui/activity/FirewallActivity.kt:58-69 | app/src/main/java/com/celzero/bravedns/ui/activity/TcpProxyMainActivity.kt:41-51 | app/src/main/java/com/celzero/bravedns/ui/activity/UniversalFirewallSettingsActivity.kt:72-82 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/celzero/bravedns/ui/activity/CheckoutActivity.kt:81` calls `setupClickListeners` and `app/src/main/java/com/celzero/bravedns/ui/activity/DnsDetailActivity.kt:67` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10–12 lines × 3) · ×1
  • Duplicated block (10–12 lines × 3) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/AutoExcludeCountriesBottomSheet.kt:158 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/AutoExcludeCountriesBottomSheet.kt:158-169 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/RpnRemoteServiceBottomSheet.kt:95-104 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/RpnStatsBottomSheet.kt:115-125 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/AutoExcludeCountriesBottomSheet.kt:158` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–12 lines × 3) · ×1
  • Duplicated block (11–12 lines × 3) app/src/tv/java/com/celzero/bravedns/tv/ui/dns/OdohAddScreen.kt:210 — app/src/tv/java/com/celzero/bravedns/tv/ui/dns/OdohAddScreen.kt:210-220 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgImportScreen.kt:268-278 | app/src/tv/java/com/celzero/bravedns/tv/ui/settings/PauseVpnScreen.kt:120-131 — before extracting anything, compare `app/src/tv/java/com/celzero/bravedns/tv/ui/dns/OdohAddScreen.kt` and `app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgImportScreen.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/dns/OdohAddScreen.kt:210` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10–12 lines × 2) · ×1
  • Duplicated block (10–12 lines × 2) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/LocalBlocklistsBottomSheet.kt:710 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/LocalBlocklistsBottomSheet.kt:710-721 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/LocalBlocklistsBottomSheet.kt:746-755 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/LocalBlocklistsBottomSheet.kt:710` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (11 lines × 12) · ×1
  • Duplicated block (11 lines × 12) app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:337 — app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:337-347 | app/src/tv/java/com/celzero/bravedns/tv/ui/dns/DnsScreen.kt:332-342 | app/src/tv/java/com/celzero/bravedns/tv/ui/logs/LogsScreen.kt:374-384 | app/src/tv/java/com/celzero/bravedns/tv/ui/logs/LogsScreen.kt:597-607 | app/src/tv/java/com/celzero/bravedns/tv/ui/logs/LogsScreen.kt:652-662 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/ProxyScreen.kt:237-247 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgDetailScreen.kt:241-251 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAddLocationScreen.kt:217-227 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnHomeScreen.kt:425-435 | app/src/tv/java/com/celzero/bravedns/tv/ui/rules/CustomDomainRulesList.kt:117-127 | app/src/tv/java/com/celzero/bravedns/tv/ui/rules/CustomIpRulesList.kt:122-132 | app/src/websiteTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:337-347 — there are 12 copies across 10 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 12 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:337` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/tv/java/com/celzero/bravedns/tv/ui/logs/LogsScreen.kt:608` calls `BlockChip`, `Spacer`, `width` and `app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:348` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (11 lines × 8) · ×1
  • Duplicated block (11 lines × 8) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:120 — app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:120-130 | app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:120-130 | app/src/main/java/com/celzero/bravedns/adapter/DohEndpointAdapter.kt:117-127 | app/src/main/java/com/celzero/bravedns/adapter/ODoHEndpointAdapter.kt:121-131 | app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:151-161 | app/src/main/java/com/celzero/bravedns/adapter/RethinkEndpointAdapter.kt:130-140 | app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:152-162 | app/src/main/java/com/celzero/bravedns/ui/adapter/VpnServerAdapter.kt:337-347 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:120` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `holder` to `DnsCryptEndpointViewHolder` in one and `DoTEndpointViewHolder` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (11 lines × 5) · ×1
  • Duplicated block (11 lines × 5) app/src/main/java/com/celzero/bravedns/ui/fragment/DnsCryptListFragment.kt:175 — app/src/main/java/com/celzero/bravedns/ui/fragment/DnsCryptListFragment.kt:175-185 | app/src/main/java/com/celzero/bravedns/ui/fragment/DnsProxyListFragment.kt:156-166 | app/src/main/java/com/celzero/bravedns/ui/fragment/DoTListFragment.kt:132-142 | app/src/main/java/com/celzero/bravedns/ui/fragment/DohListFragment.kt:141-151 | app/src/main/java/com/celzero/bravedns/ui/fragment/ODoHListFragment.kt:137-147 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/ui/fragment/DnsCryptListFragment.kt` and `app/src/main/java/com/celzero/bravedns/ui/fragment/ODoHListFragment.kt` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `app/src/main/java/com/celzero/bravedns/ui/fragment/DnsCryptListFragment.kt:174` calls `show` and `app/src/main/java/com/celzero/bravedns/ui/fragment/DnsProxyListFragment.kt:155` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10–11 lines × 3) · ×1
  • Duplicated block (10–11 lines × 3) app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:295 — app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:295-304 | app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt:229-239 | app/src/main/java/com/celzero/bravedns/adapter/RethinkLogAdapter.kt:199-209 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:295` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (4–11 lines × 4) · ×1
  • Duplicated block (4–11 lines × 4) app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:175 — app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:175-185 | app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:411-414 | app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt:415-422 | app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt:225-235 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 195 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/GenericHopAdapter.kt:175` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×1
  • Duplicated block (10–11 lines × 2) app/src/main/java/com/celzero/bravedns/ui/activity/ConsoleLogActivity.kt:383 — app/src/main/java/com/celzero/bravedns/ui/activity/ConsoleLogActivity.kt:383-392 | app/src/main/java/com/celzero/bravedns/ui/activity/MiscSettingsActivity.kt:826-836 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (4–11 lines × 3) · ×1
  • Duplicated block (4–11 lines × 3) app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:1666 — app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:1666-1676 | app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt:1382-1392 | app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt:1398-1401 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9–10 lines × 7) · ×1
  • Duplicated block (9–10 lines × 7) app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:307 — app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:307-316 | app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:272-281 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt:298-307 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAppsScreen.kt:211-220 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnHomeScreen.kt:396-404 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnSupportScreen.kt:75-84 | app/src/websiteTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:307-316 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 7 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:307` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9–10 lines × 6) · ×1
  • Duplicated block (9–10 lines × 6) app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt:733 — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt:733-741 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/DnsBlocklistBottomSheet.kt:274-282 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/DnsBlocklistBottomSheet.kt:604-612 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/OrbotBottomSheet.kt:581-589 | app/src/main/java/com/celzero/bravedns/ui/fragment/DnsCryptListFragment.kt:170-179 | app/src/main/java/com/celzero/bravedns/ui/fragment/ODoHListFragment.kt:133-141 — there are 6 copies across 5 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/celzero/bravedns/ui/fragment/DnsCryptListFragment.kt:182` calls `setSoftInputMode` and `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt:742` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9–10 lines × 5) · ×1
  • Duplicated block (9–10 lines × 5) app/src/main/java/com/celzero/bravedns/adapter/CustomIpAdapter.kt:567 — app/src/main/java/com/celzero/bravedns/adapter/CustomIpAdapter.kt:567-576 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt:735-744 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/DnsBlocklistBottomSheet.kt:276-284 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/DnsBlocklistBottomSheet.kt:606-615 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/OrbotBottomSheet.kt:583-592 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (10 lines × 5) · ×1
  • Duplicated block (10 lines × 5) app/src/tv/java/com/celzero/bravedns/tv/ui/console/ConsoleLogScreen.kt:159 — app/src/tv/java/com/celzero/bravedns/tv/ui/console/ConsoleLogScreen.kt:159-168 | app/src/tv/java/com/celzero/bravedns/tv/ui/dns/DnsScreen.kt:298-308 | app/src/tv/java/com/celzero/bravedns/tv/ui/logs/LogsScreen.kt:423-432 | app/src/tv/java/com/celzero/bravedns/tv/ui/rules/RulesScreen.kt:89-98 | app/src/tv/java/com/celzero/bravedns/tv/ui/settings/SettingsScreen.kt:368-379 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/console/ConsoleLogScreen.kt:159` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8–10 lines × 4) · ×1
  • Duplicated block (8–10 lines × 4) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt:219 — app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt:219-226 | app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:303-312 | app/src/main/java/com/celzero/bravedns/adapter/DohEndpointAdapter.kt:302-311 | app/src/main/java/com/celzero/bravedns/adapter/ODoHEndpointAdapter.kt:307-316 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt:219` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–9 lines × 17) · ×1
  • Duplicated block (7–9 lines × 17) app/src/tv/java/com/celzero/bravedns/tv/ui/apps/AppsScreen.kt:172 — app/src/tv/java/com/celzero/bravedns/tv/ui/apps/AppsScreen.kt:172-180 | app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:334-342 | app/src/tv/java/com/celzero/bravedns/tv/ui/dns/DnsScreen.kt:330-336 | app/src/tv/java/com/celzero/bravedns/tv/ui/logs/LogsScreen.kt:595-601 | app/src/tv/java/com/celzero/bravedns/tv/ui/logs/LogsScreen.kt:650-656 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/ProxyScreen.kt:235-241 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/ProxyScreen.kt:334-340 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgDetailScreen.kt:239-245 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt:361-369 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAddLocationScreen.kt:215-221 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAppsScreen.kt:271-279 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnHeatmap.kt:225-231 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnHomeScreen.kt:423-429 | app/src/tv/java/com/celzero/bravedns/tv/ui/rules/CustomDomainRulesList.kt:115-121 | app/src/tv/java/com/celzero/bravedns/tv/ui/rules/CustomIpRulesList.kt:120-126 | app/src/tv/java/com/celzero/bravedns/tv/ui/settings/SettingsScreen.kt:276-284 | app/src/tv/java/com/celzero/bravedns/tv/ui/stats/StatsScreen.kt:264-270 — there are 17 copies across 15 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 17 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/apps/AppsScreen.kt:172` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6–9 lines × 16) · ×1
  • Duplicated block (6–9 lines × 16) app/src/main/java/com/celzero/bravedns/ui/activity/AdvancedSettingActivity.kt:53 — app/src/main/java/com/celzero/bravedns/ui/activity/AdvancedSettingActivity.kt:53-59 | app/src/main/java/com/celzero/bravedns/ui/activity/AntiCensorshipActivity.kt:89-96 | app/src/main/java/com/celzero/bravedns/ui/activity/AppInfoActivity.kt:222-227 | app/src/main/java/com/celzero/bravedns/ui/activity/AppListActivity.kt:221-228 | app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt:84-91 | app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseIpLogsActivity.kt:83-90 | app/src/main/java/com/celzero/bravedns/ui/activity/BlockFreeDnsActivity.kt:56-63 | app/src/main/java/com/celzero/bravedns/ui/activity/CheckoutActivity.kt:69-76 | app/src/main/java/com/celzero/bravedns/ui/activity/ConsoleLogActivity.kt:132-139 | app/src/main/java/com/celzero/bravedns/ui/activity/DnsListActivity.kt:57-64 | app/src/main/java/com/celzero/bravedns/ui/activity/EventsActivity.kt:102-109 | app/src/main/java/com/celzero/bravedns/ui/activity/PauseActivity.kt:64-71 | app/src/main/java/com/celzero/bravedns/ui/activity/RpnBypassAppsActivity.kt:116-124 | app/src/main/java/com/celzero/bravedns/ui/activity/TcpProxyMainActivity.kt:40-47 | app/src/main/java/com/celzero/bravedns/ui/activity/TunnelSettingsActivity.kt:112-120 | app/src/main/java/com/celzero/bravedns/ui/activity/UniversalFirewallSettingsActivity.kt:71-78 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 16 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/ui/activity/AdvancedSettingActivity.kt:53` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9 lines × 9) · ×1
  • Duplicated block (9 lines × 9) app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:303 — app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:303-311 | app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:268-276 | app/src/tv/java/com/celzero/bravedns/tv/ui/logs/LogsScreen.kt:370-378 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt:294-302 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAddLocationScreen.kt:287-295 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAppsScreen.kt:207-215 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnSettingsScreen.kt:354-362 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnSupportScreen.kt:71-79 | app/src/websiteTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:303-311 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 9 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 9 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:303` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 8) · ×1
  • Duplicated block (9 lines × 8) app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:307 — app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:307-315 | app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:272-280 | app/src/tv/java/com/celzero/bravedns/tv/ui/console/ConsoleLogScreen.kt:163-171 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt:298-306 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAppsScreen.kt:211-219 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnHomeScreen.kt:396-404 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnSupportScreen.kt:75-83 | app/src/websiteTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:307-315 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 8 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 8 times. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/playTv/java/com/celzero/bravedns/tv/ui/rpn/RpnPurchaseRoute.kt:307` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×1
  • Duplicated block (9 lines × 4) app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1603 — app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1603-1611 | app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1794-1802 | app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:1901-1909 | app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt:2137-2145 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (7–9 lines × 2) · ×1
  • Duplicated block (7–9 lines × 2) app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:346 — app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:346-352 | app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:639-647 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:346` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 24) · ×1
  • Duplicated block (8 lines × 24) app/src/main/java/com/celzero/bravedns/ui/activity/AdvancedSettingActivity.kt:54 — app/src/main/java/com/celzero/bravedns/ui/activity/AdvancedSettingActivity.kt:54-62 | app/src/main/java/com/celzero/bravedns/ui/activity/AntiCensorshipActivity.kt:90-99 | app/src/main/java/com/celzero/bravedns/ui/activity/AppInfoActivity.kt:223-230 | app/src/main/java/com/celzero/bravedns/ui/activity/AppListActivity.kt:222-231 | app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt:85-94 | app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseIpLogsActivity.kt:84-93 | app/src/main/java/com/celzero/bravedns/ui/activity/BlockFreeDnsActivity.kt:57-66 | app/src/main/java/com/celzero/bravedns/ui/activity/CheckoutActivity.kt:70-79 | app/src/main/java/com/celzero/bravedns/ui/activity/ConsoleLogActivity.kt:133-142 | app/src/main/java/com/celzero/bravedns/ui/activity/CustomRulesActivity.kt:83-92 | app/src/main/java/com/celzero/bravedns/ui/activity/DetailedStatisticsActivity.kt:73-80 | app/src/main/java/com/celzero/bravedns/ui/activity/DnsDetailActivity.kt:55-64 | app/src/main/java/com/celzero/bravedns/ui/activity/DnsListActivity.kt:58-67 | app/src/main/java/com/celzero/bravedns/ui/activity/DomainConnectionsActivity.kt:90-99 | app/src/main/java/com/celzero/bravedns/ui/activity/EventsActivity.kt:103-112 | app/src/main/java/com/celzero/bravedns/ui/activity/FirewallActivity.kt:58-67 | app/src/main/java/com/celzero/bravedns/ui/activity/NetworkLogsActivity.kt:77-86 | app/src/main/java/com/celzero/bravedns/ui/activity/PauseActivity.kt:65-74 | app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:117-126 | app/src/main/java/com/celzero/bravedns/ui/activity/RpnBypassAppsActivity.kt:117-127 | app/src/main/java/com/celzero/bravedns/ui/activity/RpnWinProxyDetailsActivity.kt:65-74 | app/src/main/java/com/celzero/bravedns/ui/activity/TcpProxyMainActivity.kt:41-50 | app/src/main/java/com/celzero/bravedns/ui/activity/TunnelSettingsActivity.kt:114-123 | app/src/main/java/com/celzero/bravedns/ui/activity/UniversalFirewallSettingsActivity.kt:72-81 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 24 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseIpLogsActivity.kt:96` calls `getBooleanExtra` and `app/src/main/java/com/celzero/bravedns/ui/activity/AppWiseDomainLogsActivity.kt:97` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8 lines × 22) · ×1
  • Duplicated block (8 lines × 22) app/src/tv/java/com/celzero/bravedns/tv/ui/apps/AppsScreen.kt:170 — app/src/tv/java/com/celzero/bravedns/tv/ui/apps/AppsScreen.kt:170-177 | app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:332-339 | app/src/tv/java/com/celzero/bravedns/tv/ui/common/SettingToggleRow.kt:98-105 | app/src/tv/java/com/celzero/bravedns/tv/ui/dns/DnsScreen.kt:328-335 | app/src/tv/java/com/celzero/bravedns/tv/ui/logs/LogsScreen.kt:213-220 | app/src/tv/java/com/celzero/bravedns/tv/ui/logs/LogsScreen.kt:342-349 | app/src/tv/java/com/celzero/bravedns/tv/ui/logs/LogsScreen.kt:593-600 | app/src/tv/java/com/celzero/bravedns/tv/ui/logs/LogsScreen.kt:648-655 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/ProxyScreen.kt:233-240 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/ProxyScreen.kt:332-339 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgDetailScreen.kt:237-244 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt:359-366 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAddLocationScreen.kt:213-220 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAppsScreen.kt:269-276 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnCommon.kt:170-177 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnHeatmap.kt:223-230 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnHomeScreen.kt:392-399 | app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnHomeScreen.kt:421-428 | app/src/tv/java/com/celzero/bravedns/tv/ui/rules/CustomDomainRulesList.kt:113-120 | app/src/tv/java/com/celzero/bravedns/tv/ui/rules/CustomIpRulesList.kt:118-125 | app/src/tv/java/com/celzero/bravedns/tv/ui/settings/SettingsScreen.kt:274-281 | app/src/tv/java/com/celzero/bravedns/tv/ui/stats/StatsScreen.kt:262-269 — there are 22 copies across 17 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 22 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/apps/AppsScreen.kt:170` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 7) · ×1
  • Duplicated block (8 lines × 7) app/src/main/java/com/celzero/bravedns/adapter/CustomIpAdapter.kt:566 — app/src/main/java/com/celzero/bravedns/adapter/CustomIpAdapter.kt:566-573 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt:734-741 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/DnsBlocklistBottomSheet.kt:275-282 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/DnsBlocklistBottomSheet.kt:605-612 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/OrbotBottomSheet.kt:582-589 | app/src/main/java/com/celzero/bravedns/ui/fragment/DnsCryptListFragment.kt:172-179 | app/src/main/java/com/celzero/bravedns/ui/fragment/ODoHListFragment.kt:134-141 — there are 7 copies across 6 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/celzero/bravedns/ui/fragment/DnsCryptListFragment.kt:182` calls `setSoftInputMode` and `app/src/main/java/com/celzero/bravedns/adapter/CustomIpAdapter.kt:574` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7–8 lines × 3) · ×1
  • Duplicated block (7–8 lines × 3) app/src/tv/java/com/celzero/bravedns/tv/ui/apps/AppDetailScreen.kt:250 — app/src/tv/java/com/celzero/bravedns/tv/ui/apps/AppDetailScreen.kt:250-257 | app/src/tv/java/com/celzero/bravedns/tv/ui/dns/OdohAddScreen.kt:192-198 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgImportScreen.kt:250-256 — before extracting anything, compare `app/src/tv/java/com/celzero/bravedns/tv/ui/dns/OdohAddScreen.kt` and `app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgImportScreen.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/apps/AppDetailScreen.kt:250` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×1
  • Duplicated block (7 lines × 4) app/src/tv/java/com/celzero/bravedns/tv/ui/apps/AppDetailScreen.kt:249 — app/src/tv/java/com/celzero/bravedns/tv/ui/apps/AppDetailScreen.kt:249-255 | app/src/tv/java/com/celzero/bravedns/tv/ui/common/SettingToggleRow.kt:102-108 | app/src/tv/java/com/celzero/bravedns/tv/ui/dns/OdohAddScreen.kt:191-197 | app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgImportScreen.kt:249-255 — before extracting anything, compare `app/src/tv/java/com/celzero/bravedns/tv/ui/dns/OdohAddScreen.kt` and `app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgImportScreen.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/tv/java/com/celzero/bravedns/tv/ui/apps/AppDetailScreen.kt:249` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 7) · ×1
  • Duplicated block (6 lines × 7) app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:1030 — app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:1030-1035 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt:734-739 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/DnsBlocklistBottomSheet.kt:275-280 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/DnsBlocklistBottomSheet.kt:605-610 | app/src/main/java/com/celzero/bravedns/ui/bottomsheet/OrbotBottomSheet.kt:582-587 | app/src/main/java/com/celzero/bravedns/ui/fragment/DnsCryptListFragment.kt:172-177 | app/src/main/java/com/celzero/bravedns/ui/fragment/ODoHListFragment.kt:134-139 — there are 7 copies across 6 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/celzero/bravedns/ui/activity/ProxySettingsActivity.kt:1038` calls `setCanceledOnTouchOutside` and `app/src/main/java/com/celzero/bravedns/ui/bottomsheet/ConnTrackerBottomSheet.kt:742` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×1
  • Duplicated block (5 lines × 4) REDACTED:1941 — REDACTED:1941-1945 | app/src/play/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:362-366 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:1941-1945 | app/src/website/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:362-366 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1941` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×1
  • Duplicated block (5 lines × 3) app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:497 — app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:497-501 | app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt:436-441 | app/src/main/java/com/celzero/bravedns/adapter/RethinkLogAdapter.kt:389-394 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 120 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:497` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (9 lines × 13) · ×1
  • Duplicated block (9 lines × 13) app/src/main/java/com/celzero/bravedns/adapter/BlocklistAppsAdapter.kt:204 — app/src/main/java/com/celzero/bravedns/adapter/BlocklistAppsAdapter.kt:204-212 | app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt:470-480 | app/src/main/java/com/celzero/bravedns/adapter/CustomDomainAdapter.kt:657-667 | app/src/main/java/com/celzero/bravedns/adapter/CustomIpAdapter.kt:672-682 | app/src/main/java/com/celzero/bravedns/adapter/DomainConnectionsAdapter.kt:175-185 | app/src/main/java/com/celzero/bravedns/adapter/FirewallAppListAdapter.kt:482-492 | app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:617-627 | app/src/main/java/com/celzero/bravedns/adapter/RethinkLogAdapter.kt:423-433 | app/src/main/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt:821-831 | app/src/main/java/com/celzero/bravedns/adapter/WgHopAdapter.kt:449-459 | app/src/main/java/com/celzero/bravedns/adapter/WgIncludeAppsAdapter.kt:327-337 | app/src/main/java/com/celzero/bravedns/adapter/WgNwStatsAdapter.kt:204-214 | app/src/main/java/com/celzero/bravedns/adapter/WgPeersAdapter.kt:142-152 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/RethinkLogAdapter.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 108 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11 lines × 9) · ×1
  • Duplicated block (11 lines × 9) app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:148 — app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:148-158 | app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:355-365 | app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:148-158 | app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:346-356 | app/src/main/java/com/celzero/bravedns/adapter/DohEndpointAdapter.kt:146-156 | app/src/main/java/com/celzero/bravedns/adapter/ODoHEndpointAdapter.kt:150-160 | app/src/main/java/com/celzero/bravedns/adapter/ODoHEndpointAdapter.kt:350-360 | app/src/main/java/com/celzero/bravedns/adapter/RethinkEndpointAdapter.kt:158-168 | app/src/main/java/com/celzero/bravedns/adapter/RethinkEndpointAdapter.kt:370-380 — before extracting anything, compare `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt` and `app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `app/src/main/java/com/celzero/bravedns/adapter/ODoHEndpointAdapter.kt:362` calls `io`, `suspend`, `withContext` and `app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:366` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×1
  • Duplicated block (12 lines × 4) app/src/main/java/com/celzero/bravedns/ui/activity/AppListActivity.kt:863 — app/src/main/java/com/celzero/bravedns/ui/activity/AppListActivity.kt:863-874 | app/src/main/java/com/celzero/bravedns/ui/activity/RpnBypassAppsActivity.kt:140-152 | app/src/main/java/com/celzero/bravedns/ui/activity/WgIncludeAppsActivity.kt:121-133 | app/src/main/java/com/celzero/bravedns/ui/fragment/DnsSettingsFragment.kt:798-810 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
D4 · Code Duplication · Duplicated block (5 lines × 6) · ×1
  • Duplicated block (5 lines × 6) REDACTED:1964 — REDACTED:1964-1968 | app/src/play/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt:513-517 | app/src/play/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:375-379 | app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt:1964-1968 | app/src/website/java/com/celzero/bravedns/iab/OneTimePurchaseProcessor.kt:513-517 | app/src/website/java/com/celzero/bravedns/iab/SubscriptionPurchaseProcessor.kt:375-379 — before extracting anything, compare `REDACTED` and `app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt` as WHOLE FILES: this scan already matched 81 separate duplicated blocks between them, totalling at least 2831 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×1
  • Duplicated block (6 lines × 3) app/src/main/java/com/celzero/bravedns/ui/activity/CustomerSupportActivity.kt:190 — app/src/main/java/com/celzero/bravedns/ui/activity/CustomerSupportActivity.kt:190-195 | app/src/main/java/com/celzero/bravedns/ui/activity/ServerOrderHistoryActivity.kt:257-262 | app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkPlusManagePurchaseFragment.kt:240-245 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Minor — 74 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate app/src/play/java/com/celzero/bravedns/iab/Security.java:57 — `TextUtils.isEmpty(signedData) || TextUtils.isEmpty(BASE_64_ENCODED_PUBLIC_KEY) || TextUtils.isEmpty(signature)` appears character-identically in 2 files — app/src/play/java/com/celzero/bravedns/iab/Security.java, app/src/website/java/com/celzero/bravedns/iab/Security.java. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:3030 — `!alreadyAuthErrorActive && !serverApiErrorLiveData.hasActiveObservers()` appears character-identically in 2 files — REDACTED, app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:3119 — `!alreadyConflictActive && !serverApiErrorLiveData.hasActiveObservers()` appears character-identically in 2 files — REDACTED, app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:349 — `!cid.isNullOrBlank() && !did.isNullOrBlank()` appears character-identically in 2 files — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt, app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:735 — `!cidWasAbsent && !storedDid.isNullOrBlank()` appears character-identically in 2 files — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt, app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:355 — `!extendMode && !currentState.canMakePurchase` appears character-identically in 2 files — app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt, app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt:225 — `!extendMode && InAppBillingHandler.hasValidSubscription()` appears character-identically in 2 files — app/src/play/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt, app/src/website/java/com/celzero/bravedns/viewmodel/RethinkPlusViewModel.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/build.gradle.kts:30 — `!fdroidBuildServer.isNullOrEmpty() && fdroidBuildServer != "null"` appears character-identically in 2 files — app/build.gradle.kts, build.gradle.kts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:2721 — `!forceExtend && !subscriptionStateMachine.canMakePurchase()` appears character-identically in 2 files — REDACTED, app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt:403 — `!host.isNullOrBlank() && HostName(host).asAddress() != null` appears character-identically in 3 files — app/src/main/java/com/celzero/bravedns/adapter/OneWgConfigAdapter.kt, app/src/main/java/com/celzero/bravedns/adapter/WgConfigAdapter.kt, app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:517 — `!isBillingClientSetup() || !billingClient.isReady` appears character-identically in 2 files — REDACTED, app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/src/main/java/com/celzero/bravedns/ui/HomeScreenActivity.kt:577 — `!isPlayStoreFlavour() && !isWebsiteFlavour()` appears character-identically in 2 files — app/src/main/java/com/celzero/bravedns/ui/HomeScreenActivity.kt, app/src/main/java/com/celzero/bravedns/util/Utilities.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:124 — `!lifecycleActive || holder.bindingAdapterPosition == RecyclerView.NO_POSITION` appears character-identically in 8 files — app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt, app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt, app/src/main/java/com/celzero/bravedns/adapter/DohEndpointAdapter.kt, app/src/main/java/com/celzero/bravedns/adapter/ODoHEndpointAdapter.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:1142 — `!pendingIsInApp && pendingProductId.isNotBlank()` appears character-identically in 2 files — REDACTED, app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt:1651 — `!pendingSsidEditor || isFinishing || isDestroyed` appears character-identically in 2 files — app/src/main/java/com/celzero/bravedns/ui/activity/RpnConfigDetailActivity.kt, app/src/main/java/com/celzero/bravedns/ui/activity/WgConfigDetailActivity.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:251 — `!prodCid.isNullOrBlank() || !testCid.isNullOrBlank()` appears character-identically in 2 files — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt, app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt:443 — `!storedAcc.isNullOrBlank() && !storedDev.isNullOrBlank()` appears character-identically in 2 files — app/src/play/java/com/celzero/bravedns/iab/BillingBackendClient.kt, app/src/website/java/com/celzero/bravedns/iab/BillingBackendClient.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:500 — `(FirewallRuleset.isProxied(rule) && proxyDetails.isNotEmpty() && proxy) || isProxyError` appears character-identically in 3 files — app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt, app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt, app/src/main/java/com/celzero/bravedns/adapter/RethinkLogAdapter.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:512 — `(log.protocol == Protocol.UDP.protocolType && log.duration > MAX_TIME_UDP) || (log.protocol == Protocol.TCP.protocolType && log.duration > M…` appears character-identically in 2 files — app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt, app/src/main/java/com/celzero/bravedns/adapter/RethinkLogAdapter.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:610 — `::billingClient.isInitialized && billingClient.isReady` appears character-identically in 2 files — REDACTED, app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:453 — `InAppBillingHandler.isBillingClientSetup() && !isListenerRegistered(listener)` appears character-identically in 2 files — app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt, app/src/website/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt:448 — `InAppBillingHandler.isBillingClientSetup() && isListenerRegistered(listener)` appears character-identically in 2 files — app/src/play/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt, app/src/website/java/com/celzero/bravedns/iab/SubscriptionCheckWorker.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:290 — `Protocol.UDP.protocolType != proto && Protocol.TCP.protocolType != proto` appears character-identically in 2 files — app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt, app/src/main/java/com/celzero/bravedns/adapter/ConnectionTrackerAdapter.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/src/main/java/com/celzero/bravedns/ui/bottomsheet/LocalBlocklistsBottomSheet.kt:352 — `VpnController.isVpnLockdown() && !persistentState.useCustomDownloadManager` appears character-identically in 2 files — app/src/main/java/com/celzero/bravedns/ui/bottomsheet/LocalBlocklistsBottomSheet.kt, app/src/main/java/com/celzero/bravedns/ui/fragment/RethinkBlocklistFragment.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate app/src/main/java/com/celzero/bravedns/ui/HomeScreenActivity.kt:336 — `WorkInfo.State.CANCELLED == workInfo.state || WorkInfo.State.FAILED == workInfo.state` appears character-identically in 6 files — app/src/main/java/com/celzero/bravedns/ui/HomeScreenActivity.kt, app/src/main/java/com/celzero/bravedns/ui/activity/CheckoutActivity.kt, app/src/main/java/com/celzero/bravedns/ui/activity/ConsoleLogActivity.kt, app/src/main/java/com/celzero/bravedns/ui/bottomsheet/LocalBlocklistsBottomSheet.kt. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
DM2 · Strongly-typed ids · Primitive id on a domain type · ×19
  • Primitive id on a domain type: ConnectionTracker.usrId app/src/main/java/com/celzero/bravedns/database/ConnectionTracker.kt:41 — `ConnectionTracker.usrId` is a raw `Int` — give it a strongly-typed id: a dedicated single-field type wrapping the `Int`, in whatever form your language spells that.
  • Primitive id on a domain type: ConnectionTracker.connId app/src/main/java/com/celzero/bravedns/database/ConnectionTracker.kt:52 — `ConnectionTracker.connId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
  • Primitive id on a domain type: CustomDomain.proxyId app/src/main/java/com/celzero/bravedns/database/CustomDomain.kt:32 — `CustomDomain.proxyId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
  • Primitive id on a domain type: CustomIp.proxyId app/src/main/java/com/celzero/bravedns/database/CustomIp.kt:40 — `CustomIp.proxyId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
  • Primitive id on a domain type: DnsLog.proxyId app/src/main/java/com/celzero/bravedns/database/DnsLog.kt:61 — `DnsLog.proxyId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
  • Primitive id on a domain type: DnsLog.resolverId app/src/main/java/com/celzero/bravedns/database/DnsLog.kt:68 — `DnsLog.resolverId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
  • Primitive id on a domain type: ProxyApplicationMapping.proxyId app/src/main/java/com/celzero/bravedns/database/ProxyApplicationMapping.kt:28 — `ProxyApplicationMapping.proxyId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
  • Primitive id on a domain type: RethinkLocalFileTag.simpleTagId app/src/main/java/com/celzero/bravedns/database/RethinkLocalFileTag.kt:34 — `RethinkLocalFileTag.simpleTagId` is a raw `Int` — give it a strongly-typed id: a dedicated single-field type wrapping the `Int`, in whatever form your language spells that.
  • Primitive id on a domain type: RethinkLog.usrId app/src/main/java/com/celzero/bravedns/database/RethinkLog.kt:38 — `RethinkLog.usrId` is a raw `Int` — give it a strongly-typed id: a dedicated single-field type wrapping the `Int`, in whatever form your language spells that.
  • Primitive id on a domain type: RethinkLog.connId app/src/main/java/com/celzero/bravedns/database/RethinkLog.kt:49 — `RethinkLog.connId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
  • Primitive id on a domain type: RethinkRemoteFileTag.simpleTagId app/src/main/java/com/celzero/bravedns/database/RethinkRemoteFileTag.kt:33 — `RethinkRemoteFileTag.simpleTagId` is a raw `Int` — give it a strongly-typed id: a dedicated single-field type wrapping the `Int`, in whatever form your language spells that.
  • Primitive id on a domain type: RpnProxy.tunId app/src/main/java/com/celzero/bravedns/database/RpnProxy.kt:17 — `RpnProxy.tunId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
  • Primitive id on a domain type: SubscriptionStateHistory.subscriptionId app/src/main/java/com/celzero/bravedns/database/SubscriptionStateHistory.kt:28 — `SubscriptionStateHistory.subscriptionId` is a raw `Int` — give it a strongly-typed id: a dedicated single-field type wrapping the `Int`, in whatever form your language spells that.
  • Primitive id on a domain type: SubscriptionStatus.accountId app/src/main/java/com/celzero/bravedns/database/SubscriptionStatus.kt:28 — `SubscriptionStatus.accountId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
  • Primitive id on a domain type: SubscriptionStatus.deviceId app/src/main/java/com/celzero/bravedns/database/SubscriptionStatus.kt:42 — `SubscriptionStatus.deviceId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
  • Primitive id on a domain type: SubscriptionStatus.orderId app/src/main/java/com/celzero/bravedns/database/SubscriptionStatus.kt:45 — `SubscriptionStatus.orderId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
  • Primitive id on a domain type: SubscriptionStatus.productId app/src/main/java/com/celzero/bravedns/database/SubscriptionStatus.kt:46 — `SubscriptionStatus.productId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
  • Primitive id on a domain type: SubscriptionStatus.planId app/src/main/java/com/celzero/bravedns/database/SubscriptionStatus.kt:47 — `SubscriptionStatus.planId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
  • Primitive id on a domain type: SubscriptionStatus.previousProductId app/src/main/java/com/celzero/bravedns/database/SubscriptionStatus.kt:65 — `SubscriptionStatus.previousProductId` is a raw `String` — give it a strongly-typed id: a dedicated single-field type wrapping the `String`, in whatever form your language spells that.
X7 · Silent fallback defaults · Silent fallback default in catch · ×19
  • Silent fallback default in catch app/src/main/java/com/celzero/bravedns/adapter/ConnectionLogAdapter.kt:255 — `displayAppDetails` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/celzero/bravedns/adapter/DnsCryptEndpointAdapter.kt:298 — `cryptDesc` swallows every exception into `""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/celzero/bravedns/adapter/DnsCryptRelayEndpointAdapter.kt:210 — `relayDesc` swallows every exception into `""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/celzero/bravedns/adapter/DoTEndpointAdapter.kt:294 — `getDnsDesc` swallows every exception into `""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/celzero/bravedns/adapter/DohEndpointAdapter.kt:293 — `getDnsDesc` swallows every exception into `""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/celzero/bravedns/adapter/ODoHEndpointAdapter.kt:298 — `getDnsDesc` swallows every exception into `""` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/celzero/bravedns/data/SsidItem.kt:95 — `parseStorageList` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/celzero/bravedns/ui/bottomsheet/AutoExcludeCountriesBottomSheet.kt:257 — `loadCountries` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/celzero/bravedns/ui/bottomsheet/LogActivityIntervalBottomSheet.kt:277 — `onAppExpandRequested` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/celzero/bravedns/ui/bottomsheet/RpnLogActivityIntervalBottomSheet.kt:232 — `onAppExpandRequested` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/main/java/com/celzero/bravedns/util/KernelProc.kt:148 — `parseSchedAllThreads` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/play/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt:326 — `isoToMillis` swallows every exception into `0L` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/tv/java/com/celzero/bravedns/tv/ui/apps/RpnBypassAppsScreen.kt:113 — `RpnBypassAppsScreen` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgIncludeAppsScreen.kt:133 — `WgIncludeAppsScreen` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAddLocationScreen.kt:83 — `RpnAddLocationScreen` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnAppsScreen.kt:84 — `RpnAppsScreen` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnHeatmap.kt:175 — `RpnIntervalScreen` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/tv/java/com/celzero/bravedns/tv/ui/rpn/RpnHeatmap.kt:217 — `IntervalAppRow` swallows every exception into `emptyList()` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
  • Silent fallback default in catch app/src/website/java/com/celzero/bravedns/iab/ServerOrderHistoryRepository.kt:326 — `isoToMillis` swallows every exception into `0L` — a data error becomes a silent behavior change with no trail. Log the failure or let it propagate. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment in the catch or in the KDoc, and the row stops firing.
D16 · Bus Factor · Off-boarding risk · ×2
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 328 significant file(s) lose their only recent owner: app/src/main/java/com/celzero/bravedns/service/BraveVPNService.kt, REDACTED, app/src/website/java/com/celzero/bravedns/iab/InAppBillingHandler.kt, app/src/main/java/com/celzero/bravedns/rpnproxy/RpnProxyManager.kt, app/src/main/java/com/celzero/bravedns/rpnproxy/SubscriptionStateMachineV2.kt, app/src/main/java/com/celzero/bravedns/ui/fragment/ServerSelectionFragment.kt, app/src/main/java/com/celzero/bravedns/net/go/GoVpnAdapter.kt, app/src/main/java/com/celzero/bravedns/ui/fragment/HomeScreenFragment.kt (+320 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 22 significant file(s) lose their only recent owner: app/src/tv/java/com/celzero/bravedns/tv/ui/logs/LogsScreen.kt, app/src/tv/java/com/celzero/bravedns/tv/ui/dns/DnsScreen.kt, app/src/tv/java/com/celzero/bravedns/tv/ui/settings/SettingsScreen.kt, app/src/tv/java/com/celzero/bravedns/tv/ui/stats/StatsScreen.kt, app/src/tv/java/com/celzero/bravedns/tv/ui/apps/AppsScreen.kt, app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/WgImportScreen.kt, app/src/tv/java/com/celzero/bravedns/tv/ui/apps/AppDetailScreen.kt, app/src/tv/java/com/celzero/bravedns/tv/ui/proxy/ProxyEditorScreen.kt (+14 more). Pair on, review, or document these before any departure.
C4 · Data Retention · Partial data-retention evidence · ×1
  • Partial data-retention evidence — A retention mechanism is present, but the data-lifecycle is not yet complete — missing: a documented retention period / data-expiry.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 1 of 1 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `app` (179827 LoC, 2607 module-visible types across 84 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
M2 · Architecture documentation · No architecture diagram/doc · ×1
  • No architecture diagram/doc — No C4/Structurizr/PlantUML/Mermaid/Graphviz/D2 diagram, no drawn diagram named for the architecture, no file named `architecture` or `design` in any markup this check reads, and nothing in the README, docs or contributor guides that announces the shape — no `## Architecture` heading, no "architecture overview"/"high-level design" phrasing, no "the architecture is …" introduction, no guided code tour. A shape laid out in prose that never names itself as the architecture is not visible to this check, and neither is one kept outside the repository, so this row reports the absence of a re-findable shape document — not evidence that nobody wrote the shape down.
P6 · Release Hygiene · No changelog · ×1
  • No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)

Appendix B — Reproduction & audit trail

Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-c1adc87f5c224a5a835ed0bc63d08e8a/history.json --exit-code 0 --source .17artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-c1adc87f5c224a5a835ed0bc63d08e8a/tree.json --exit-code 0 --source .8artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off .33artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesnone (dependency manifest found, not scanned for vulnerabilities here)—none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) — not scanned yet).0—
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 24 file(s) — `app/src/main/java/com/celzero/bravedns/adapter/FirewallAppListAdapter.kt`, `app/src/main/java/com/celzero/bravedns/adapter/SummaryStatisticsAdapter.kt`, `app/src/main/java/com/celzero/bravedns/adapter/WgIncludeAppsAdapter.kt`, `app/src/main/java/com/celzero/bravedns/service/LogActivityAggregator.kt`, `app/src/main/java/com/celzero/bravedns/ui/activity/ConsoleLogActivity.kt`, … (+19 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciesnone (dependency manifest found, not scanned for vulnerabilities here)—none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Gradle build (build.gradle/build.gradle.kts) — not scanned yet).0—

Run 01a16f99-5e4e-7e10-9922-4a847edf620f · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md