Skip to content

Codex/security coderabbit fixes - #91

Merged
Insaner1980 merged 5 commits into
mainfrom
codex/security-coderabbit-fixes
Jul 26, 2026
Merged

Codex/security coderabbit fixes#91
Insaner1980 merged 5 commits into
mainfrom
codex/security-coderabbit-fixes

Conversation

@Insaner1980

@Insaner1980 Insaner1980 commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features
    • Added reusable expandable card headers with consistent accessibility and toggle behavior.
    • Added shared settings chip-group controls for calibration UI.
  • Bug Fixes
    • Improved security scanning accuracy for manifest-export detection, URI sharing/clip data, sensitive logging, foreground audio service starts, FileProvider broad paths, and Health Connect sensitive flows.
    • Fixed processing-lock recovery reporting and tightened command-line validation.
  • Tests
    • Expanded matcher, UI, and screenshot suite coverage.
  • Documentation
    • Updated screenshot-test documentation counts.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 21fdbd92-f3e2-425a-b0c3-71fe2f22ee47

📥 Commits

Reviewing files that changed from the base of the PR and between fa35edb and b62bcce.

⛔ Files ignored due to path filters (9)
  • app/src/screenshotTestDebug/reference/com/dbcheck/app/ComponentScreenshotTestsKt/LiveSoundLevelChartActiveDarkPreview_4b098843_0.png is excluded by !**/*.png
  • app/src/screenshotTestDebug/reference/com/dbcheck/app/ComponentScreenshotTestsKt/LiveSoundLevelChartActivePreview_74131fac_0.png is excluded by !**/*.png
  • app/src/screenshotTestDebug/reference/com/dbcheck/app/ComponentScreenshotTestsKt/LiveSoundLevelChartEmptyPreview_74131fac_0.png is excluded by !**/*.png
  • app/src/screenshotTestDebug/reference/com/dbcheck/app/ComponentScreenshotTestsKt/LiveSoundLevelChartPausedDarkPreview_4b098843_0.png is excluded by !**/*.png
  • app/src/screenshotTestDebug/reference/com/dbcheck/app/ComponentScreenshotTestsKt/SoundReferenceCardCollapsedPreview_74131fac_0.png is excluded by !**/*.png
  • app/src/screenshotTestDebug/reference/com/dbcheck/app/ComponentScreenshotTestsKt/SoundReferenceCardExpandedDarkPreview_4b098843_0.png is excluded by !**/*.png
  • app/src/screenshotTestDebug/reference/com/dbcheck/app/ComponentScreenshotTestsKt/SpectralAnalysisLiveDarkPreview_4b098843_0.png is excluded by !**/*.png
  • app/src/screenshotTestDebug/reference/com/dbcheck/app/ComponentScreenshotTestsKt/SpectralAnalysisRtaDarkPreview_4b098843_0.png is excluded by !**/*.png
  • app/src/screenshotTestDebug/reference/com/dbcheck/app/ComponentScreenshotTestsKt/SpectralAnalysisSpectrogramDarkPreview_4b098843_0.png is excluded by !**/*.png
📒 Files selected for processing (15)
  • .deepsec/matchers/security-matchers.test.ts
  • .deepsec/matchers/sensitive-android-log.ts
  • PROJECT.md
  • UI-SPEC.md
  • app/build.gradle.kts
  • app/gradle.lockfile
  • app/src/main/java/com/dbcheck/app/ui/settings/components/AudioCalibrationSection.kt
  • app/src/main/java/com/dbcheck/app/ui/settings/components/DisplayAndFeaturesSection.kt
  • app/src/main/java/com/dbcheck/app/ui/settings/components/SettingsChipGroup.kt
  • app/src/screenshotTest/kotlin/com/dbcheck/app/ComponentScreenshotTests.kt
  • app/src/test/java/com/dbcheck/app/ui/UiDocumentationContractTest.kt
  • app/src/test/java/com/dbcheck/app/ui/meter/components/ExpandableCardHeaderComposeTest.kt
  • app/src/test/java/com/dbcheck/app/ui/meter/components/MeterExpandableComponentsContractTest.kt
  • gradle/libs.versions.toml
  • gradle/verification-metadata.xml
💤 Files with no reviewable changes (2)
  • app/src/test/java/com/dbcheck/app/ui/meter/components/MeterExpandableComponentsContractTest.kt
  • app/src/main/java/com/dbcheck/app/ui/settings/components/DisplayAndFeaturesSection.kt
🚧 Files skipped from review as they are similar to previous changes (2)
  • .deepsec/matchers/sensitive-android-log.ts
  • app/src/main/java/com/dbcheck/app/ui/settings/components/AudioCalibrationSection.kt

📝 Walkthrough

Walkthrough

This PR updates DeepSec matcher parsing and lock recovery, refactors Compose headers, calibration controls, and screenshot previews, adjusts localized strings and tests, and adds Compose UI testing dependencies while upgrading Compose Stability metadata.

Changes

DeepSec analysis and recovery tooling

Layer / File(s) Summary
Code-aware matcher parsing
.deepsec/matchers/utils.ts, .deepsec/matchers/android-uri-share-without-clipdata.ts, .deepsec/matchers/sensitive-android-log.ts
Adds comment/string-aware boundary parsing, scoped URI-share analysis, and balanced logging-call detection.
Matcher coverage and syntax variants
.deepsec/matchers/*, .deepsec/matchers/security-matchers.test.ts
Expands matcher support for quoting, health identifiers, logging, foreground services, and URI sharing, with tests for each behavior.
Processing-lock recovery and test execution
.deepsec/scripts/*, .deepsec/package.json, .deepsec/.gitignore, .deepsec/pnpm-workspace.yaml
Separates recoverable locks, validates CLI option values, adds recovery tests, and configures matcher test output and workspace overrides.

Compose UI and preview refactoring

Layer / File(s) Summary
Shared expandable card headers
app/src/main/java/com/dbcheck/app/ui/meter/components/*, app/src/test/java/com/dbcheck/app/ui/meter/components/*
Introduces expandableCardHeader and applies it to live activity and sound-reference headers with Compose and source contract tests.
Preview data and screenshot composition
app/src/main/java/com/dbcheck/app/ui/analytics/..., app/src/main/java/com/dbcheck/app/ui/history/..., app/src/screenshotTest/..., PROJECT.md, UI-SPEC.md, app/src/test/java/com/dbcheck/app/ui/UiDocumentationContractTest.kt
Exposes preview datasets, consolidates screenshot preview content and containers, updates histogram and spectral data, and synchronizes screenshot counts.
Shared calibration controls
app/src/main/java/com/dbcheck/app/ui/settings/components/*, app/stability/*
Reuses shared chip-group and calibration composables and records generated stability metadata.
UI resources and behavior tests
app/src/main/res/values*/strings.xml, app/src/test/java/com/dbcheck/app/ui/hearing/HearingViewModelTest.kt
Updates localized labels and centralizes blocked voice-baseline capture assertions.

Compose testing and Stability dependency metadata

Layer / File(s) Summary
Compose test dependencies
app/build.gradle.kts, gradle/libs.versions.toml, app/gradle.lockfile
Adds Compose UI test dependencies and corresponding AndroidX Test, JavaWriter, and Hamcrest lock entries.
Compose Stability version and locks
gradle/libs.versions.toml, app/gradle.lockfile, buildscript-gradle.lockfile, config/dependency-check-suppressions.xml
Updates Compose Stability references and locked artifacts to version 0.11.1.
Artifact verification records
gradle/verification-metadata.xml
Adds verification hashes for new test artifacts and refreshes verification records for updated and newly recorded dependencies.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

  • Insaner1980/dBcheck#89: Directly overlaps the DeepSec matcher parsing, URI-share and logging changes, shared parsing utilities, and matcher test wiring.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is too vague and generic to convey the main change in the changeset. Use a concise, specific title that names the primary update, such as the matcher/test refactor or Compose UI test additions.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/security-coderabbit-fixes
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch codex/security-coderabbit-fixes

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fa35edb1ae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +45 to +46
const nextShareStart = starts[index + 1] ?? content.length;
const end = findShareScopeEnd(content, start, nextShareStart);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Älä katkaise jaon aluetta seuraavaan ACTION_SEND-osumaan

