Skip to content

refactor: reduce complexity, remove dead code, add oxlint plugins#47

Merged
ccombe merged 2 commits into
masterfrom
fix/google-fit-typeof-lint
May 10, 2026
Merged

refactor: reduce complexity, remove dead code, add oxlint plugins#47
ccombe merged 2 commits into
masterfrom
fix/google-fit-typeof-lint

Conversation

@ccombe
Copy link
Copy Markdown
Owner

@ccombe ccombe commented May 10, 2026

Summary

This PR cleans up the codebase with multiple improvements:

Complexity Reduction

  • Extract tone scheduling helper in audio.ts, simplify playEndSound
  • Group DOM queries in ui.ts, standardize on textContent, fix TS strict initialization
  • Extract auth/token helpers in google-fit.ts, simplify uploadSession
  • normalizeConfig CRAP score dropped from 110 → clean (extracted pickMode, pickNumber, pickBool)
  • determineIntervalCount CRAP score dropped from 42 → clean

Dead Code Removal

  • TimerEngine.toggle() — only used in tests
  • StorageService.getHistory() — never called
  • StorageService.close() — never called

Linting Improvements

  • Add oxlint JS plugins: eslint-plugin-testing-library, eslint-plugin-playwright, eslint-plugin-sonarjs
  • Enable 8 additional sonarjs rules
  • Clean all 14 console.log/warn/error debug statements
  • 155 rules active (was 95), 0 warnings, 0 errors

Fallow Integration

  • Add regression baseline tracking
  • Save health snapshot for trend monitoring
  • Configure fallow-mcp in opencode.json for agent tooling

CI Updates

  • Add code-quality job with lint + regression check
  • Trigger on push to master as well as PRs

Verification

  • ✅ All 55 tests pass
  • ✅ TypeScript compiles clean (tsc --noEmit)
  • ✅ Oxlint: 0 warnings, 0 errors (155 rules)
  • ✅ Fallow: maintainability 88.7 (good), 0 dead code, 0 duplication

codescene-delta-analysis[bot]

This comment was marked as outdated.

@ccombe ccombe force-pushed the fix/google-fit-typeof-lint branch from 6b41ecf to 3415aca Compare May 10, 2026 02:57
codescene-delta-analysis[bot]

This comment was marked as outdated.

@ccombe ccombe force-pushed the fix/google-fit-typeof-lint branch from 3415aca to 9304fce Compare May 10, 2026 02:58
codescene-delta-analysis[bot]

This comment was marked as outdated.

@ccombe ccombe force-pushed the fix/google-fit-typeof-lint branch from 9304fce to 5ec2ad1 Compare May 10, 2026 03:00
codescene-delta-analysis[bot]

This comment was marked as outdated.

@ccombe ccombe force-pushed the fix/google-fit-typeof-lint branch from 5ec2ad1 to 2729d79 Compare May 10, 2026 03:02
codescene-delta-analysis[bot]

This comment was marked as outdated.

…ean consoles

- Extract tone scheduling helper in audio.ts, simplify playEndSound
- Group DOM queries in ui.ts, standardize textContent, fix TS strict init
- Extract auth/token helpers in google-fit.ts, simplify uploadSession
- Remove dead code: TimerEngine.toggle, StorageService.getHistory/close
- Reduce complexity: normalizeConfig (CRAP 110→clean), determineIntervalCount
- Add oxlint JS plugins: eslint-plugin-testing-library, playwright, sonarjs
- Clean all 14 console.log/warn/error debug statements
- Enable 8 additional sonarjs rules (no-gratuitous-expressions, etc.)
- Add fallow regression baseline + health snapshot tracking
- Configure fallow-mcp in opencode.json for agent tooling
- Update CI with code-quality job + lint + regression check
- Fix tests for removed console calls and dead code
- All 55 tests pass, 155 rules active, 0 warnings, 0 errors
@ccombe ccombe force-pushed the fix/google-fit-typeof-lint branch from 2729d79 to a6b5836 Compare May 10, 2026 03:05
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Choose a reason for hiding this comment

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

No quality gates enabled for this code.

See analysis details in CodeScene

Quality Gate Profile: Custom Configuration
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

@ccombe ccombe merged commit 1c03983 into master May 10, 2026
6 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