Skip to content

Minor code quality issues: unused import, GPU guard logic, requirements (tkinter), GPUtil naming, silent excepts #8

@nikola-projects

Description

@nikola-projects

This issue collects a few well-defined minor issues found during recent code review (excluding previously reported pandas usage):

1. Unused Import

  • File: core/monitor.py
  • Line: import platform
  • Problem: The platform import is not used in the file and can be safely removed.

2. Redundant GPU Check Logic

  • File: core/monitor.py
  • Method: _get_gpu_percent
  • Problem: The check if not _GPUS_AVAILABLE: return 0.0 and the surrounding logic can be streamlined or simplified. Dead/never-reached path is present. Consider refactoring to clarify GPU detection and fallback behavior.

3. Requirements File, tkinter/tk Declarations

  • File: requirements.txt
  • Problem: tkinter and tk are listed as pip dependencies, but these are standard library/built-in in Python and usually not installed with pip. They can cause install errors. Remove them from requirements and consider describing the dependency in documentation instead (with a note about system requirements for Linux users).

4. Package Name Consistency for GPUtil

  • File: requirements.txt
  • Problem: The package is referenced as gputil in requirements but imported as GPUtil (case-sensitive). Confirm the correct pip install name (GPUtil) and standardize the spelling in requirements, docs, and code.

5. Unclear Error Logging

  • Files: Several (e.g. core/monitor.py, core/hardware_sensors.py, UI modules)
  • Problem: Many exception blocks use except: pass with no log or traceback, which may hide issues while debugging or in production. Use proper logging in all broad except blocks.

Improvements to the codebase are progressing really well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions