Skip to content

Remove dead engine code, stale root files and broad mypy overrides; show per-run success rate #68

Closed

Description

@TMHSDigital

Why it matters

After the recent refactors a layer of leftovers remains. None is a bug on its own, but together they mislead new contributors about what is live, and one shows users a misleading number.

Evidence

Engine leftovers (autoclicker/core/click_engine.py)

  • _should_stop (line 369) has no callers outside tests.
  • performance_metrics["click_timings"] deque (lines 63, 439) and total_click_time are filled on every click but never read by the app.
  • reset_performance_metrics (line 216) is never called, so click_success_count / click_error_count accumulate across runs. The status bar's "N% success" (main_window.py:476) is therefore a lifetime figure while the cps next to it is per run.

Root clutter

  • run_tests.py: wrapper around pytest, superseded by make test / tasks.bat test.
  • requirements.txt: duplicates pyproject.toml dependencies with stale comments ("tkinter comes with Python 3.8+"); requirements-lock.txt is what the launcher and CI use.
  • autoclicker_settings.example.json: missing current keys (target_mode, hotkeys, theme, minimize_to_tray, max_cps_ceiling, enable_failsafe, pause_when_unfocused); the README's settings table is now the real reference.
  • create_icon.py at the root is a dev tool; scripts/ or tools/ already exist for those.

Typing debt (pyproject.toml [tool.mypy])

  • autoclicker.gui.* disables attr-defined and arg-type; autoclicker.core.click_engine disables operator, assignment, call-overload, attr-defined. These hide real mistakes in the two most important modules. The engine ones mostly come from the untyped performance_metrics dict.

Suggested approach

  • Delete _should_stop, the unused metrics, and either reset metrics in start_clicking or drop the success-rate display (it is ~100% in practice).
  • Remove run_tests.py, the example JSON (or regenerate it from DEFAULT_SETTINGS in a test), and either remove requirements.txt or make it a one-line -r requirements-lock.txt. Move create_icon.py to tools/.
  • Replace performance_metrics with a small dataclass, then delete the click_engine mypy override; shrink the GUI override by typing the app parameter of the section builders.

Done when

  • make check passes with the overrides removed or reduced, the root holds only entry points and config, and the status bar shows per-run numbers only.

Activity

  1. added
    priority: low
    maintenance
    on Oct 4, 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