sys-path-manipulation
Direct sys.path manipulation detected.
Applies to: Python
Why this matters
Manipulating sys.path directly makes code brittle and hard to deploy. Use PYTHONPATH environment variable, proper package installation (pip install -e .), or configure your IDE/test runner instead. sys.path hacks often break in CI/CD.
Catch it before it ships
pip install stablestack # or: npx stablestackstablestack # scans your project, STRUCT004 includedstablestack explain STRUCT004STRUCT004 is part of the Pro rule set. See pricing — the free tier ships 24 checks with no signup.
False positive in your codebase? Suppress a single line with # noqa: STRUCT004
More Code Structure checks
multiple-classes-per-file
Multiple classes defined in a single file.
STRUCT003imports-in-function
Import statement inside a function instead of at module level.
STRUCT005relative-imports
Relative import used instead of absolute import.
STRUCT006hasattr-getattr-pattern
Using hasattr/getattr for attribute access instead of proper typing.
STRUCT009class-filename-mismatch
Class name doesn't match filename convention.
STRUCT010mixed-frontend-backend
Frontend and backend code should be clearly separated
STRUCT011duplicate-modules
Duplicate files exist in multiple locations - likely from incomplete migration or copy-paste.
STRUCT012naked-functions
Too many loose functions - consider grouping into a class or service.