Jos samassa funktiossa luodaan kaksi jako-Intentiä ennen ensimmäisen konfigurointia, nextShareStart katkaisee ensimmäisen tarkastusalueen toisen konstruktorin kohdalta. Esimerkiksi turvallisesti konfiguroitu toinen Intent ja sen jälkeen tehty first.putExtra(Intent.EXTRA_STREAM, uri) johtavat siihen, ettei ensimmäisen Intentin puuttuvaa ClipDataa tai lukuoikeuslippua havaita lainkaan. Rajaa alue Intent-muuttujan tai sitä ympäröivän lohkon perusteella sen sijaan, että jokainen myöhempi ACTION_SEND-osuma olisi ehdoton loppuraja.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (4)
app/src/test/java/com/dbcheck/app/ui/meter/components/MeterExpandableComponentsContractTest.kt (1)

39-47: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Add light- and dark-theme runtime coverage.

This source-string test cannot verify the shared header’s rendered semantics, click behavior, or theme behavior. Add Compose UI or screenshot tests that exercise the header in both light and dark themes, including expansion and accessibility semantics.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@app/src/test/java/com/dbcheck/app/ui/meter/components/MeterExpandableComponentsContractTest.kt`
around lines 39 - 47, Replace the source-string assertions in
sharedExpandableHeaderIsTokenizedAccessibleAndTogglesState with Compose UI or
screenshot coverage for ExpandableCardHeader, exercising it under both light and
dark themes. Verify rendered theme behavior, expansion changes after clicking
the header, and accessibility semantics including the state description and
toggle action.

Source: Coding guidelines

app/src/screenshotTest/kotlin/com/dbcheck/app/ComponentScreenshotTests.kt (1)

1117-1125: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use shared spacing and radius tokens in the preview container.

ComponentPreviewContainer hardcodes 16.dp and draws a square background. Use the shared spacing token and a shared radius of at least 8dp before applying the background.

As per coding guidelines, “Centralize design tokens such as colors, spacing” and “All containers must have a minimum corner radius of 8dp.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/src/screenshotTest/kotlin/com/dbcheck/app/ComponentScreenshotTests.kt`
around lines 1117 - 1125, Update ComponentPreviewContainer to replace the
hardcoded 16.dp padding with the existing shared spacing token, and apply a
shared corner-radius token of at least 8dp before the background modifier. Keep
the existing theme surface color and container layout unchanged.

Source: Coding guidelines

app/src/main/java/com/dbcheck/app/ui/settings/components/AudioCalibrationSection.kt (1)

294-308: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract a shared chip-group helper

AudioCalibrationSection.kt duplicates the same label/spacing/FlowRow structure already used by SettingsChipGroup; move that layout into a reusable helper and use it here instead of keeping two near-identical implementations.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@app/src/main/java/com/dbcheck/app/ui/settings/components/AudioCalibrationSection.kt`
around lines 294 - 308, Reuse the existing SettingsChipGroup helper for
CalibrationChipControls instead of maintaining a duplicate Column, label,
spacing, and FlowRow layout. Update CalibrationChipControls to pass its title
and content through that shared helper, preserving the current styling and chip
spacing.

Source: Coding guidelines

.deepsec/matchers/sensitive-android-log.ts (1)

7-7: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

logCallStart misses Log.wtf(...).

Android's Log.wtf is a real log-call surface — it "should be used to log a condition that should not happen," so it's just as likely to carry sensitive identifiers as Log.e, but the current alternation (?:v|d|i|w|e) never matches it.

♻️ Proposed fix to include `wtf`
-const logCallStart = /\b(?:Log|android\.util\.Log)\.(?:v|d|i|w|e)\s*\(/g;
+const logCallStart = /\b(?:Log|android\.util\.Log)\.(?:v|d|i|w|e|wtf)\s*\(/g;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.deepsec/matchers/sensitive-android-log.ts at line 7, Update the
logCallStart matcher to include the Android Log.wtf method alongside the
existing v, d, i, w, and e methods, while preserving the current matching
behavior for all other supported log calls.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/src/screenshotTest/kotlin/com/dbcheck/app/ComponentScreenshotTests.kt`:
- Around line 964-968: Add dark-theme preview variants for
SpectralAnalysisLivePreview, SpectralAnalysisSpectrogramPreview, and
SpectralAnalysisRtaPreview using uiMode = Configuration.UI_MODE_NIGHT_YES, while
preserving each existing preview’s content and selected mode. Avoid duplicates
if matching dark previews already exist elsewhere in the file.

