duplicate-client-init
Same SDK client is initialized in multiple files — consolidate into one shared module.
Applies to: Project-level
Why this matters
When the same external service client (like Resend, Stripe, or PrismaClient) is initialized in multiple files with `new`, changes to one copy don't update the others. This leads to bugs when copies drift: one file gets a mock mode, retry logic, or config fix while the others silently keep the old behavior. Centralize initialization in one shared module and import from there.
Catch it before it ships
pip install stablestack # or: npx stablestackstablestack # scans your project, STRUCT013 includedstablestack explain STRUCT013False positive in your codebase? Suppress a single line with # noqa: STRUCT013
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.
STRUCT004sys-path-manipulation
Direct sys.path manipulation detected.
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.