Skip to content

refactor: reduce cognitive complexity and enforce a lint budget - #358

Merged
devmobasa merged 53 commits into
mainfrom
feat/code-complexity-rules
Aug 26, 2026
Merged

refactor: reduce cognitive complexity and enforce a lint budget#358
devmobasa merged 53 commits into
mainfrom
feat/code-complexity-rules

Conversation

@devmobasa

Copy link
Copy Markdown
Owner

Summary

Reduce cognitive complexity across Wayscriber without intentionally changing application behavior.

This refactor:

  • splits large config-validation routines into focused normalization and validation stages
  • separates app session commands, input actions, presenter transitions, and UI event routing
  • decomposes Wayland pointer, keyboard, tablet, render, capture, and event-loop handlers
  • breaks toolbar, board-picker, and GTK test scenarios into smaller helpers
  • centralizes repeated logic such as submenu anchors, thread joins, and event routing
  • enables Clippy's cognitive_complexity lint with a threshold of 20

Motivation

Several functions had accumulated deeply nested branches and multiple responsibilities, making them harder to review, test, and safely modify.

The new structure gives individual operations clearer names and boundaries while preserving the existing control flow.

Behavior

No user-facing behavior changes are intended. This is a maintainability refactor rather than a runtime-performance optimization.

Validation

  • ./tools/lint-and-test.sh
  • formatting and Clippy checks pass
  • all-feature tests pass
  • no-default-feature tests pass

@devmobasa
devmobasa merged commit e5a8464 into main Aug 26, 2026
2 checks passed
@devmobasa
devmobasa deleted the feat/code-complexity-rules branch August 26, 2026 20:09
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