---

Nitpick comments:
In @.deepsec/matchers/sensitive-android-log.ts:
- Line 7: Update the logCallStart matcher to include the Android Log.wtf method
alongside the existing v, d, i, w, and e methods, while preserving the current
matching behavior for all other supported log calls.

In
`@app/src/main/java/com/dbcheck/app/ui/settings/components/AudioCalibrationSection.kt`:
- Around line 294-308: Reuse the existing SettingsChipGroup helper for
CalibrationChipControls instead of maintaining a duplicate Column, label,
spacing, and FlowRow layout. Update CalibrationChipControls to pass its title
and content through that shared helper, preserving the current styling and chip
spacing.

In `@app/src/screenshotTest/kotlin/com/dbcheck/app/ComponentScreenshotTests.kt`:
- Around line 1117-1125: Update ComponentPreviewContainer to replace the
hardcoded 16.dp padding with the existing shared spacing token, and apply a
shared corner-radius token of at least 8dp before the background modifier. Keep
the existing theme surface color and container layout unchanged.

In
`@app/src/test/java/com/dbcheck/app/ui/meter/components/MeterExpandableComponentsContractTest.kt`:
- Around line 39-47: Replace the source-string assertions in
sharedExpandableHeaderIsTokenizedAccessibleAndTogglesState with Compose UI or
screenshot coverage for ExpandableCardHeader, exercising it under both light and
dark themes. Verify rendered theme behavior, expansion changes after clicking
the header, and accessibility semantics including the state description and
toggle action.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8d344422-0438-438f-b4a2-83f535231513

📥 Commits

Reviewing files that changed from the base of the PR and between ab21108 and fa35edb.

⛔ Files ignored due to path filters (1)
  • .deepsec/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (31)
  • .deepsec/.gitignore
  • .deepsec/matchers/android-exported-component.ts
  • .deepsec/matchers/android-uri-share-without-clipdata.ts
  • .deepsec/matchers/fileprovider-broad-path.ts
  • .deepsec/matchers/foreground-audio-service-start.ts
  • .deepsec/matchers/health-connect-sensitive-flow.ts
  • .deepsec/matchers/security-matchers.test.ts
  • .deepsec/matchers/sensitive-android-log.ts
  • .deepsec/matchers/utils.ts
  • .deepsec/package.json
  • .deepsec/pnpm-workspace.yaml
  • .deepsec/scripts/recover-processing-locks.mjs
  • .deepsec/scripts/recover-processing-locks.test.mjs
  • app/gradle.lockfile
  • app/src/main/java/com/dbcheck/app/ui/analytics/components/SpectralStatPill.kt
  • app/src/main/java/com/dbcheck/app/ui/history/detail/SessionDetailScreen.kt
  • app/src/main/java/com/dbcheck/app/ui/meter/components/ExpandableCardHeader.kt
  • app/src/main/java/com/dbcheck/app/ui/meter/components/LiveActivityCard.kt
  • app/src/main/java/com/dbcheck/app/ui/meter/components/SoundReferenceCard.kt
  • app/src/main/java/com/dbcheck/app/ui/settings/components/AudioCalibrationSection.kt
  • app/src/main/res/values-fi/strings.xml
  • app/src/main/res/values/strings.xml
  • app/src/screenshotTest/kotlin/com/dbcheck/app/ComponentScreenshotTests.kt
  • app/src/test/java/com/dbcheck/app/ui/hearing/HearingViewModelTest.kt
  • app/src/test/java/com/dbcheck/app/ui/meter/components/MeterExpandableComponentsContractTest.kt
  • app/stability/app-debug.stability
  • app/stability/app-release.stability
  • buildscript-gradle.lockfile
  • config/dependency-check-suppressions.xml
  • gradle/libs.versions.toml
  • gradle/verification-metadata.xml
💤 Files with no reviewable changes (2)
  • app/src/main/res/values-fi/strings.xml
  • app/src/main/res/values/strings.xml

@sonarqubecloud

Copy link
Copy Markdown

@Insaner1980
Insaner1980 merged commit 644989c into main Jul 26, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant