Skip to content

Remove dead and test-only code and duplicated defaults #172

Closed

Description

@TMHSDigital

Summary

Leftovers from earlier designs that readers and tests still maintain.

Where

  • autoclicker/core/settings_manager.py:234 (theme), :764-767 (reset_to_defaults)
  • autoclicker/utils/profiles.py:114-125 (save_preset/load_preset)
  • autoclicker/utils/coordinate_picker.py
  • autoclicker/core/click_engine.py:117-148, :382-396, :923-950
  • autoclicker/app/hotkeys.py:25 and autoclicker/core/settings_manager.py:240
  • autoclicker.py:10-38, autoclicker/main.py:33-38

Details

  • The theme setting is never read (single dark palette).
  • reset_to_defaults and the point-only PresetManager.save_preset/load_preset are called only from tests and share names with different GUI methods.
  • utils/coordinate_picker.py is a deprecated alias of utils/profiles whose name collides with the real picker; its tests live in test_coordinate_picker.py. Rename the test file and schedule removal for 2.0.
  • get_status()["performance"] computes success rate, average click time and errors that only Copy diagnostics may use; confirm consumers and trim.
  • The default CPS ceiling 50 is hard-coded in about 8 places, DEFAULT_HOTKEYS is duplicated as a literal in DEFAULT_SETTINGS, and the image margin 150 in 4 places; the "saved hotkeys or defaults" logic exists in both main_window.py:345-351 and cli.py:282-285.
  • autoclicker.py repeats main._show_dialog as _show_error.

Impact

Name collisions mislead searches, and changing a default needs a repo-wide grep.

Suggested fix

Work through the checklist; each item is a standalone commit. Add tests asserting DEFAULT_SETTINGS["hotkeys"] == DEFAULT_HOTKEYS and that the summary CPS default equals the settings default before deduplicating.

Acceptance criteria

  • Checklist items done
  • make check green

Related: #68

Getting started

  • Relevant files: autoclicker/core/settings_manager.py, autoclicker/utils/, autoclicker/core/click_engine.py, autoclicker.py
  • How to run tests: make check (Git Bash) or tasks.bat lint, tasks.bat typecheck, tasks.bat test (cmd). Single test: python -m pytest tests/test_x.py::TestClass::test_name --no-cov
  • Related docs: CONTRIBUTING.md, docs/ARCHITECTURE.md

Filed by repo-audit/full-audit at 9968dc8. Severity: low. Effort: S. audit-key: tech-debt|autoclicker/utils/profiles.py|PresetManager.save_preset

Activity

  1. added
    priority: low
    maintenance
    on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintenancepriority: low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions