Public report — SmsForwarder, published 5 Aug 2026.
Concrete security findings (CVE IDs, secret matches, dependency versions) are hidden in this version;
ask the repo owner for the full report.
286findings with an exact file:lineof 297 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
23/93dimensions across the health lenses41335 LoC — wide & deep
Executive summary
Read through the Production lens — the standard calibration. *Green* means good enough to run in production. The score is absolute and comparable across repos.
pppscn/SmsForwarder carries serious gaps (39%). Several issues below can materially affect correctness, security, or the cost of changing it — and propagate to everything that depends on it.
It is strongest in Architecture (95%) — the structure is clean and changes stay contained.
The area that most needs attention is Security (30%) — exposure to security and compliance incidents is elevated. Readiness (31%) is the next concern — releases are harder to depend on — versioning, release notes and dependency hygiene are thin, so consumers can't easily tell what changed or trust an upgrade.
Leadership focus, highest impact first: SAST step to CI running what this repository's stack ships (Security & performance tooling); 1 No automated tests finding(s) in Code Coverage (Code Coverage); 1 No tests found finding(s) in Test Distribution (Test Distribution).
For scale: Medium (~41,335 production lines); rebuilding it from scratch would take roughly ~0.2 person-years (~1 engineer). Approximate, ±~30%.
It builds on a genuinely strong Architecture foundation (95%); the priorities above are the highest-leverage way to bring the rest up to that level.
How the score is built — each lens's share of the headlineWidth is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
0.7× (at 39% quality) — the last 20% of quality is most of the work
Size & shape
Medium · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)
This codebase represents roughly ~0.2 person-years of build effort (about ~€35,000 to rebuild). Its weakest lens is Security at 30% — the part of that asset most exposed by the findings below.
How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.0) — standard service × a 0.7× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).
Top priorities
The highest-leverage moves; the full ranked list is in the Roadmap below.
1
Resolve the 1 No automated tests finding(s) in Code Coverage.
Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Value concentrated against a weak lens · High · Value at risk
This is a Medium asset (~0.2 person-years to rebuild), and its weakest lens is Security at 30%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
→ Direct remediation budget at Security first — highest risk-reduction per euro on an asset this size.
The top fix pays for itself · High · Economics
The top-ranked fix costs roughly 1–3 engineer-days once. Not doing it costs about 0.4–2.7 engineer-days every year, paid as drag on the ~3,650 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 5–81 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 5–11% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 900 line(s) changed over a 90-day window ⇒ ~3,650/year · D1/D2/D4 code quality: averaging 6.1/10 ⇒ a 5–11% drag on each change · top-ranked remediation: Low effort ⇒ about 1–3 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 81 months.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 6.1/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 5–11% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4 code quality: averaging 6.1/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.
Architecture — module dependency matrix
131 modules, 160 dependencies — 2 dependency cycles, shown as the red cell(s) above the diagonal. Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)
At a glance — Code Health · 69% · Adequate · gated by D2
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 category
Findings
Severity
A03:2021 — Injection
22
High / Critical
Roadmap
Begin by integrating a security scanning step into the CI pipeline to automatically fail builds containing vulnerabilities. Next, address the 14 high-priority static analysis findings, focusing first on the Weekly_Build and Release workflows. Simultaneously, resolve the single code coverage issue and the missing tests identified in the test distribution analysis. Finally, implement a draft release or approval gate to prevent the deployment of unverified builds.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 No automated tests finding(s) in Code Coverage.
Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree with `NNNN-title.md` names is the most discoverable form).
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. 21 of 23 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 2 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.5 — 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 — 23 dimensions across the health lenses
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
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, 286 of 297 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.)
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.
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.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
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.
D30 Dependency Vulnerabilities — scanner not present in this environment — The backing tool was not installed where this scan ran, so this dimension was not scored. Install the tool (or run in the hosted environment, where it is always present) for a graded result.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
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 (jscpd) — 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.
D8 Code Coverage: Coverage is measured by building and running the test suite inside Watchdog's isolated image — the target repo is never modified, and nothing on your systems runs. So coverage exists only when the suite builds and runs within the inline time budget; one that needs external services, can't build, or exceeds the budget yields no coverage (D8 then degrades to not-measured, not a low score). Line coverage also says nothing about assertion quality.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D13 Secret Scanning: Secret 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.
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.
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.
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.
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".
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 (documentation, ADR quality, naming, comment value, onboarding) — D25 sets the ADR-conformance fraction over sampled code, D22 judges API accuracy over a sample. These 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.
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.
42 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was ConditionUtils.checkCondition at 75. A further 4 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 TaskUtils.getTypeImageId at 24 — they are counted neither in the figure above nor in this dimension's score.
+ 37 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 ConditionUtils.checkCondition (cyclomatic 75) finding(s) in Cyclomatic Complexity — start with ConditionUtils.kt. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 ActionWorker.doWork (cyclomatic 65) finding(s) in Cyclomatic Complexity — start with ActionWorker.kt. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 EmailUtils.sendMsg (cyclomatic 43) finding(s) in Cyclomatic Complexity — start with EmailUtils.kt. — One of this dimension's main actionable groups (1 warning-level).
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.
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.
+ 61 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 2 SettingsFragment.initAppSpinner (cognitive 17) finding(s) in Cognitive Complexity — start with SettingsFragment.kt (2). — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 ActionWorker.doWork (cognitive 142) finding(s) in Cognitive Complexity — start with ActionWorker.kt. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 ConditionUtils.checkCondition (cognitive 127) finding(s) in Cognitive Complexity — start with ConditionUtils.kt. — One of this dimension's main actionable groups (1 warning-level).
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.
Do you agree with this assessment?
D3 · God Classes9.5 / 10Exemplary✓ 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.
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.
+ 41 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 12 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with RulesEditFragment.kt (2), SettingsFragment.kt (2), BroccoliRecyclerAdapter.kt. — One of this dimension's main actionable groups (12 warning-level).
Resolve the 12 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with RulesEditFragment.kt (2), CallQueryFragment.kt (2), ServerFragment.kt. — One of this dimension's main actionable groups (12 warning-level).
Resolve the 12 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with SettingsFragment.kt (3), CloneFragment.kt (2), HistoryUtils.kt (2). — One of this dimension's main actionable groups (12 warning-level).
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.
Do you agree with this assessment?
D8 · Code Coverage0.0 / 10Critical✓ Tool-verified
What it measures: How much of the code is actually exercised by tests.
Method: Coverage from coverlet runs or committed reports (Cobertura/OpenCover/lcov), computed per-file with structured exclusions for generated, trivial, and glue code. When the suite can't be built/run in-image AND no report is committed, coverage is reported NOT-MEASURED (excluded from the score) with the precondition to make it measurable — never a LoC-ratio proxy folded in as if measured. Deterministic.
No automated tests — no test code was found in this repository.
No automated tests
What to do
Resolve the 1 No automated tests finding(s) in Code Coverage. — One of this dimension's main actionable groups (1 issue-level).
Enforce Code Coverage in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d8_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution0.0 / 10Critical✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
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.
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.
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor8.9 / 10Strong✓ 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.
19 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt.
Off-boarding risk: anonymized user #1
What to do
Resolve the 1 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
This is a clear README for an Android SMS-forwarding app with strong branding and features: it shows the GitHub release badge, stars/forks/issue links, a feature list (monitor SMS/calls/notifications to external services like DingTalk, WeChat, PushPlus), V3.0/V3.3 version notes, a legal disclaimer, a privacy statement that SmsForwarder does not collect any personal data, and an anti-fraud warning with a direct link to a donation page. It also includes a working-principle screenshot and a screen-shots section (clipped mid-paragraph). The outline is visible in the clipped text; no sections are omitted.
What to do
Improve Documentation Quality — currently 8.0/10. — This is a clear README for an Android SMS-forwarding app with strong branding and features: it shows the GitHub release badge, stars/forks/issue links, a feature list (monitor SMS/calls/notifications to external services like DingTalk, WeChat, PushPlus), V3.0/V3.3 version notes, a legal disclaimer, a privacy statement that SmsForwarder does not collect any personal data, and an anti-fraud warning with a direct link to a donation page. It also includes a working-principle screenshot and a screen-shots section (clipped mid-paragraph). The outline is visible in the clipped text; no sections are omitted.
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.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Git-history secret scan via gitleaks detect over full history in an isolated checkout; each match flagged High. Exhaustive; degrades cleanly when tool absent.
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.
What to do
Improve Secrets (history) — currently 6.0/10. — 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.
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).
High: github-actions-mutable-action-tag · ×14.github/workflows/Release.yml:23detected by semgrep finding
Medium: exported_activity · ×8app/src/main/AndroidManifest.xml:123detected by semgrep finding
What to do
Resolve the 14 High finding(s) in Static Analysis (SAST) — start with Weekly_Build.yml (9), Release.yml (5). — One of this dimension's main actionable groups (14 issue-level).
Resolve the 8 Medium finding(s) in Static Analysis (SAST) — start with AndroidManifest.xml (8). — One of this dimension's main actionable groups (8 warning-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
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; coupling through a build step, config, or non-source file isn't seen.
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.
Resolve the 1 Unpinned build actions finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Workflow token permissions not restricted finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Secret passed as a command-line argument finding(s) in Supply-chain Provenance & Signing. — 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.
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.
22 code files changed in the last 6 months but the README was not touched — it may no longer reflect the system.
What to do
Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
Add a 'Testing' section to the root README — 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 1 of 1 project(s) that lack one — worth up to 2 pts.
Review the README against recent changes; refresh the parts that drifted.
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 `NNNN-title.md` documents 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/PlantUML/Mermaid diagram or architecture.md — the high-level shape isn't documented.
What to do
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree with `NNNN-title.md` names is the most discoverable form).
Add a C4 context/container diagram (Structurizr, PlantUML or Mermaid) or an architecture.md overview.
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.
No test surface was found — there are no tests here to separate from production code, so the folder question hasn't been reached yet.
What to do
Start a test surface where your build system looks for one (tests/, test/, spec/, or your ecosystem's test source set) — the separation follows from putting the first tests in the right place.
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.
Do you agree with this assessment?
P1 · CI/CD gates8.5 / 10Strong✓ 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.
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). Check the coverage dimensions first: if this repo has no test suite yet, that is the finding and this row follows from it. If a suite does exist, make the runner step explicit so the gate is unambiguous.
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.
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.
No static application security testing detected. For this repository's stack, add spotbugs with find-sec-bugs (or `semgrep --config=auto`, which runs on any language) as a CI step.
What to do
Add a SAST step to CI running what this repository's stack ships: spotbugs with find-sec-bugs — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
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.
What to do
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
Do you agree with this assessment?
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.
Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Not included — 70 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 — no DI registrations detected
AX10 Code composition — not assessed — code composition is computed by ROLE over a document set 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 singleton implementations detected
AX3 Project dependency cycles — not assessed — project cycles and dependency direction are computed over a project-reference graph 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
AX4 Dependency direction — not assessed — project cycles and dependency direction are computed over a project-reference graph 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
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
AX6 Interface segregation — not assessed — interface segregation is computed over a type surface 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
AX8 Test isolation — not assessed — test isolation is computed from a project graph (which projects are test projects, and what they reference) 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
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
C1 Data Protection — Not assessed: these personal data 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 personal data 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.
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.
C3 Audit Trail — Not assessed: these audit 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 audit 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.
C4 Data Retention — Not assessed: these retention 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 retention 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.
C5 Data-Subject Rights — Not assessed: these data-subject rights 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 data-subject rights 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 — No tests were found in the analyzed repository to assess for quality.
D11 Test Reliability — Test reliability not included
D12 Dependency Hygiene — Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
D14 License Compliance — Not scored — this repository's package manifest is not parsed for licence data yet. A gap in the analyzer's language coverage, NOT a finding that the repository's licenses are compliant (a Gradle version catalogue), which this pass does not parse yet — so this dimension asserts nothing about this repository's licensing in either direction.
D17 Explicit Debt — explicit-debt markers are read through a C# workspace today, so they were not read for this repository's language — this asserts nothing about how many markers the code carries. Not scored — this is a gap in the analyzer, not a finding about this repository
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.
D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
D22 Internal API Consistency — No exposed public API
D23 Boundary Type-Coupling — Production source is present (.kt) but bounded contexts are resolved over the C#/VB project set, which exposed none, so context scope could not be assessed. Not scored — this is a gap in the analyzer, not a verdict about this repository. Declaring the codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed — see the recommendation on this dimension for where. 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
D26 Project Cohesion — Project cohesion is assessed over the .NET project set; this target exposed no projects, so project size and spread could not be assessed. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
D27 Navigability — No calls could be sampled, so navigability was not assessed — tracing effort is measured over resolved call sites and this target exposed none. Not scored — this is a gap in the analyzer's reach, 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 version catalogue — not scanned yet) — where an OSV-supported manifest exists, dependency vulnerabilities for this repository are reported under D38 instead.
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Terraform, Kubernetes/Helm, CloudFormation); nothing to scan.
D32 Data Compliance (PII/GDPR) — No PII/GDPR-handling patterns detected (p/gdpr ruleset) — no data-compliance surface to assess.
D33 JS/npm Dependency Vulnerabilities — No JS/npm manifest or lockfile found outside build output (package.json, package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb); no JS dependencies to scan.
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.
D38 OSV Dependency Vulnerabilities — No supported non-.NET dependency lockfile found outside build output (npm package-lock/yarn/pnpm/bun, Go go.mod, Rust Cargo.lock, Maven pom.xml, Gradle lockfiles, Python requirements.txt/poetry.lock/Pipfile.lock/pdm.lock, PHP composer.lock, Ruby Gemfile.lock, Elixir mix.lock, Dart pubspec.lock, Swift Package.resolved); nothing for OSV to scan. A NuGet-only repo stays NotApplicable — .NET CVEs are D30's domain.
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.
D5 Coupling — Inter-project coupling could not be assessed — no analyzable project graph was found for this repository. Not scored: a gap in the analyzer's reach, not a verdict about this repository. (Coupling here is Martin afferent/efferent/instability plus reference cycles across a project-reference graph, read today from .NET project files; other ecosystems' module graphs are not read yet.)
D6 Cohesion (LCOM4) — Cohesion (LCOM4) is measured over a C#/VB class graph, and this repository's production source is .kt, which this pass does not read — so no class could be assessed. Not scored — this is a gap in the analyzer, not a finding about this repository.
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
DM1 Domain Modelling — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 79 value object(s); a JPA/Axon/DDD domain-annotation stack (@Entity/@Aggregate/@Embeddable)
ED1 Event-Driven — not scored — this repository shows none of the 3 signals this check 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 check looks for
GD1 Unfinished & placeholder code — no source files
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, 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 — Observability was not assessed: this check reads a source model that does not carry this repository's product — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of a logging idiom this check recognises is NOT evidence that this repo lacks structured logging (it may log through its own ecosystem's logger). This is a gap in the analyzer, not a finding about this repository.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
P6 Release Hygiene — not evidenced — no changelog, version stamp or semver release tag in the repo
P7 Outbound HTTP resilience — not measured — the application kind could not be determined for this repo
P8 Schema migrations — not assessed — schema-migration practice is read from 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
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) into the repo working tree before the scan — a CI step is the usual place, since the artefact is commonly gitignored, or wire coverage collection into CI, to enable this cross-layer check
PF1 Benchmark discipline — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
PF2 Allocation hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
PF3 Async & latency hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
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.
X1 Async correctness — 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
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
X3 Exception handling — 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
X4 Structured logging — 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
X5 Nullable reference types — 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
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.
High: github-actions-mutable-action-tag .github/workflows/Release.yml:23— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v4`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v4 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/Release.yml:26— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-java@<40-character SHA>`. This step references `actions/setup-java@v4`; resolve the SHA it points at today with `gh api repos/actions/setup-java/commits/v4 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/Release.yml:33— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v4`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v4 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/Release.yml:44— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/create-release@<40-character SHA>`. This step references `actions/create-release@v1`; resolve the SHA it points at today with `gh api repos/actions/create-release/commits/v1 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/Release.yml:54— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: alexellis/upload-assets@<40-character SHA>`. This step references `alexellis/upload-assets@0.2.2`; resolve the SHA it points at today with `gh api repos/alexellis/upload-assets/commits/0.2.2 --jq .sha`. Note that `0.2.2` is an exact release tag rather than a floating major: it is still mutable (a tag can be repointed), but by convention it moves only on a force-push, so pin the floating-major and branch references in this file first.
High: github-actions-mutable-action-tag .github/workflows/Weekly_Build.yml:21— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v4`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v4 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/Weekly_Build.yml:24— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: Mattraks/delete-workflow-runs@<40-character SHA>`. This step references `Mattraks/delete-workflow-runs@v2`; resolve the SHA it points at today with `gh api repos/Mattraks/delete-workflow-runs/commits/v2 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/Weekly_Build.yml:33— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-java@<40-character SHA>`. This step references `actions/setup-java@v4`; resolve the SHA it points at today with `gh api repos/actions/setup-java/commits/v4 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/Weekly_Build.yml:40— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v4`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v4 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/Weekly_Build.yml:101— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/upload-artifact@<40-character SHA>`. This step references `actions/upload-artifact@v4`; resolve the SHA it points at today with `gh api repos/actions/upload-artifact/commits/v4 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/Weekly_Build.yml:107— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/upload-artifact@<40-character SHA>`. This step references `actions/upload-artifact@v4`; resolve the SHA it points at today with `gh api repos/actions/upload-artifact/commits/v4 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/Weekly_Build.yml:113— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/upload-artifact@<40-character SHA>`. This step references `actions/upload-artifact@v4`; resolve the SHA it points at today with `gh api repos/actions/upload-artifact/commits/v4 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/Weekly_Build.yml:119— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/upload-artifact@<40-character SHA>`. This step references `actions/upload-artifact@v4`; resolve the SHA it points at today with `gh api repos/actions/upload-artifact/commits/v4 --jq .sha`.
High: github-actions-mutable-action-tag .github/workflows/Weekly_Build.yml:125— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/upload-artifact@<40-character SHA>`. This step references `actions/upload-artifact@v4`; resolve the SHA it points at today with `gh api repos/actions/upload-artifact/commits/v4 --jq .sha`.
Duplicated block (12 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/adapter/base/broccoli/BroccoliRecyclerAdapter.kt:24— app/src/main/kotlin/cn/ppps/forwarder/adapter/base/broccoli/BroccoliRecyclerAdapter.kt:24-35 | app/src/main/kotlin/cn/ppps/forwarder/adapter/base/broccoli/BroccoliSimpleDelegateAdapter.kt:41-52 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/adapter/base/broccoli/BroccoliRecyclerAdapter.kt:24` 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/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:303— app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:303-314 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/NotificationFragment.kt:193-204 — 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/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:303` 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/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:798— app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:798-809 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/MsgFragment.kt:438-449 — 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/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:798` 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/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:407— app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:407-418 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SettingsFragment.kt:201-212 — 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/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:407` 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/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:729— app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:729-740 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SettingsFragment.kt:303-314 — 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/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:729` 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/kotlin/cn/ppps/forwarder/fragment/client/CallQueryFragment.kt:189— app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CallQueryFragment.kt:189-200 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/SmsQueryFragment.kt:177-188 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
Duplicated block (12 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/LeaveAddressFragment.kt:177— app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/LeaveAddressFragment.kt:177-188 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/ToAddressFragment.kt:170-181 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/LeaveAddressFragment.kt:177` 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/kotlin/cn/ppps/forwarder/server/controller/SmsController.kt:30— app/src/main/kotlin/cn/ppps/forwarder/server/controller/SmsController.kt:30-41 | app/src/main/kotlin/cn/ppps/forwarder/utils/SmsCommandUtils.kt:134-145 — 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 (12 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/utils/HistoryUtils.kt:103— app/src/main/kotlin/cn/ppps/forwarder/utils/HistoryUtils.kt:103-114 | app/src/main/kotlin/cn/ppps/forwarder/utils/SharedPreference.kt:79-90 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/utils/HistoryUtils.kt:103` 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/main/kotlin/cn/ppps/forwarder/utils/sender/TelegramUtils.kt:115— app/src/main/kotlin/cn/ppps/forwarder/utils/sender/TelegramUtils.kt:115-129 | app/src/main/kotlin/cn/ppps/forwarder/utils/sender/WeworkAgentUtils.kt:74-85 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/utils/sender/TelegramUtils.kt:115` 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 (12 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/utils/tinker/TinkerLoadLibrary.kt:132— app/src/main/kotlin/cn/ppps/forwarder/utils/tinker/TinkerLoadLibrary.kt:132-143 | app/src/main/kotlin/cn/ppps/forwarder/utils/tinker/TinkerLoadLibrary.kt:170-181 — 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 (12 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/utils/update/XHttpUpdateHttpServiceImpl.kt:31— app/src/main/kotlin/cn/ppps/forwarder/utils/update/XHttpUpdateHttpServiceImpl.kt:31-42 | app/src/main/kotlin/cn/ppps/forwarder/utils/update/XHttpUpdateHttpServiceImpl.kt:52-63 — 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/kotlin/cn/ppps/forwarder/utils/update/XHttpUpdateHttpServiceImpl.kt:31` 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 × 2) app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:166— app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:166-175 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/MsgFragment.kt:124-133 — 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/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:166` 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 × 2) app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:715— app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:715-724 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/MsgFragment.kt:377-386 — 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/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:715` 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 (10 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/fragment/ServerFragment.kt:461— app/src/main/kotlin/cn/ppps/forwarder/fragment/ServerFragment.kt:461-470 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/HttpServerFragment.kt:265-274 — 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/kotlin/cn/ppps/forwarder/fragment/ServerFragment.kt:461` 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/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:494— app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:494-503 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SettingsFragment.kt:234-243 — 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/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:494` 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/kotlin/cn/ppps/forwarder/fragment/action/AlarmFragment.kt:231— app/src/main/kotlin/cn/ppps/forwarder/fragment/action/AlarmFragment.kt:231-240 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/AlarmFragment.kt:287-296 — 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/kotlin/cn/ppps/forwarder/fragment/action/AlarmFragment.kt:231` 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/kotlin/cn/ppps/forwarder/fragment/action/CleanerFragment.kt:69— app/src/main/kotlin/cn/ppps/forwarder/fragment/action/CleanerFragment.kt:69-78 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/ResendFragment.kt:69-78 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/action/CleanerFragment.kt:69` 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 (10 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SendSmsFragment.kt:87— app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SendSmsFragment.kt:87-97 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/EmailFragment.kt:113-122 — 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/kotlin/cn/ppps/forwarder/fragment/action/SendSmsFragment.kt:87` 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 (10 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CallQueryFragment.kt:133— app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CallQueryFragment.kt:133-142 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/ContactQueryFragment.kt:123-133 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CallQueryFragment.kt:133` 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 (10 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CallQueryFragment.kt:287— app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CallQueryFragment.kt:287-296 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/SmsQueryFragment.kt:275-284 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CallQueryFragment.kt:287` 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 × 2) app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/FeishuAppFragment.kt:249— app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/FeishuAppFragment.kt:249-258 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/FeishuFragment.kt:244-253 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, 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 (10 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/utils/mail/PgpUtils.kt:152— app/src/main/kotlin/cn/ppps/forwarder/utils/mail/PgpUtils.kt:152-163 | app/src/main/kotlin/cn/ppps/forwarder/utils/mail/PgpUtils.kt:179-188 — 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 (10 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/utils/sender/BarkUtils.kt:42— app/src/main/kotlin/cn/ppps/forwarder/utils/sender/BarkUtils.kt:42-51 | app/src/main/kotlin/cn/ppps/forwarder/utils/sender/GotifyUtils.kt:32-41 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/utils/sender/BarkUtils.kt:42` 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/kotlin/cn/ppps/forwarder/activity/MainActivity.kt:290— app/src/main/kotlin/cn/ppps/forwarder/activity/MainActivity.kt:290-297 | app/src/main/kotlin/cn/ppps/forwarder/fragment/AppListFragment.kt:128-135 — 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/kotlin/cn/ppps/forwarder/activity/MainActivity.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.
Duplicated block (8 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:561— app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:561-568 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/MsgFragment.kt:237-244 — 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/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:561` 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/kotlin/cn/ppps/forwarder/fragment/ServerFragment.kt:520— app/src/main/kotlin/cn/ppps/forwarder/fragment/ServerFragment.kt:520-527 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/HttpServerFragment.kt:322-329 — 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/kotlin/cn/ppps/forwarder/fragment/ServerFragment.kt:520` 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/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:542— app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:542-549 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/BluetoothFragment.kt:220-227 — 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/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:542` 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/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:616— app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:616-623 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SettingsFragment.kt:260-267 — 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/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:616` 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/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:1430— app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:1430-1437 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SettingsFragment.kt:417-424 — 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/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:1430` 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/kotlin/cn/ppps/forwarder/fragment/client/CloneFragment.kt:272— app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CloneFragment.kt:272-279 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CloneFragment.kt:373-380 — 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/kotlin/cn/ppps/forwarder/fragment/client/CloneFragment.kt:272` 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/kotlin/cn/ppps/forwarder/fragment/client/CloneFragment.kt:378— app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CloneFragment.kt:378-385 | app/src/main/kotlin/cn/ppps/forwarder/workers/ActionWorker.kt:405-412 — 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 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 (8 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/DingtalkInnerRobotFragment.kt:140— app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/DingtalkInnerRobotFragment.kt:140-147 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/WebhookFragment.kt:145-152 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/DingtalkInnerRobotFragment.kt:140` 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/kotlin/cn/ppps/forwarder/utils/HistoryUtils.kt:56— app/src/main/kotlin/cn/ppps/forwarder/utils/HistoryUtils.kt:56-63 | app/src/main/kotlin/cn/ppps/forwarder/utils/SharedPreference.kt:111-118 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/utils/HistoryUtils.kt:56` 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 (8 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/utils/HistoryUtils.kt:66— app/src/main/kotlin/cn/ppps/forwarder/utils/HistoryUtils.kt:66-73 | app/src/main/kotlin/cn/ppps/forwarder/utils/SharedPreference.kt:121-128 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/utils/HistoryUtils.kt:66` 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/kotlin/cn/ppps/forwarder/utils/sender/DingtalkInnerRobotUtils.kt:43— app/src/main/kotlin/cn/ppps/forwarder/utils/sender/DingtalkInnerRobotUtils.kt:43-50 | app/src/main/kotlin/cn/ppps/forwarder/utils/sender/FeishuAppUtils.kt:37-44 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
Duplicated block (9 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/core/webview/AgentWebFragment.kt:438— app/src/main/kotlin/cn/ppps/forwarder/core/webview/AgentWebFragment.kt:438-446 | app/src/main/kotlin/cn/ppps/forwarder/core/webview/XPageWebViewFragment.kt:467-475 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/core/webview/AgentWebFragment.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 (9 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:264— app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:264-273 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/MsgFragment.kt:206-214 — 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/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:264` 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/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:326— app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:326-334 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/NotificationFragment.kt:216-224 — 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/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:326` 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/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:616— app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:616-624 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/MsgFragment.kt:330-338 — 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/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:616` 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/main/kotlin/cn/ppps/forwarder/fragment/client/CallQueryFragment.kt:209— app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CallQueryFragment.kt:209-217 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/SmsQueryFragment.kt:197-205 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
Duplicated block (9 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/utils/sender/BarkUtils.kt:120— app/src/main/kotlin/cn/ppps/forwarder/utils/sender/BarkUtils.kt:120-128 | app/src/main/kotlin/cn/ppps/forwarder/utils/sender/GotifyUtils.kt:57-66 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/utils/sender/BarkUtils.kt:120` 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/main/kotlin/cn/ppps/forwarder/utils/sender/DingtalkInnerRobotUtils.kt:99— app/src/main/kotlin/cn/ppps/forwarder/utils/sender/DingtalkInnerRobotUtils.kt:99-107 | app/src/main/kotlin/cn/ppps/forwarder/utils/sender/DingtalkInnerRobotUtils.kt:205-213 — 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/kotlin/cn/ppps/forwarder/utils/sender/DingtalkInnerRobotUtils.kt:99` 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/main/kotlin/cn/ppps/forwarder/utils/sender/FeishuAppUtils.kt:63— app/src/main/kotlin/cn/ppps/forwarder/utils/sender/FeishuAppUtils.kt:63-71 | app/src/main/kotlin/cn/ppps/forwarder/utils/sender/FeishuAppUtils.kt:144-154 — 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/kotlin/cn/ppps/forwarder/utils/sender/FeishuAppUtils.kt:63` 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/main/kotlin/cn/ppps/forwarder/utils/sender/ServerchanUtils.kt:58— app/src/main/kotlin/cn/ppps/forwarder/utils/sender/ServerchanUtils.kt:58-66 | app/src/main/kotlin/cn/ppps/forwarder/utils/sender/TelegramUtils.kt:127-136 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/utils/sender/ServerchanUtils.kt:58` 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/kotlin/cn/ppps/forwarder/utils/sender/SocketUtils.kt:48— app/src/main/kotlin/cn/ppps/forwarder/utils/sender/SocketUtils.kt:48-57 | app/src/main/kotlin/cn/ppps/forwarder/utils/sender/UrlSchemeUtils.kt:33-41 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/utils/sender/SocketUtils.kt:48` 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/main/kotlin/cn/ppps/forwarder/utils/sender/WeworkAgentUtils.kt:95— app/src/main/kotlin/cn/ppps/forwarder/utils/sender/WeworkAgentUtils.kt:95-103 | app/src/main/kotlin/cn/ppps/forwarder/utils/sender/WeworkAgentUtils.kt:192-200 — 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/kotlin/cn/ppps/forwarder/utils/sender/WeworkAgentUtils.kt:95` 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.
Change coupling: Constants.kt ↔ SettingUtils.kt app/src/main/kotlin/cn/ppps/forwarder/utils/Constants.kt— `app/src/main/kotlin/cn/ppps/forwarder/utils/Constants.kt` and `app/src/main/kotlin/cn/ppps/forwarder/utils/SettingUtils.kt` change together 67% of the time (26 of the 39 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well). 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.
Change coupling: Constants.kt ↔ TaskUtils.kt app/src/main/kotlin/cn/ppps/forwarder/utils/Constants.kt— `app/src/main/kotlin/cn/ppps/forwarder/utils/Constants.kt` and `app/src/main/kotlin/cn/ppps/forwarder/utils/task/TaskUtils.kt` change together 62% of the time (10 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) 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.
Change coupling: TaskDao.kt ↔ TasksEditFragment.kt app/src/main/kotlin/cn/ppps/forwarder/database/dao/TaskDao.kt— `app/src/main/kotlin/cn/ppps/forwarder/database/dao/TaskDao.kt` and `app/src/main/kotlin/cn/ppps/forwarder/fragment/TasksEditFragment.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) 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.
Change coupling: BarkUtils.kt ↔ GotifyUtils.kt app/src/main/kotlin/cn/ppps/forwarder/utils/sender/BarkUtils.kt— `app/src/main/kotlin/cn/ppps/forwarder/utils/sender/BarkUtils.kt` and `app/src/main/kotlin/cn/ppps/forwarder/utils/sender/GotifyUtils.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). 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.
Change coupling: TasksEditFragment.kt ↔ Constants.kt app/src/main/kotlin/cn/ppps/forwarder/fragment/TasksEditFragment.kt— `app/src/main/kotlin/cn/ppps/forwarder/fragment/TasksEditFragment.kt` and `app/src/main/kotlin/cn/ppps/forwarder/utils/Constants.kt` change together 52% of the time (15 of the 29 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) 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.
Change coupling: TasksEditFragment.kt ↔ TaskUtils.kt app/src/main/kotlin/cn/ppps/forwarder/fragment/TasksEditFragment.kt— `app/src/main/kotlin/cn/ppps/forwarder/fragment/TasksEditFragment.kt` and `app/src/main/kotlin/cn/ppps/forwarder/utils/task/TaskUtils.kt` change together 50% of the time (8 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) 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.
Change coupling: WeworkAgentUtils.kt ↔ WeworkRobotUtils.kt app/src/main/kotlin/cn/ppps/forwarder/utils/sender/WeworkAgentUtils.kt— `app/src/main/kotlin/cn/ppps/forwarder/utils/sender/WeworkAgentUtils.kt` and `app/src/main/kotlin/cn/ppps/forwarder/utils/sender/WeworkRobotUtils.kt` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well). 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.
Change coupling: SettingsFragment.kt ↔ PhoneStateReceiver.kt app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt— `app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt` and `app/src/main/kotlin/cn/ppps/forwarder/receiver/PhoneStateReceiver.kt` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) 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.
Change coupling: TelegramUtils.kt ↔ WeworkRobotUtils.kt app/src/main/kotlin/cn/ppps/forwarder/utils/sender/TelegramUtils.kt— `app/src/main/kotlin/cn/ppps/forwarder/utils/sender/TelegramUtils.kt` and `app/src/main/kotlin/cn/ppps/forwarder/utils/sender/WeworkRobotUtils.kt` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well). 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.
Change coupling: CloneInfo.kt ↔ Constants.kt app/src/main/kotlin/cn/ppps/forwarder/entity/CloneInfo.kt— `app/src/main/kotlin/cn/ppps/forwarder/entity/CloneInfo.kt` and `app/src/main/kotlin/cn/ppps/forwarder/utils/Constants.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) 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.
Medium: exported_activity app/src/main/AndroidManifest.xml:123— The application exports an activity. Any application on the device can launch the exported activity which may compromise the integrity of your application or its data. Ensure that any exported activities do not have privileged access to your application's control plane.
Medium: exported_activity app/src/main/AndroidManifest.xml:130— The application exports an activity. Any application on the device can launch the exported activity which may compromise the integrity of your application or its data. Ensure that any exported activities do not have privileged access to your application's control plane.
Medium: exported_activity app/src/main/AndroidManifest.xml:138— The application exports an activity. Any application on the device can launch the exported activity which may compromise the integrity of your application or its data. Ensure that any exported activities do not have privileged access to your application's control plane.
Medium: exported_activity app/src/main/AndroidManifest.xml:147— The application exports an activity. Any application on the device can launch the exported activity which may compromise the integrity of your application or its data. Ensure that any exported activities do not have privileged access to your application's control plane.
Medium: exported_activity app/src/main/AndroidManifest.xml:194— The application exports an activity. Any application on the device can launch the exported activity which may compromise the integrity of your application or its data. Ensure that any exported activities do not have privileged access to your application's control plane.
Medium: exported_activity app/src/main/AndroidManifest.xml:202— The application exports an activity. Any application on the device can launch the exported activity which may compromise the integrity of your application or its data. Ensure that any exported activities do not have privileged access to your application's control plane.
Medium: exported_activity app/src/main/AndroidManifest.xml:209— The application exports an activity. Any application on the device can launch the exported activity which may compromise the integrity of your application or its data. Ensure that any exported activities do not have privileged access to your application's control plane.
Medium: exported_activity app/src/main/AndroidManifest.xml:216— The application exports an activity. Any application on the device can launch the exported activity which may compromise the integrity of your application or its data. Ensure that any exported activities do not have privileged access to your application's control plane.
Duplicated block (13 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:187— app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:187-199 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/MsgFragment.kt:146-158 — 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/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:187` 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 (13 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:780— app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:780-792 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/MsgFragment.kt:420-432 — 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/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:780` 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 (13 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/fragment/ServerFragment.kt:503— app/src/main/kotlin/cn/ppps/forwarder/fragment/ServerFragment.kt:503-515 | app/src/main/kotlin/cn/ppps/forwarder/fragment/ServerFragment.kt:528-540 — 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/kotlin/cn/ppps/forwarder/fragment/ServerFragment.kt:503` 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 (13 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:266— app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:266-278 | app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:290-302 — 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/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:266` 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 (13 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/LeaveAddressFragment.kt:69— app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/LeaveAddressFragment.kt:69-81 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/ToAddressFragment.kt:69-81 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/LeaveAddressFragment.kt:69` 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 (13 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/workers/BatteryWorker.kt:65— app/src/main/kotlin/cn/ppps/forwarder/workers/BatteryWorker.kt:65-77 | app/src/main/kotlin/cn/ppps/forwarder/workers/BatteryWorker.kt:124-136 — 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 (13 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/workers/BatteryWorker.kt:142— app/src/main/kotlin/cn/ppps/forwarder/workers/BatteryWorker.kt:142-154 | app/src/main/kotlin/cn/ppps/forwarder/workers/LocationWorker.kt:170-182 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/workers/BatteryWorker.kt:142` 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 (13 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/workers/LocationWorker.kt:64— app/src/main/kotlin/cn/ppps/forwarder/workers/LocationWorker.kt:64-76 | app/src/main/kotlin/cn/ppps/forwarder/workers/LocationWorker.kt:127-139 — 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 (7 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/core/webview/AgentWebFragment.kt:138— app/src/main/kotlin/cn/ppps/forwarder/core/webview/AgentWebFragment.kt:138-144 | app/src/main/kotlin/cn/ppps/forwarder/core/webview/XPageWebViewFragment.kt:127-133 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
Duplicated block (7 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/database/entity/Rule.kt:252— app/src/main/kotlin/cn/ppps/forwarder/database/entity/Rule.kt:252-258 | app/src/main/kotlin/cn/ppps/forwarder/utils/RuleLine.kt:127-133 — 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/kotlin/cn/ppps/forwarder/database/entity/Rule.kt:252` 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/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:583— app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:583-589 | app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:674-680 — 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/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:583` 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/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:728— app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:728-734 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/NotificationFragment.kt:444-450 — 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/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:728` 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 (7 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CallQueryFragment.kt:120— app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CallQueryFragment.kt:120-126 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/SmsQueryFragment.kt:110-116 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CallQueryFragment.kt:120` 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/kotlin/cn/ppps/forwarder/utils/sender/BarkUtils.kt:52— app/src/main/kotlin/cn/ppps/forwarder/utils/sender/BarkUtils.kt:52-58 | app/src/main/kotlin/cn/ppps/forwarder/utils/sender/GotifyUtils.kt:42-48 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/utils/sender/BarkUtils.kt:52` 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/kotlin/cn/ppps/forwarder/utils/sender/DingtalkInnerRobotUtils.kt:158— app/src/main/kotlin/cn/ppps/forwarder/utils/sender/DingtalkInnerRobotUtils.kt:158-164 | app/src/main/kotlin/cn/ppps/forwarder/utils/sender/WeworkAgentUtils.kt:146-152 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/utils/sender/DingtalkInnerRobotUtils.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.
Duplicated block (5 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:1128— app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:1128-1132 | app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:1141-1145 — 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/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:1128` 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 (5 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/fragment/action/HttpServerFragment.kt:224— app/src/main/kotlin/cn/ppps/forwarder/fragment/action/HttpServerFragment.kt:224-228 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SettingsFragment.kt:488-492 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/action/HttpServerFragment.kt:224` 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/kotlin/cn/ppps/forwarder/fragment/condition/BluetoothFragment.kt:170— app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/BluetoothFragment.kt:170-174 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/NetworkFragment.kt:87-91 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/BluetoothFragment.kt:170` 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 (5 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/LeaveAddressFragment.kt:162— app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/LeaveAddressFragment.kt:162-169 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/ToAddressFragment.kt:162-166 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/LeaveAddressFragment.kt:162` 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 × 2) app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/TelegramFragment.kt:133— app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/TelegramFragment.kt:133-137 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/WeworkAgentFragment.kt:141-145 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, 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 (5 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/utils/sender/TelegramUtils.kt:94— app/src/main/kotlin/cn/ppps/forwarder/utils/sender/TelegramUtils.kt:94-98 | app/src/main/kotlin/cn/ppps/forwarder/utils/sender/WebhookUtils.kt:226-230 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/utils/sender/TelegramUtils.kt:94` 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 (14 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/core/BaseFragment.kt:224— app/src/main/kotlin/cn/ppps/forwarder/core/BaseFragment.kt:224-240 | app/src/main/kotlin/cn/ppps/forwarder/core/BaseSimpleListFragment.kt:134-147 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/core/BaseFragment.kt:224` 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 (14 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/core/webview/AgentWebFragment.kt:87— app/src/main/kotlin/cn/ppps/forwarder/core/webview/AgentWebFragment.kt:87-100 | app/src/main/kotlin/cn/ppps/forwarder/core/webview/XPageWebViewFragment.kt:88-101 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/core/webview/AgentWebFragment.kt:87` 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/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:352— app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:352-365 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SettingsFragment.kt:166-179 — 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/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:352` 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 (14 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/LeaveAddressFragment.kt:144— app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/LeaveAddressFragment.kt:144-157 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/ToAddressFragment.kt:144-157 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/LeaveAddressFragment.kt:144` 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/main/kotlin/cn/ppps/forwarder/utils/sender/DingtalkInnerRobotUtils.kt:77— app/src/main/kotlin/cn/ppps/forwarder/utils/sender/DingtalkInnerRobotUtils.kt:77-90 | app/src/main/kotlin/cn/ppps/forwarder/utils/sender/WeworkAgentUtils.kt:170-183 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/utils/sender/DingtalkInnerRobotUtils.kt:77` 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.
FileTooLong: condition/CronFragment.kt app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/CronFragment.kt:0— FileTooLong — 1116 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: CronFragment (42-1644). 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/SettingsFragment.kt app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:0— FileTooLong — 956 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: SettingsFragment (90-1441). 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/RulesEditFragment.kt app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:0— FileTooLong — 611 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: RulesEditFragment (95-852). 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/TasksEditFragment.kt app/src/main/kotlin/cn/ppps/forwarder/fragment/TasksEditFragment.kt:0— FileTooLong — 527 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: TasksEditFragment (54-730). 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.
Duplicated block (11 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/fragment/ClientFragment.kt:160— app/src/main/kotlin/cn/ppps/forwarder/fragment/ClientFragment.kt:160-170 | app/src/main/kotlin/cn/ppps/forwarder/fragment/ClientFragment.kt:255-265 — 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/kotlin/cn/ppps/forwarder/fragment/ClientFragment.kt:160` 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/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:315— app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:315-325 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/EmailFragment.kt:549-560 — 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 (11 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/fragment/client/SmsSendFragment.kt:52— app/src/main/kotlin/cn/ppps/forwarder/fragment/client/SmsSendFragment.kt:52-62 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/WolSendFragment.kt:59-69 — before extracting anything, compare `app/src/main/kotlin/cn/ppps/forwarder/fragment/client/SmsSendFragment.kt` and `app/src/main/kotlin/cn/ppps/forwarder/fragment/client/WolSendFragment.kt` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 104 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/kotlin/cn/ppps/forwarder/fragment/client/SmsSendFragment.kt:52` 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/kotlin/cn/ppps/forwarder/fragment/senders/FeishuAppFragment.kt:109— app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/FeishuAppFragment.kt:109-119 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/FeishuFragment.kt:110-120 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
Duplicated block (10 lines × 5) app/src/main/kotlin/cn/ppps/forwarder/adapter/FrpcRecyclerAdapter.kt:96— app/src/main/kotlin/cn/ppps/forwarder/adapter/FrpcRecyclerAdapter.kt:96-105 | app/src/main/kotlin/cn/ppps/forwarder/adapter/RuleRecyclerAdapter.kt:100-109 | app/src/main/kotlin/cn/ppps/forwarder/adapter/SenderRecyclerAdapter.kt:90-99 | app/src/main/kotlin/cn/ppps/forwarder/adapter/TaskRecyclerAdapter.kt:90-99 | app/src/main/kotlin/cn/ppps/forwarder/adapter/TaskSettingAdapter.kt:90-99 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
Duplicated block (10 lines × 5) app/src/main/kotlin/cn/ppps/forwarder/fragment/action/HttpServerFragment.kt:75— app/src/main/kotlin/cn/ppps/forwarder/fragment/action/HttpServerFragment.kt:75-84 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/NotificationFragment.kt:120-129 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SettingsFragment.kt:96-105 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/WolFragment.kt:77-86 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/CronFragment.kt:109-118 — 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/main/kotlin/cn/ppps/forwarder/fragment/action/HttpServerFragment.kt:75` 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 × 5) app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CloneFragment.kt:386— app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CloneFragment.kt:386-395 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/ContactAddFragment.kt:95-104 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/SmsSendFragment.kt:113-122 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/WolSendFragment.kt:149-158 | app/src/main/kotlin/cn/ppps/forwarder/workers/ActionWorker.kt:415-424 — 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/main/kotlin/cn/ppps/forwarder/fragment/client/CloneFragment.kt:386` 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 × 5) app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/BluetoothFragment.kt:253— app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/BluetoothFragment.kt:253-263 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/ChargeFragment.kt:94-103 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/LockScreenFragment.kt:115-125 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/NetworkFragment.kt:99-109 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/SimFragment.kt:79-89 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/BluetoothFragment.kt:253` 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 × 3) app/src/main/kotlin/cn/ppps/forwarder/adapter/FrpcPagingAdapter.kt:51— app/src/main/kotlin/cn/ppps/forwarder/adapter/FrpcPagingAdapter.kt:51-60 | app/src/main/kotlin/cn/ppps/forwarder/adapter/RulePagingAdapter.kt:52-61 | app/src/main/kotlin/cn/ppps/forwarder/adapter/SenderPagingAdapter.kt:30-39 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/adapter/FrpcPagingAdapter.kt:51` 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 × 3) app/src/main/kotlin/cn/ppps/forwarder/utils/sender/DingtalkGroupRobotUtils.kt:98— app/src/main/kotlin/cn/ppps/forwarder/utils/sender/DingtalkGroupRobotUtils.kt:98-107 | app/src/main/kotlin/cn/ppps/forwarder/utils/sender/PushplusUtils.kt:67-76 | app/src/main/kotlin/cn/ppps/forwarder/utils/sender/WeworkRobotUtils.kt:61-70 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
Duplicated block (10 lines × 3) app/src/main/kotlin/cn/ppps/forwarder/utils/sender/DingtalkInnerRobotUtils.kt:111— app/src/main/kotlin/cn/ppps/forwarder/utils/sender/DingtalkInnerRobotUtils.kt:111-120 | app/src/main/kotlin/cn/ppps/forwarder/utils/sender/FeishuAppUtils.kt:75-84 | app/src/main/kotlin/cn/ppps/forwarder/utils/sender/WeworkAgentUtils.kt:107-116 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/utils/sender/DingtalkInnerRobotUtils.kt:111` 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 × 3) app/src/main/kotlin/cn/ppps/forwarder/utils/sender/FeishuUtils.kt:94— app/src/main/kotlin/cn/ppps/forwarder/utils/sender/FeishuUtils.kt:94-103 | app/src/main/kotlin/cn/ppps/forwarder/utils/sender/PushplusUtils.kt:34-43 | app/src/main/kotlin/cn/ppps/forwarder/utils/sender/ServerchanUtils.kt:32-42 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/utils/sender/FeishuUtils.kt:94` 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 (7 lines × 3) app/src/main/kotlin/cn/ppps/forwarder/fragment/TasksEditFragment.kt:571— app/src/main/kotlin/cn/ppps/forwarder/fragment/TasksEditFragment.kt:571-577 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/LeaveAddressFragment.kt:173-180 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/ToAddressFragment.kt:167-173 — 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/kotlin/cn/ppps/forwarder/fragment/TasksEditFragment.kt:571` 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 (7 lines × 3) app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CallQueryFragment.kt:274— app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CallQueryFragment.kt:274-280 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/ContactQueryFragment.kt:251-257 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/SmsQueryFragment.kt:262-268 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CallQueryFragment.kt:274` 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 × 3) app/src/main/kotlin/cn/ppps/forwarder/fragment/client/ContactAddFragment.kt:49— app/src/main/kotlin/cn/ppps/forwarder/fragment/client/ContactAddFragment.kt:49-55 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/SmsSendFragment.kt:50-56 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/WolSendFragment.kt:56-63 — before extracting anything, compare `app/src/main/kotlin/cn/ppps/forwarder/fragment/client/ContactAddFragment.kt` and `app/src/main/kotlin/cn/ppps/forwarder/fragment/client/SmsSendFragment.kt` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 101 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/kotlin/cn/ppps/forwarder/fragment/client/ContactAddFragment.kt:49` 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 × 3) app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/TelegramFragment.kt:153— app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/TelegramFragment.kt:153-159 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/WebhookFragment.kt:167-173 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/WeworkAgentFragment.kt:162-168 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/TelegramFragment.kt:153` 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/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:828— app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:828-833 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/MsgFragment.kt:468-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/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:828` 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/main/kotlin/cn/ppps/forwarder/fragment/condition/LeaveAddressFragment.kt:223— app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/LeaveAddressFragment.kt:223-228 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/ToAddressFragment.kt:216-221 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/LeaveAddressFragment.kt:223` 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/kotlin/cn/ppps/forwarder/fragment/senders/DingtalkGroupRobotFragment.kt:143— app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/DingtalkGroupRobotFragment.kt:143-148 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/WeworkRobotFragment.kt:139-144 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/DingtalkGroupRobotFragment.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.
Duplicated block (6 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/DingtalkInnerRobotFragment.kt:150— app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/DingtalkInnerRobotFragment.kt:150-155 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/TelegramFragment.kt:144-149 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/DingtalkInnerRobotFragment.kt:150` 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/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:386— app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:386-402 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/NotificationFragment.kt:281-297 — 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/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:386` 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 (17 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:423— app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:423-439 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SenderFragment.kt:222-238 — 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/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:423` 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 (17 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/utils/RSACrypt.kt:36— app/src/main/kotlin/cn/ppps/forwarder/utils/RSACrypt.kt:36-52 | app/src/main/kotlin/cn/ppps/forwarder/utils/RSACrypt.kt:80-96 — 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/kotlin/cn/ppps/forwarder/utils/RSACrypt.kt:36` 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/kotlin/cn/ppps/forwarder/fragment/action/AlarmFragment.kt:271— app/src/main/kotlin/cn/ppps/forwarder/fragment/action/AlarmFragment.kt:271-286 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SendSmsFragment.kt:198-213 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/action/AlarmFragment.kt:271` 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 (16 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/utils/RSACrypt.kt:122— app/src/main/kotlin/cn/ppps/forwarder/utils/RSACrypt.kt:122-137 | app/src/main/kotlin/cn/ppps/forwarder/utils/RSACrypt.kt:166-181 — 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/kotlin/cn/ppps/forwarder/utils/RSACrypt.kt:122` 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/kotlin/cn/ppps/forwarder/workers/LocationWorker.kt:90— app/src/main/kotlin/cn/ppps/forwarder/workers/LocationWorker.kt:90-105 | app/src/main/kotlin/cn/ppps/forwarder/workers/LocationWorker.kt:153-168 — 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/kotlin/cn/ppps/forwarder/workers/LocationWorker.kt:90` 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 × 4) app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:494— app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:494-504 | app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:1407-1417 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SettingsFragment.kt:394-404 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/MsgFragment.kt:292-302 — 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/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:494` 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 × 4) app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/ChargeFragment.kt:92— app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/ChargeFragment.kt:92-102 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/LockScreenFragment.kt:112-124 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/NetworkFragment.kt:96-108 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/SimFragment.kt:76-88 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/ChargeFragment.kt:92` 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 (11 lines × 4) app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/DingtalkGroupRobotFragment.kt:89— app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/DingtalkGroupRobotFragment.kt:89-99 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/DingtalkInnerRobotFragment.kt:91-101 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/GotifyFragment.kt:87-97 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/PushplusFragment.kt:88-98 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/DingtalkGroupRobotFragment.kt:89` 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 × 3) app/src/main/kotlin/cn/ppps/forwarder/fragment/action/RuleFragment.kt:296— app/src/main/kotlin/cn/ppps/forwarder/fragment/action/RuleFragment.kt:296-304 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SenderFragment.kt:290-298 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/TaskActionFragment.kt:290-298 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
Duplicated block (9 lines × 3) app/src/main/kotlin/cn/ppps/forwarder/fragment/client/ContactAddFragment.kt:71— app/src/main/kotlin/cn/ppps/forwarder/fragment/client/ContactAddFragment.kt:71-79 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/SmsSendFragment.kt:83-91 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/WolSendFragment.kt:111-119 — before extracting anything, compare `app/src/main/kotlin/cn/ppps/forwarder/fragment/client/ContactAddFragment.kt` and `app/src/main/kotlin/cn/ppps/forwarder/fragment/client/SmsSendFragment.kt` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 101 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/kotlin/cn/ppps/forwarder/fragment/client/ContactAddFragment.kt:71` 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/kotlin/cn/ppps/forwarder/workers/BluetoothWorker.kt:104— app/src/main/kotlin/cn/ppps/forwarder/workers/BluetoothWorker.kt:104-112 | app/src/main/kotlin/cn/ppps/forwarder/workers/NetworkWorker.kt:146-154 | app/src/main/kotlin/cn/ppps/forwarder/workers/SimWorker.kt:87-95 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/workers/BluetoothWorker.kt:104` 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.
Hotspot: app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt— app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt changed 2 times in last 90 days, max complexity 22. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
Hotspot: app/src/main/kotlin/cn/ppps/forwarder/App.kt app/src/main/kotlin/cn/ppps/forwarder/App.kt— app/src/main/kotlin/cn/ppps/forwarder/App.kt changed 2 times in last 90 days, max complexity 18. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
SettingsFragment.initAppSpinner (cognitive 17) app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:1398— SettingsFragment.initAppSpinner has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, loops 4, boolean chains 1, 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.
SettingsFragment.initAppSpinner (cognitive 17) app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SettingsFragment.kt:385— SettingsFragment.initAppSpinner has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, loops 4, boolean chains 1, 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.
Duplicated block (12 lines × 16) app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/BarkFragment.kt:211— app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/BarkFragment.kt:211-222 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/DingtalkGroupRobotFragment.kt:185-196 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/DingtalkInnerRobotFragment.kt:201-212 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/EmailFragment.kt:276-287 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/FeishuAppFragment.kt:181-192 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/FeishuFragment.kt:189-200 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/GotifyFragment.kt:162-173 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/PushplusFragment.kt:182-193 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/ServerchanFragment.kt:157-168 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/SmsFragment.kt:193-204 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/SocketFragment.kt:178-189 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/TelegramFragment.kt:185-196 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/UrlSchemeFragment.kt:160-171 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/WebhookFragment.kt:199-210 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/WeworkAgentFragment.kt:218-229 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/WeworkRobotFragment.kt:180-191 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/BarkFragment.kt:211` 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 (12 lines × 16) app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/BarkFragment.kt:225— app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/BarkFragment.kt:225-236 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/DingtalkGroupRobotFragment.kt:199-210 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/DingtalkInnerRobotFragment.kt:215-226 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/EmailFragment.kt:290-301 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/FeishuAppFragment.kt:200-212 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/FeishuFragment.kt:203-214 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/GotifyFragment.kt:176-187 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/PushplusFragment.kt:196-207 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/ServerchanFragment.kt:171-182 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/SmsFragment.kt:207-218 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/SocketFragment.kt:192-203 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/TelegramFragment.kt:199-210 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/UrlSchemeFragment.kt:174-185 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/WebhookFragment.kt:213-224 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/WeworkAgentFragment.kt:232-243 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/WeworkRobotFragment.kt:194-205 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/BarkFragment.kt:225` 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 × 9) app/src/main/kotlin/cn/ppps/forwarder/fragment/action/AlarmFragment.kt:297— app/src/main/kotlin/cn/ppps/forwarder/fragment/action/AlarmFragment.kt:297-307 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/HttpServerFragment.kt:246-256 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/HttpServerFragment.kt:274-284 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/HttpServerFragment.kt:302-312 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/HttpServerFragment.kt:326-336 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SettingsFragment.kt:180-190 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SettingsFragment.kt:213-223 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SettingsFragment.kt:264-274 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CloneFragment.kt:97-107 — there are 9 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 9 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/kotlin/cn/ppps/forwarder/fragment/action/AlarmFragment.kt:297` 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 × 9) app/src/main/kotlin/cn/ppps/forwarder/workers/BatteryWorker.kt:48— app/src/main/kotlin/cn/ppps/forwarder/workers/BatteryWorker.kt:48-58 | app/src/main/kotlin/cn/ppps/forwarder/workers/BatteryWorker.kt:107-117 | app/src/main/kotlin/cn/ppps/forwarder/workers/BluetoothWorker.kt:37-47 | app/src/main/kotlin/cn/ppps/forwarder/workers/LocationWorker.kt:59-69 | app/src/main/kotlin/cn/ppps/forwarder/workers/LocationWorker.kt:122-132 | app/src/main/kotlin/cn/ppps/forwarder/workers/LockScreenWorker.kt:37-47 | app/src/main/kotlin/cn/ppps/forwarder/workers/NetworkWorker.kt:56-66 | app/src/main/kotlin/cn/ppps/forwarder/workers/SendWorker.kt:136-146 | app/src/main/kotlin/cn/ppps/forwarder/workers/SimWorker.kt:40-50 — there are 9 copies across 7 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 9 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10 lines × 16) app/src/main/kotlin/cn/ppps/forwarder/fragment/ServerFragment.kt:367— app/src/main/kotlin/cn/ppps/forwarder/fragment/ServerFragment.kt:367-376 | app/src/main/kotlin/cn/ppps/forwarder/fragment/ServerFragment.kt:441-450 | app/src/main/kotlin/cn/ppps/forwarder/fragment/ServerFragment.kt:470-479 | app/src/main/kotlin/cn/ppps/forwarder/fragment/ServerFragment.kt:499-508 | app/src/main/kotlin/cn/ppps/forwarder/fragment/ServerFragment.kt:524-533 | app/src/main/kotlin/cn/ppps/forwarder/fragment/ServerFragment.kt:551-560 | app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:314-323 | app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:366-376 | app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:419-428 | app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:546-555 | app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:741-750 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/AlarmFragment.kt:199-208 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/AlarmFragment.kt:241-250 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SendSmsFragment.kt:151-161 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/EmailFragment.kt:548-558 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/SmsFragment.kt:94-104 — there are 16 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 16 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/kotlin/cn/ppps/forwarder/fragment/ServerFragment.kt:367` 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 (10 lines × 16) app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/BarkFragment.kt:140— app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/BarkFragment.kt:140-149 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/DingtalkGroupRobotFragment.kt:111-120 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/DingtalkInnerRobotFragment.kt:113-122 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/EmailFragment.kt:183-192 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/FeishuAppFragment.kt:123-133 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/FeishuFragment.kt:122-131 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/GotifyFragment.kt:109-118 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/PushplusFragment.kt:110-119 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/ServerchanFragment.kt:105-114 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/SmsFragment.kt:135-144 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/SocketFragment.kt:107-116 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/TelegramFragment.kt:108-117 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/UrlSchemeFragment.kt:110-119 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/WebhookFragment.kt:113-122 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/WeworkAgentFragment.kt:110-119 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/WeworkRobotFragment.kt:108-117 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/BarkFragment.kt:140` 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 × 5) app/src/main/kotlin/cn/ppps/forwarder/adapter/FrpcRecyclerAdapter.kt:85— app/src/main/kotlin/cn/ppps/forwarder/adapter/FrpcRecyclerAdapter.kt:85-92 | app/src/main/kotlin/cn/ppps/forwarder/adapter/RuleRecyclerAdapter.kt:89-96 | app/src/main/kotlin/cn/ppps/forwarder/adapter/SenderRecyclerAdapter.kt:79-86 | app/src/main/kotlin/cn/ppps/forwarder/adapter/TaskRecyclerAdapter.kt:79-86 | app/src/main/kotlin/cn/ppps/forwarder/adapter/TaskSettingAdapter.kt:79-86 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/adapter/FrpcRecyclerAdapter.kt:85` 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 × 5) app/src/main/kotlin/cn/ppps/forwarder/adapter/spinner/AppListSpinnerAdapter.kt:63— app/src/main/kotlin/cn/ppps/forwarder/adapter/spinner/AppListSpinnerAdapter.kt:63-70 | app/src/main/kotlin/cn/ppps/forwarder/adapter/spinner/FrpcSpinnerAdapter.kt:65-72 | app/src/main/kotlin/cn/ppps/forwarder/adapter/spinner/RuleSpinnerAdapter.kt:65-72 | app/src/main/kotlin/cn/ppps/forwarder/adapter/spinner/SenderSpinnerAdapter.kt:65-72 | app/src/main/kotlin/cn/ppps/forwarder/adapter/spinner/TaskSpinnerAdapter.kt:65-72 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/adapter/spinner/AppListSpinnerAdapter.kt:63` 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.
ConditionUtils.checkCondition (cyclomatic 75) app/src/main/kotlin/cn/ppps/forwarder/utils/task/ConditionUtils.kt:49— ConditionUtils.checkCondition has cyclomatic complexity 75 (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.
ActionWorker.doWork (cyclomatic 65) app/src/main/kotlin/cn/ppps/forwarder/workers/ActionWorker.kt:82— ActionWorker.doWork has cyclomatic complexity 65 (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.
EmailUtils.sendMsg (cyclomatic 43) app/src/main/kotlin/cn/ppps/forwarder/utils/sender/EmailUtils.kt:33— EmailUtils.sendMsg has cyclomatic complexity 43 (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.
WebhookUtils.sendMsg (cyclomatic 43) app/src/main/kotlin/cn/ppps/forwarder/utils/sender/WebhookUtils.kt:40— WebhookUtils.sendMsg has cyclomatic complexity 43 (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.
EmailFragment.checkSetting (cyclomatic 33) app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/EmailFragment.kt:320— EmailFragment.checkSetting has cyclomatic complexity 33 (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.
SmsCommandUtils.execute (cyclomatic 32) app/src/main/kotlin/cn/ppps/forwarder/utils/SmsCommandUtils.kt:36— SmsCommandUtils.execute has cyclomatic complexity 32 (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.
RulesEditFragment.checkForm (cyclomatic 28) app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:610— RulesEditFragment.checkForm has cyclomatic complexity 28 (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.
LocationWorker.doWork (cyclomatic 28) app/src/main/kotlin/cn/ppps/forwarder/workers/LocationWorker.kt:30— LocationWorker.doWork 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.
AlarmFragment.onClick (cyclomatic 25) app/src/main/kotlin/cn/ppps/forwarder/fragment/action/AlarmFragment.kt:165— AlarmFragment.onClick 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.
SendUtils.sendMsgSender (cyclomatic 25) app/src/main/kotlin/cn/ppps/forwarder/utils/SendUtils.kt:92— SendUtils.sendMsgSender has cyclomatic complexity 25 (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.
PhoneUtils.getCallInfoList (cyclomatic 24) app/src/main/kotlin/cn/ppps/forwarder/utils/PhoneUtils.kt:251— PhoneUtils.getCallInfoList 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.
ClientFragment.queryConfig (cyclomatic 23) app/src/main/kotlin/cn/ppps/forwarder/fragment/ClientFragment.kt:322— ClientFragment.queryConfig has cyclomatic complexity 23 (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.
SmsReceiver.onReceive (cyclomatic 23) app/src/main/kotlin/cn/ppps/forwarder/receiver/SmsReceiver.kt:30— SmsReceiver.onReceive has cyclomatic complexity 23 (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.
NetworkWorker.doWork (cyclomatic 23) app/src/main/kotlin/cn/ppps/forwarder/workers/NetworkWorker.kt:37— NetworkWorker.doWork has cyclomatic complexity 23 (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.
SettingsFragment.switchEnableLocation (cyclomatic 22) app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:609— SettingsFragment.switchEnableLocation 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.
TasksEditFragment.onItemClick (cyclomatic 21) app/src/main/kotlin/cn/ppps/forwarder/fragment/TasksEditFragment.kt:542— TasksEditFragment.onItemClick 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.
MsgFragment.checkForm (cyclomatic 21) app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/MsgFragment.kt:327— MsgFragment.checkForm has cyclomatic complexity 21 (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.
NotificationService.onNotificationPosted (cyclomatic 21) app/src/main/kotlin/cn/ppps/forwarder/service/NotificationService.kt:49— NotificationService.onNotificationPosted 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.
BluetoothWorker.doWork (cyclomatic 21) app/src/main/kotlin/cn/ppps/forwarder/workers/BluetoothWorker.kt:26— BluetoothWorker.doWork 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.
LogsFragment.initLogsFilterDialog (cyclomatic 20) app/src/main/kotlin/cn/ppps/forwarder/fragment/LogsFragment.kt:219— LogsFragment.initLogsFilterDialog 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.
SettingsFragment.initListeners (cyclomatic 20) app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SettingsFragment.kt:157— SettingsFragment.initListeners 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.
SettingsFragment.checkSetting (cyclomatic 20) app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SettingsFragment.kt:430— SettingsFragment.checkSetting 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.
CronFragment.initDayInputHelper (cyclomatic 20) app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/CronFragment.kt:743— CronFragment.initDayInputHelper 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.
BatteryWorker.doWork (cyclomatic 20) app/src/main/kotlin/cn/ppps/forwarder/workers/BatteryWorker.kt:28— BatteryWorker.doWork 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.
CronFragment.initWeekInputHelper (cyclomatic 19) app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/CronFragment.kt:1122— CronFragment.initWeekInputHelper 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.
BarkUtils.sendMsg (cyclomatic 19) app/src/main/kotlin/cn/ppps/forwarder/utils/sender/BarkUtils.kt:31— BarkUtils.sendMsg 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.
TelegramUtils.sendMsg (cyclomatic 19) app/src/main/kotlin/cn/ppps/forwarder/utils/sender/TelegramUtils.kt:30— TelegramUtils.sendMsg 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.
App.onCreate (cyclomatic 18) app/src/main/kotlin/cn/ppps/forwarder/App.kt:155— App.onCreate 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.
MainActivity.onItemSelected (cyclomatic 18) app/src/main/kotlin/cn/ppps/forwarder/activity/MainActivity.kt:253— MainActivity.onItemSelected 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.
RulesEditFragment.testRule (cyclomatic 18) app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:748— RulesEditFragment.testRule 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.
ServerFragment.initListeners (cyclomatic 18) app/src/main/kotlin/cn/ppps/forwarder/fragment/ServerFragment.kt:79— ServerFragment.initListeners 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.
SettingsFragment.switchEnablePhone (cyclomatic 18) app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:392— SettingsFragment.switchEnablePhone 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.
WolSendFragment.onClick (cyclomatic 18) app/src/main/kotlin/cn/ppps/forwarder/fragment/client/WolSendFragment.kt:82— WolSendFragment.onClick 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.
ClientFragment.onItemClick (cyclomatic 17) app/src/main/kotlin/cn/ppps/forwarder/fragment/ClientFragment.kt:299— ClientFragment.onItemClick has cyclomatic complexity 17 (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.
MsgFragment.testRule (cyclomatic 17) app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/MsgFragment.kt:388— MsgFragment.testRule 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.
EmailFragment.initViews (cyclomatic 17) app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/EmailFragment.kt:109— EmailFragment.initViews 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.
SocketUtils.sendMqttSuspend (cyclomatic 17) app/src/main/kotlin/cn/ppps/forwarder/utils/sender/SocketUtils.kt:190— SocketUtils.sendMqttSuspend 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.
NetworkSetting.<init> (cyclomatic 16) app/src/main/kotlin/cn/ppps/forwarder/entity/condition/NetworkSetting.kt:14— NetworkSetting.<init> 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.
ServerFragment.onClick (cyclomatic 16) app/src/main/kotlin/cn/ppps/forwarder/fragment/ServerFragment.kt:294— ServerFragment.onClick 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.
MsgFragment.initListeners (cyclomatic 16) app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/MsgFragment.kt:169— MsgFragment.initListeners 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.
BarkFragment.checkSetting (cyclomatic 16) app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/BarkFragment.kt:255— BarkFragment.checkSetting 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.
Base64.decode (cyclomatic 16) app/src/main/kotlin/cn/ppps/forwarder/utils/Base64.kt:47— Base64.decode 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.
ActionWorker.doWork (cognitive 142) app/src/main/kotlin/cn/ppps/forwarder/workers/ActionWorker.kt:82— ActionWorker.doWork has cognitive complexity 142 (threshold 15). Drivers by points: if/else 113, error handling 17, match/switch 6, loops 4, boolean chains 2 (nesting depth added 88). 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.
ConditionUtils.checkCondition (cognitive 127) app/src/main/kotlin/cn/ppps/forwarder/utils/task/ConditionUtils.kt:49— ConditionUtils.checkCondition has cognitive complexity 127 (threshold 15). Drivers by points: if/else 101, boolean chains 17, match/switch 8, loops 1 (nesting depth added 70). 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.
WebhookUtils.sendMsg (cognitive 81) app/src/main/kotlin/cn/ppps/forwarder/utils/sender/WebhookUtils.kt:40— WebhookUtils.sendMsg has cognitive complexity 81 (threshold 15). Drivers by points: if/else 55, match/switch 14, boolean chains 10, loops 2 (nesting depth added 39). 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.
EmailFragment.checkSetting (cognitive 65) app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/EmailFragment.kt:320— EmailFragment.checkSetting has cognitive complexity 65 (threshold 15). Drivers by points: if/else 25, error handling 22, match/switch 10, boolean chains 7, loops 1 (nesting depth added 37). 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.
SmsCommandUtils.execute (cognitive 60) app/src/main/kotlin/cn/ppps/forwarder/utils/SmsCommandUtils.kt:36— SmsCommandUtils.execute has cognitive complexity 60 (threshold 15). Drivers by points: if/else 53, error handling 3, loops 2, boolean chains 1, match/switch 1 (nesting depth added 33). 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.
PhoneUtils.getCallInfoList (cognitive 58) app/src/main/kotlin/cn/ppps/forwarder/utils/PhoneUtils.kt:251— PhoneUtils.getCallInfoList has cognitive complexity 58 (threshold 15). Drivers by points: if/else 49, loops 6, boolean chains 2, error handling 1 (nesting depth added 35). 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.
LocationWorker.doWork (cognitive 53) app/src/main/kotlin/cn/ppps/forwarder/workers/LocationWorker.kt:30— LocationWorker.doWork has cognitive complexity 53 (threshold 15). Drivers by points: if/else 35, match/switch 7, boolean chains 6, loops 4, error handling 1 (nesting depth added 26). 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.
BatteryWorker.doWork (cognitive 43) app/src/main/kotlin/cn/ppps/forwarder/workers/BatteryWorker.kt:28— BatteryWorker.doWork has cognitive complexity 43 (threshold 15). Drivers by points: if/else 35, loops 4, boolean chains 2, error handling 1, match/switch 1 (nesting depth added 24). 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.
NetworkWorker.doWork (cognitive 43) app/src/main/kotlin/cn/ppps/forwarder/workers/NetworkWorker.kt:37— NetworkWorker.doWork has cognitive complexity 43 (threshold 15). Drivers by points: if/else 37, boolean chains 2, match/switch 2, error handling 1, loops 1 (nesting depth added 21). 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.
EmailUtils.sendMsg (cognitive 42) app/src/main/kotlin/cn/ppps/forwarder/utils/sender/EmailUtils.kt:33— EmailUtils.sendMsg has cognitive complexity 42 (threshold 15). Drivers by points: if/else 24, match/switch 8, boolean chains 5, error handling 4, 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.
LogsFragment.initLogsFilterDialog (cognitive 41) app/src/main/kotlin/cn/ppps/forwarder/fragment/LogsFragment.kt:219— LogsFragment.initLogsFilterDialog has cognitive complexity 41 (threshold 15). Drivers by points: if/else 35, match/switch 5, boolean chains 1 (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.
SmsReceiver.onReceive (cognitive 37) app/src/main/kotlin/cn/ppps/forwarder/receiver/SmsReceiver.kt:30— SmsReceiver.onReceive has cognitive complexity 37 (threshold 15). Drivers by points: if/else 26, loops 5, boolean chains 4, error handling 1, match/switch 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.
DingtalkGroupRobotUtils.sendMsg (cognitive 34) app/src/main/kotlin/cn/ppps/forwarder/utils/sender/DingtalkGroupRobotUtils.kt:28— DingtalkGroupRobotUtils.sendMsg has cognitive complexity 34 (threshold 15). Drivers by points: if/else 26, loops 8 (nesting depth added 20). 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.
TaskPagingAdapter.onBindViewHolder (cognitive 33) app/src/main/kotlin/cn/ppps/forwarder/adapter/TaskPagingAdapter.kt:29— TaskPagingAdapter.onBindViewHolder has cognitive complexity 33 (threshold 15). Drivers by points: if/else 25, loops 8 (nesting depth added 23). 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.
ClientFragment.queryConfig (cognitive 33) app/src/main/kotlin/cn/ppps/forwarder/fragment/ClientFragment.kt:322— ClientFragment.queryConfig has cognitive complexity 33 (threshold 15). Drivers by points: if/else 25, error handling 5, boolean chains 2, match/switch 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.
TasksEditFragment.onItemClick (cognitive 33) app/src/main/kotlin/cn/ppps/forwarder/fragment/TasksEditFragment.kt:542— TasksEditFragment.onItemClick has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18, boolean chains 10, loops 4, error handling 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.
BluetoothWorker.doWork (cognitive 33) app/src/main/kotlin/cn/ppps/forwarder/workers/BluetoothWorker.kt:26— BluetoothWorker.doWork has cognitive complexity 33 (threshold 15). Drivers by points: if/else 20, loops 7, boolean chains 3, match/switch 2, error handling 1 (nesting depth added 16). 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.
EmailFragment.initViews (cognitive 30) app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/EmailFragment.kt:109— EmailFragment.initViews has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20, loops 8, boolean chains 1, match/switch 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.
NotificationService.onNotificationPosted (cognitive 28) app/src/main/kotlin/cn/ppps/forwarder/service/NotificationService.kt:49— NotificationService.onNotificationPosted has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22, boolean chains 3, loops 2, error handling 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.
WolSendFragment.onClick (cognitive 27) app/src/main/kotlin/cn/ppps/forwarder/fragment/client/WolSendFragment.kt:82— WolSendFragment.onClick has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15, error handling 7, match/switch 3, 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.
Base64.decode (cognitive 27) app/src/main/kotlin/cn/ppps/forwarder/utils/Base64.kt:47— Base64.decode has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14, loops 9, 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.
TasksEditFragment.onFragmentResult (cognitive 25) app/src/main/kotlin/cn/ppps/forwarder/fragment/TasksEditFragment.kt:615— TasksEditFragment.onFragmentResult has cognitive complexity 25 (threshold 15). Drivers by points: if/else 25 (nesting depth added 16). 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.
SettingsFragment.initListeners (cognitive 25) app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SettingsFragment.kt:157— SettingsFragment.initListeners has cognitive complexity 25 (threshold 15). Drivers by points: if/else 24, 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.
TelegramUtils.sendMsg (cognitive 25) app/src/main/kotlin/cn/ppps/forwarder/utils/sender/TelegramUtils.kt:30— TelegramUtils.sendMsg has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18, boolean chains 5, match/switch 2 (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.
PhoneUtils.getSmsInfoList (cognitive 24) app/src/main/kotlin/cn/ppps/forwarder/utils/PhoneUtils.kt:556— PhoneUtils.getSmsInfoList has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21, loops 2, error handling 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.
BarkUtils.sendMsg (cognitive 24) app/src/main/kotlin/cn/ppps/forwarder/utils/sender/BarkUtils.kt:31— BarkUtils.sendMsg has cognitive complexity 24 (threshold 15). Drivers by points: if/else 23, 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.
SettingsFragment.startToAutoStartSetting (cognitive 23) app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:1348— SettingsFragment.startToAutoStartSetting has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11, error handling 7, loops 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.
SmsSendFragment.onClick (cognitive 23) app/src/main/kotlin/cn/ppps/forwarder/fragment/client/SmsSendFragment.kt:81— SmsSendFragment.onClick has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13, error handling 7, match/switch 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.
PhoneUtils.sendSms (cognitive 23) app/src/main/kotlin/cn/ppps/forwarder/utils/PhoneUtils.kt:188— PhoneUtils.sendSms has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14, loops 4, boolean chains 3, error handling 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.
App.onCreate (cognitive 22) app/src/main/kotlin/cn/ppps/forwarder/App.kt:155— App.onCreate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, error handling 4, 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.
RulesEditFragment.checkForm (cognitive 21) app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:610— RulesEditFragment.checkForm has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, match/switch 4, 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.
RulesEditFragment.testRule (cognitive 21) app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:748— RulesEditFragment.testRule has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, match/switch 3, error handling 2, 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.
AlarmFragment.onClick (cognitive 21) app/src/main/kotlin/cn/ppps/forwarder/fragment/action/AlarmFragment.kt:165— AlarmFragment.onClick has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, boolean chains 2, error handling 2, 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.
CronFragment.initWeekInputHelper (cognitive 21) app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/CronFragment.kt:1122— CronFragment.initWeekInputHelper has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, 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.
BluetoothSetting.<init> (cognitive 20) app/src/main/kotlin/cn/ppps/forwarder/entity/condition/BluetoothSetting.kt:18— BluetoothSetting.<init> has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, match/switch 3 (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.
ClientFragment.onClick (cognitive 20) app/src/main/kotlin/cn/ppps/forwarder/fragment/ClientFragment.kt:221— ClientFragment.onClick has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, match/switch 5 (nesting depth added 10). 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.
FrpcFragment.onItemClicked (cognitive 20) app/src/main/kotlin/cn/ppps/forwarder/fragment/FrpcFragment.kt:142— FrpcFragment.onItemClicked has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, error handling 3, match/switch 3 (nesting depth added 10). 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.
CronFragment.initDayInputHelper (cognitive 20) app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/CronFragment.kt:743— CronFragment.initDayInputHelper has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, 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.
MsgFragment.testRule (cognitive 20) app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/MsgFragment.kt:388— MsgFragment.testRule has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, match/switch 3, 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.
RulesEditFragment.initAppSpinner (cognitive 19) app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:484— RulesEditFragment.initAppSpinner has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, loops 4, boolean chains 2, 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.
ContactAddFragment.onClick (cognitive 19) app/src/main/kotlin/cn/ppps/forwarder/fragment/client/ContactAddFragment.kt:69— ContactAddFragment.onClick has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9, error handling 7, match/switch 3 (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.
MsgFragment.initAppSpinner (cognitive 19) app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/MsgFragment.kt:282— MsgFragment.initAppSpinner has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, loops 4, boolean chains 2, 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.
SettingsFragment.switchEnablePhone (cognitive 18) app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:392— SettingsFragment.switchEnablePhone has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, 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.
CronFragment.initSecondInputHelper (cognitive 18) app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/CronFragment.kt:242— CronFragment.initSecondInputHelper has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 2, 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.
CronFragment.initMinuteInputHelper (cognitive 18) app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/CronFragment.kt:409— CronFragment.initMinuteInputHelper has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 2, 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.
CronFragment.initHourInputHelper (cognitive 18) app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/CronFragment.kt:576— CronFragment.initHourInputHelper has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 2, 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.
CronFragment.initMonthInputHelper (cognitive 18) app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/CronFragment.kt:956— CronFragment.initMonthInputHelper has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 2, 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.
CronFragment.initYearInputHelper (cognitive 18) app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/CronFragment.kt:1335— CronFragment.initYearInputHelper has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 2, 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.
LeaveAddressFragment.initListeners (cognitive 18) app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/LeaveAddressFragment.kt:96— LeaveAddressFragment.initListeners has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, error handling 8 (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.
ToAddressFragment.initListeners (cognitive 18) app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/ToAddressFragment.kt:96— ToAddressFragment.initListeners has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, error handling 8 (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.
PushplusUtils.sendMsg (cognitive 18) app/src/main/kotlin/cn/ppps/forwarder/utils/sender/PushplusUtils.kt:24— PushplusUtils.sendMsg has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18 (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.
LockScreenWorker.doWork (cognitive 18) app/src/main/kotlin/cn/ppps/forwarder/workers/LockScreenWorker.kt:26— LockScreenWorker.doWork has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, match/switch 2, boolean chains 1, error handling 1, 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.
SendWorker.doWork (cognitive 18) app/src/main/kotlin/cn/ppps/forwarder/workers/SendWorker.kt:42— SendWorker.doWork has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 2, loops 2, 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.
MsgInfo.replaceAppNameTag (cognitive 17) app/src/main/kotlin/cn/ppps/forwarder/entity/MsgInfo.kt:219— MsgInfo.replaceAppNameTag has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, loops 4, 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.
BatteryQueryFragment.initViews (cognitive 17) app/src/main/kotlin/cn/ppps/forwarder/fragment/client/BatteryQueryFragment.kt:49— BatteryQueryFragment.initViews has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, error handling 5, 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.
LocationFragment.getLocation (cognitive 17) app/src/main/kotlin/cn/ppps/forwarder/fragment/client/LocationFragment.kt:83— LocationFragment.getLocation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, error handling 5, 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.
MsgFragment.initListeners (cognitive 17) app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/MsgFragment.kt:169— MsgFragment.initListeners has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 5, match/switch 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.
VibrationUtils.vibratePattern (cognitive 17) app/src/main/kotlin/cn/ppps/forwarder/utils/VibrationUtils.kt:60— VibrationUtils.vibratePattern has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, 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.
ClientFragment.onItemClick (cognitive 16) app/src/main/kotlin/cn/ppps/forwarder/fragment/ClientFragment.kt:299— ClientFragment.onItemClick has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 12, if/else 3, error handling 1. 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.
SettingsFragment.switchEnableLocation (cognitive 16) app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:609— SettingsFragment.switchEnableLocation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, match/switch 4 (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.
SettingsFragment.checkSetting (cognitive 16) app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SettingsFragment.kt:430— SettingsFragment.checkSetting has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, match/switch 2, 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.
CloneFragment.pullData (cognitive 16) app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CloneFragment.kt:365— CloneFragment.pullData has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, error handling 5, match/switch 1 (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.
HttpServerUtils.restoreSettings (cognitive 16) app/src/main/kotlin/cn/ppps/forwarder/utils/HttpServerUtils.kt:174— HttpServerUtils.restoreSettings has cognitive complexity 16 (threshold 15). Drivers by points: loops 8, if/else 7, error handling 1 (nesting depth added 6). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
SocketUtils.sendMqttSuspend (cognitive 16) app/src/main/kotlin/cn/ppps/forwarder/utils/sender/SocketUtils.kt:190— SocketUtils.sendMqttSuspend has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 3, error handling 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.
SendWorker.autoTaskProcess (cognitive 16) app/src/main/kotlin/cn/ppps/forwarder/workers/SendWorker.kt:123— SendWorker.autoTaskProcess has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 1, loops 1, 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.
TooManyMethods: SettingsFragment app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:90— TooManyMethods — 39 methods. 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.
Unpinned build actions — CI references GitHub Actions by a floating ref (@main / @tag) rather than a pinned commit SHA, weakening build integrity. 14 floating ref(s) across 2 workflow file(s). Each floating ref is itemized at file:line by the SAST (D29) lens.
Workflow token permissions not restricted — No workflow declares a `permissions:` block, so every job runs with the repository's default GITHUB_TOKEN scope (2 workflow file(s) checked). On a repository whose default is read/write, a compromised action or a malicious pull request inherits write access to code, issues, releases and packages. Declare a least-privilege `permissions:` block — `permissions: {contents: read}` at the top of each workflow, widened per job only where a job genuinely writes.
D36 · Supply-chain Provenance & Signing· Secret passed as a command-line argument · ×1
Secret passed as a command-line argument — 1 CI command(s) pass a credential as a bare command-line argument, where it is visible in the runner's process table to any other process on the host (and to anything that logs a command line): Weekly_Build.yml: curl --retry 3 -X POST -H "Cache-Control: no-cache" -H "Content-Type: multipart/form-data" -H "Cookie: xupdate_token=${{ secrets.XUPDATE_TOKEN }}" -H "X-Token: ${{ secrets.X_TOKEN }}" -F "file=@${{ env.output }}/${apk};filename=${apk}" -F "versionId=${version_id}" ${{ secrets.URL_UPLOAD_APK }}. Pass the credential through the environment instead (an `env:` mapping on the step, read by the tool from its own variable) or on stdin, so it never appears in an argument vector.
Duplicated block (19 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CallQueryFragment.kt:167— app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CallQueryFragment.kt:167-185 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/ContactQueryFragment.kt:149-167 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CallQueryFragment.kt:167` 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 (17 lines × 3) app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:465— app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:465-481 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/NotificationFragment.kt:360-376 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SenderFragment.kt:264-280 — 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/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt:465` 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 (16 lines × 4) app/src/main/kotlin/cn/ppps/forwarder/fragment/client/BatteryQueryFragment.kt:96— app/src/main/kotlin/cn/ppps/forwarder/fragment/client/BatteryQueryFragment.kt:96-111 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CallQueryFragment.kt:251-266 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/ContactQueryFragment.kt:228-243 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/SmsQueryFragment.kt:239-254 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/client/BatteryQueryFragment.kt:96` 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 (15 lines × 10) app/src/main/kotlin/cn/ppps/forwarder/fragment/action/CleanerFragment.kt:109— app/src/main/kotlin/cn/ppps/forwarder/fragment/action/CleanerFragment.kt:109-123 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/FrpcFragment.kt:144-158 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/HttpServerFragment.kt:157-171 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/NotificationFragment.kt:235-249 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/ResendFragment.kt:116-130 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/RuleFragment.kt:149-163 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SenderFragment.kt:150-164 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SettingsFragment.kt:353-367 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/TaskActionFragment.kt:150-164 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/WolFragment.kt:151-165 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/action/CleanerFragment.kt:109` 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 (15 lines × 4) app/src/main/kotlin/cn/ppps/forwarder/fragment/client/ContactAddFragment.kt:127— app/src/main/kotlin/cn/ppps/forwarder/fragment/client/ContactAddFragment.kt:127-141 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/LocationFragment.kt:127-141 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/SmsSendFragment.kt:145-159 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/WolSendFragment.kt:181-195 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/client/ContactAddFragment.kt:127` 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 (15 lines × 2) app/src/main/kotlin/cn/ppps/forwarder/database/entity/Rule.kt:262— app/src/main/kotlin/cn/ppps/forwarder/database/entity/Rule.kt:262-276 | app/src/main/kotlin/cn/ppps/forwarder/utils/RuleLine.kt:137-151 — 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/kotlin/cn/ppps/forwarder/database/entity/Rule.kt:262` 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 (14 lines × 5) app/src/main/kotlin/cn/ppps/forwarder/adapter/spinner/AppListSpinnerAdapter.kt:95— app/src/main/kotlin/cn/ppps/forwarder/adapter/spinner/AppListSpinnerAdapter.kt:95-108 | app/src/main/kotlin/cn/ppps/forwarder/adapter/spinner/FrpcSpinnerAdapter.kt:109-122 | app/src/main/kotlin/cn/ppps/forwarder/adapter/spinner/RuleSpinnerAdapter.kt:105-118 | app/src/main/kotlin/cn/ppps/forwarder/adapter/spinner/SenderSpinnerAdapter.kt:105-118 | app/src/main/kotlin/cn/ppps/forwarder/adapter/spinner/TaskSpinnerAdapter.kt:105-118 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/adapter/spinner/AppListSpinnerAdapter.kt:95` 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 (13 lines × 11) app/src/main/kotlin/cn/ppps/forwarder/fragment/ClientFragment.kt:358— app/src/main/kotlin/cn/ppps/forwarder/fragment/ClientFragment.kt:358-370 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/BatteryQueryFragment.kt:80-92 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CallQueryFragment.kt:235-247 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CloneFragment.kt:301-313 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CloneFragment.kt:404-416 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/ContactAddFragment.kt:113-125 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/ContactQueryFragment.kt:212-224 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/LocationFragment.kt:113-125 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/SmsQueryFragment.kt:223-235 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/SmsSendFragment.kt:131-143 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/WolSendFragment.kt:167-179 — there are 11 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 11 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/kotlin/cn/ppps/forwarder/fragment/ClientFragment.kt:358` 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 (13 lines × 8) app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/ServerchanFragment.kt:91— app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/ServerchanFragment.kt:91-103 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/SmsFragment.kt:121-133 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/SocketFragment.kt:93-105 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/TelegramFragment.kt:94-106 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/UrlSchemeFragment.kt:96-108 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/WebhookFragment.kt:99-111 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/WeworkAgentFragment.kt:96-108 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/WeworkRobotFragment.kt:94-106 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/ServerchanFragment.kt:91` 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 (13 lines × 3) app/src/main/kotlin/cn/ppps/forwarder/fragment/client/ContactAddFragment.kt:166— app/src/main/kotlin/cn/ppps/forwarder/fragment/client/ContactAddFragment.kt:166-178 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/SmsSendFragment.kt:184-196 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/WolSendFragment.kt:223-235 — before extracting anything, compare `app/src/main/kotlin/cn/ppps/forwarder/fragment/client/ContactAddFragment.kt` and `app/src/main/kotlin/cn/ppps/forwarder/fragment/client/SmsSendFragment.kt` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 101 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/kotlin/cn/ppps/forwarder/fragment/client/ContactAddFragment.kt:166` 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 × 4) app/src/main/kotlin/cn/ppps/forwarder/adapter/spinner/FrpcSpinnerAdapter.kt:75— app/src/main/kotlin/cn/ppps/forwarder/adapter/spinner/FrpcSpinnerAdapter.kt:75-90 | app/src/main/kotlin/cn/ppps/forwarder/adapter/spinner/RuleSpinnerAdapter.kt:75-86 | app/src/main/kotlin/cn/ppps/forwarder/adapter/spinner/SenderSpinnerAdapter.kt:75-86 | app/src/main/kotlin/cn/ppps/forwarder/adapter/spinner/TaskSpinnerAdapter.kt:75-86 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, 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 × 3) app/src/main/kotlin/cn/ppps/forwarder/fragment/SendersFragment.kt:226— app/src/main/kotlin/cn/ppps/forwarder/fragment/SendersFragment.kt:226-236 | app/src/main/kotlin/cn/ppps/forwarder/fragment/TasksEditFragment.kt:351-361 | app/src/main/kotlin/cn/ppps/forwarder/fragment/TasksEditFragment.kt:370-380 — 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 (10 lines × 4) app/src/main/kotlin/cn/ppps/forwarder/fragment/action/AlarmFragment.kt:81— app/src/main/kotlin/cn/ppps/forwarder/fragment/action/AlarmFragment.kt:81-90 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/BarkFragment.kt:93-102 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/FeishuAppFragment.kt:88-97 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/FeishuFragment.kt:89-98 — 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/main/kotlin/cn/ppps/forwarder/fragment/action/AlarmFragment.kt:81` 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 (9 lines × 15) app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/BarkFragment.kt:194— app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/BarkFragment.kt:194-203 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/DingtalkGroupRobotFragment.kt:168-177 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/DingtalkInnerRobotFragment.kt:184-193 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/EmailFragment.kt:259-268 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/FeishuAppFragment.kt:164-173 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/FeishuFragment.kt:172-181 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/GotifyFragment.kt:145-154 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/PushplusFragment.kt:165-174 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/ServerchanFragment.kt:141-149 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/SocketFragment.kt:162-170 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/TelegramFragment.kt:169-177 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/UrlSchemeFragment.kt:144-152 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/WebhookFragment.kt:183-191 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/WeworkAgentFragment.kt:202-210 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/WeworkRobotFragment.kt:164-172 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/BarkFragment.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 (9 lines × 8) app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CallQueryFragment.kt:220— app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CallQueryFragment.kt:220-228 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CloneFragment.kt:389-397 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/ContactAddFragment.kt:98-106 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/ContactQueryFragment.kt:197-205 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/SmsQueryFragment.kt:208-216 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/SmsSendFragment.kt:116-124 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/WolSendFragment.kt:152-160 | app/src/main/kotlin/cn/ppps/forwarder/workers/ActionWorker.kt:418-426 — 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/main/kotlin/cn/ppps/forwarder/fragment/client/CallQueryFragment.kt:220` 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 × 4) app/src/main/kotlin/cn/ppps/forwarder/fragment/client/BatteryQueryFragment.kt:144— app/src/main/kotlin/cn/ppps/forwarder/fragment/client/BatteryQueryFragment.kt:144-152 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CallQueryFragment.kt:294-302 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/ContactQueryFragment.kt:265-273 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/SmsQueryFragment.kt:282-290 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/client/BatteryQueryFragment.kt:144` 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 × 9) app/src/main/kotlin/cn/ppps/forwarder/fragment/client/BatteryQueryFragment.kt:51— app/src/main/kotlin/cn/ppps/forwarder/fragment/client/BatteryQueryFragment.kt:51-58 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CallQueryFragment.kt:205-212 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/ContactAddFragment.kt:72-79 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/ContactQueryFragment.kt:181-188 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/LocationFragment.kt:84-91 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/SmsQueryFragment.kt:193-200 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/SmsSendFragment.kt:84-91 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/WolSendFragment.kt:112-119 | app/src/main/kotlin/cn/ppps/forwarder/workers/ActionWorker.kt:400-407 — 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/main/kotlin/cn/ppps/forwarder/fragment/client/BatteryQueryFragment.kt:51` 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 × 7) app/src/main/kotlin/cn/ppps/forwarder/fragment/ClientFragment.kt:391— app/src/main/kotlin/cn/ppps/forwarder/fragment/ClientFragment.kt:391-398 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CloneFragment.kt:333-340 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CloneFragment.kt:436-443 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/ContactAddFragment.kt:146-153 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/LocationFragment.kt:146-153 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/SmsSendFragment.kt:164-171 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/WolSendFragment.kt:200-207 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/ClientFragment.kt:391` 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 × 3) app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CloneFragment.kt:348— app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CloneFragment.kt:348-355 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/ContactAddFragment.kt:161-168 | app/src/main/kotlin/cn/ppps/forwarder/fragment/client/SmsSendFragment.kt:179-186 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CloneFragment.kt:348` 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 × 26) app/src/main/kotlin/cn/ppps/forwarder/fragment/AppListFragment.kt:130— app/src/main/kotlin/cn/ppps/forwarder/fragment/AppListFragment.kt:130-136 | app/src/main/kotlin/cn/ppps/forwarder/fragment/ServerFragment.kt:365-371 | app/src/main/kotlin/cn/ppps/forwarder/fragment/ServerFragment.kt:439-445 | app/src/main/kotlin/cn/ppps/forwarder/fragment/ServerFragment.kt:468-474 | app/src/main/kotlin/cn/ppps/forwarder/fragment/ServerFragment.kt:497-503 | app/src/main/kotlin/cn/ppps/forwarder/fragment/ServerFragment.kt:522-528 | app/src/main/kotlin/cn/ppps/forwarder/fragment/ServerFragment.kt:549-555 | app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:312-318 | app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:364-370 | app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:417-423 | app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:544-550 | app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:618-624 | app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:739-745 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/AlarmFragment.kt:197-203 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/HttpServerFragment.kt:244-250 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/HttpServerFragment.kt:272-278 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/HttpServerFragment.kt:300-306 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/HttpServerFragment.kt:324-330 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SendSmsFragment.kt:149-155 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SettingsFragment.kt:178-184 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SettingsFragment.kt:211-217 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SettingsFragment.kt:262-268 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SettingsFragment.kt:313-319 | app/src/main/kotlin/cn/ppps/forwarder/fragment/condition/BluetoothFragment.kt:222-228 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/EmailFragment.kt:546-552 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/SmsFragment.kt:92-98 — there are 26 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 26 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/kotlin/cn/ppps/forwarder/fragment/AppListFragment.kt:130` 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 × 4) app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/DingtalkInnerRobotFragment.kt:256— app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/DingtalkInnerRobotFragment.kt:256-262 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/TelegramFragment.kt:239-245 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/WebhookFragment.kt:262-268 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/WeworkAgentFragment.kt:280-286 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/DingtalkInnerRobotFragment.kt:256` 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 × 7) app/src/main/kotlin/cn/ppps/forwarder/workers/BatteryWorker.kt:81— app/src/main/kotlin/cn/ppps/forwarder/workers/BatteryWorker.kt:81-88 | app/src/main/kotlin/cn/ppps/forwarder/workers/BatteryWorker.kt:140-147 | app/src/main/kotlin/cn/ppps/forwarder/workers/BluetoothWorker.kt:104-109 | app/src/main/kotlin/cn/ppps/forwarder/workers/LocationWorker.kt:107-112 | app/src/main/kotlin/cn/ppps/forwarder/workers/LocationWorker.kt:170-175 | app/src/main/kotlin/cn/ppps/forwarder/workers/NetworkWorker.kt:146-151 | app/src/main/kotlin/cn/ppps/forwarder/workers/SimWorker.kt:87-92 — there are 7 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 7 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/kotlin/cn/ppps/forwarder/workers/BatteryWorker.kt:81` 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. 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 (6 lines × 4) app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/DingtalkInnerRobotFragment.kt:159— app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/DingtalkInnerRobotFragment.kt:159-164 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/TelegramFragment.kt:153-158 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/WebhookFragment.kt:167-172 | app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/WeworkAgentFragment.kt:162-167 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/DingtalkInnerRobotFragment.kt:159` 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 (5 lines × 6) app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:441— app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:441-445 | app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:449-453 | app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:457-461 | app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:465-469 | app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:473-477 | app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:481-485 — all 6 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/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt:441` 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 (30 lines × 3) app/src/main/kotlin/cn/ppps/forwarder/fragment/action/RuleFragment.kt:91— app/src/main/kotlin/cn/ppps/forwarder/fragment/action/RuleFragment.kt:91-120 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/SenderFragment.kt:92-121 | app/src/main/kotlin/cn/ppps/forwarder/fragment/action/TaskActionFragment.kt:92-121 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
Recommendation — 5 finding(s)
D11 · Test Reliability· Test reliability not included · ×1
Test reliability not included — No test suite was found, so reliability couldn't be assessed.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 19 significant file(s) lose their only recent owner: app/src/main/kotlin/cn/ppps/forwarder/fragment/SettingsFragment.kt, app/src/main/kotlin/cn/ppps/forwarder/fragment/RulesEditFragment.kt, app/src/main/kotlin/cn/ppps/forwarder/App.kt, app/src/main/kotlin/cn/ppps/forwarder/fragment/client/CloneFragment.kt, app/src/main/kotlin/cn/ppps/forwarder/utils/sender/EmailUtils.kt, app/src/main/kotlin/cn/ppps/forwarder/utils/CommonUtils.kt, app/src/main/kotlin/cn/ppps/forwarder/fragment/senders/BarkFragment.kt, app/src/main/kotlin/cn/ppps/forwarder/utils/SendUtils.kt (+11 more). Pair on, review, or document these before any departure.
No build provenance — No SLSA provenance generation or build attestation found in CI — nothing binds a released artifact to the build that produced it, so a consumer cannot tell your artifact from a substituted one. On GitHub Actions, `actions/attest-build-provenance` (or slsa-github-generator) emits one from the job's own OIDC identity; elsewhere, run `cosign attest` over the released artifact from the release pipeline and publish the attestation beside it.
D36 · Supply-chain Provenance & Signing· No SBOM · ×1
No SBOM — No SBOM generation or committed SBOM found — produce one with what your ecosystem ships (the `cyclonedx-gradle-plugin` on the build, `syft` (or `anchore/sbom-action` in CI) over the source tree or released image). Publish it as a release asset (`*.spdx.json` / `*.cdx.json`) so consumers can see what they are installing.
No tests found — No test suite could be collected — nothing here references a test framework (JUnit (with Kotest or MockK on Kotlin)), so there were no discoverable tests to count. Tests written as plain executables or shell/PowerShell harnesses are not collectible this way and are not scored here.
Info — 2 finding(s)
D12 · Dependency Hygiene· Dependency hygiene not measured · ×1
Dependency hygiene not measured — dependency manifest found but not parsed for hygiene — This repository's dependency manifest (a Gradle version catalogue) was found, but this pass cannot parse it for hygiene, so no package was assessed. Zero packages read is NOT a clean dependency tree, so this is NOT SCORED — a gap in the analyzer, not a verdict about this repository. This row is about dependency HYGIENE — outdated, deprecated or unmaintained direct dependencies; known CVEs in the same dependency graph are a separate question, reported under D38 wherever the manifest is OSV-readable.
D22 · Internal API Consistency· No exposed public API · ×1
No exposed public API — No intentionally-exposed types (IsPackable or .Contracts) to evaluate.
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.
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Terraform, Kubernetes/Helm, CloudFormation); nothing to scan.
trivy: not applicable — No JS/npm manifest or lockfile found outside build output (package.json, package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb); no JS dependencies to scan.
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.
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.
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.
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
—
Run 019fd01a-b9b7-76c5-86af-8339ac1653a2 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 15 · Warnings: 275 · Recommendations: 5 · Info: 2 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 05-08-2026 @ 04:07 UTC.
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.