UNPKG

@sun-asterisk/sunlint

Version:

☀️ SunLint - Multi-language static analysis tool for code quality and security | Sun* Engineering Standards

1,960 lines 159 kB
{ "rules": { "C001": { "name": "Functions should not exceed 50 lines", "description": "Improve readability and maintainability, reduce cognitive load, and enhance testability.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "SonarQube", "detekt", "ESLint", "PMD" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C002": { "name": "Avoid code duplication > 10 lines", "description": "Prevent messy code, make refactoring easier, and apply the DRY principle.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "PMD", "SonarQube", "jscpd" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C003": { "name": "Use clear variable names; avoid arbitrary abbreviations", "description": "Improve readability, searchability, and enable self-documenting code.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "ESLint (custom rule)", "detekt" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C004": { "name": "No TODOs older than 14 days", "description": "Keep the codebase clean and updated, avoid accumulating technical debt.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Custom Git hook", "linter TODO scanner" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C005": { "name": "Each function should do only one thing", "description": "Ensure single responsibility, better testability and readability.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "SonarQube", "CodeClimate" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C006": { "name": "Function names must be verbs or verb-noun combinations", "description": "Clearly express the purpose of the action and promote self-documenting code.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "PR review", "AI Suggestion (Copilot Review)" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C007": { "name": "Avoid comments that just restate the code", "description": "Eliminate redundancy and encourage self-explanatory code.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "AI review", "Lint static analyzer" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C008": { "name": "Declare variables close to where they are used", "description": "Improve locality, avoid \"dangling\" variables, and reduce cognitive load.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Linter (e.g.", "ktlint", "ESLint)" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C009": { "name": "Each class should have a single responsibility", "description": "Improve maintainability and scalability, avoid bloated classes.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "SonarQube", "CodeClimate" ], "framework": "All", "principles": [ "CODE_QUALITY", "DESIGN_PATTERNS" ] }, "C010": { "name": "Avoid more than 3 levels of nested blocks", "description": "Reduce code complexity by limiting nesting, improving readability and maintainability.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "ESLint", "SonarQube", "TSLint", "Detekt", "PMD" ], "framework": "All", "principles": [ "CODE_QUALITY", "DESIGN_PATTERNS" ] }, "C011": { "name": "Avoid catching generic exceptions (e.g., `catch (Exception)`)", "description": "Prevent hiding real issues and ensure specific and recoverable error handling.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Static analysis", "SonarQube" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C012": { "name": "Clearly separate Command and Query", "description": "Ensure single responsibility and clear side-effects following the Command Query Separation (CQS) principle.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "PR review", "AI code review" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C013": { "name": "Do not use dead code", "description": "Keep the codebase clean; rely on Git history instead of commenting out code.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Linter + Git hook" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C014": { "name": "Use Dependency Injection instead of directly instantiating dependencies", "description": "Improve testability and decoupling by applying the Dependency Inversion Principle.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Static analyzer", "PR review" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C015": { "name": "Use domain language in class/function names", "description": "Ensure correct domain understanding, reduce cognitive load, and improve communication with domain experts.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Review + AI Suggestion" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C016": { "name": "TODOs must have a specific reason", "description": "Avoid vague TODOs and ensure traceability and accountability.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Regex + Linter rule" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C017": { "name": "Do not put business logic inside constructors", "description": "Ensure constructors only initialize objects, not perform business logic, to improve testability.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Static analyzer / Manual review" ], "framework": "All", "principles": [ "CODE_QUALITY", "TESTABILITY", "RELIABILITY", "INTEGRATION" ] }, "C018": { "name": "Do not throw generic errors; always provide detailed messages", "description": "Facilitate debugging, ensure traceability, and provide full context.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Linter + Manual review" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C019": { "name": "Do not use `error` log level for non-critical issues", "description": "Prevent noisy logs and false alarms; ensure consistent and meaningful log levels across the system.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Log linter / Custom rule" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C020": { "name": "Do not import unused modules or libraries", "description": "Reduce noise, improve build performance and code readability, and minimize bundle size.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Linter (e.g.", "ESLint", "ktlint)" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C021": { "name": "Consistently order import statements", "description": "Improve consistency, readability, and manageability of imports; reduce merge conflicts.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Import sorter (e.g.", "ESLint sort-imports", "IntelliJ organize imports", "ktlint)" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C022": { "name": "Do not leave unused variables", "description": "Eliminate clutter, improve code clarity, and reduce memory footprint.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Linter / Compiler warning" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C023": { "name": "Do not declare duplicate variable names in the same scope, including nested closures", "description": "Avoid confusion and hard-to-trace bugs; prevent variable shadowing.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Compiler / Linter" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C024": { "name": "Do not scatter hardcoded constants throughout the logic", "description": "Improve reusability, readability, and ease of configuration changes.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Linter / Convention" ], "framework": "All", "principles": [ "CODE_QUALITY", "MAINTAINABILITY" ] }, "C025": { "name": "Each file should contain only one main class", "description": "Reduce cognitive load when reading code; improve searchability and maintainability.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Convention / Linter warning" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C026": { "name": "Avoid functions with too many parameters (>6)", "description": "Simplify functions, reduce confusion when calling, and minimize coupling.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "SonarQube", "Static Analyzer" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C027": { "name": "Each module should have a README.md if it is independent", "description": "Improve onboarding, maintenance, and knowledge sharing.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "CI check / Manual review" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C028": { "name": "Use guard clauses instead of nested ifs", "description": "Improve readability and avoid deep nesting, reducing cognitive complexity.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "PR review", "linter" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C029": { "name": "All `catch` blocks must log the root cause of the error", "description": "Improve traceability and incident resolution; avoid silent failures.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Static analyzer / PR review" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C030": { "name": "Use custom error classes instead of generic system errors", "description": "Improve error classification and handling; increase maintainability.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Linter / Convention" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C031": { "name": "Validation logic must be separated", "description": "No description available", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Convention", "PR review" ], "framework": "All", "principles": [ "CODE_QUALITY", "TESTABILITY", "MAINTAINABILITY" ] }, "C032": { "name": "Do not call external APIs in constructors or static blocks", "description": "No description available", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Static analyzer" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C033": { "name": "Separate processing logic and data access in the service layer", "description": "No description available", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Architectural review" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C034": { "name": "Avoid directly accessing global state in domain logic", "description": "No description available", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Static analyzer", "Code review" ], "framework": "All", "principles": [ "CODE_QUALITY", "DESIGN_PATTERNS" ] }, "C035": { "name": "Log all relevant context when handling errors", "description": "No description available", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Logging framework" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C036": { "name": "Do not throw generic exceptions like `RuntimeException` or `Exception`", "description": "No description available", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Static analyzer" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C037": { "name": "API handler functions should return a standardized response object (not raw strings)", "description": "No description available", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "API documentation tools" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C038": { "name": "Avoid logic that depends on file/module load order", "description": "No description available", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Architectural Review" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C039": { "name": "Do not store temporary data in global or static mutable fields", "description": "Prevent issues related to shared state and race conditions in concurrent environments. Ensure thread-safety and testability. Using global or static mutable fields can introduce hard-to-detect and hard-to-fix bugs.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Static Analyzer" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C040": { "name": "Do not spread validation logic across multiple classes", "description": "Centralize validation logic to simplify maintenance, increase reusability, and ensure consistency. Centralized validation helps reduce bugs and simplifies updating validation rules.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Architectural Refactor Review" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C041": { "name": "Do not hardcode or push sensitive information (token, API key, secret, URL) into the repo", "description": "Protect sensitive application data, avoid security risks, and comply with security standards. Exposing sensitive information can lead to serious security and privacy issues.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Git Hooks", "Secret Scanner" ], "framework": "All", "principles": [ "SECURITY" ] }, "C042": { "name": "Boolean variable names should start with `is`, `has`, or `should`", "description": "Ensure clarity and readability by making boolean variables self-explanatory. This naming convention improves code maintainability and documentation.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Linter (ESLint", "SonarQube)" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C043": { "name": "Do not use `print` or `console.log` in production code", "description": "Ensure logging is done in a controlled and effective manner in production. Using `print` or `console.log` can lead to performance issues, security risks, and log management difficulties.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Linter", "Log Analyzer" ], "framework": "All", "principles": [ "CODE_QUALITY", "PERFORMANCE" ] }, "C044": { "name": "Avoid reimplementing functions that already exist in standard libraries or helper utilities", "description": "Leverage well-tested, optimized, and community-maintained libraries to reduce bugs and improve development efficiency.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Package Manager", "Dependency Analyzer" ], "framework": "All", "principles": [ "CODE_QUALITY", "PERFORMANCE" ] }, "C045": { "name": "APIs should not return 500 errors for known business errors", "description": "Ensure APIs return appropriate HTTP status codes so clients can handle errors effectively. HTTP 500 should be reserved for unexpected system errors.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "API Testing", "Error Monitoring" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C046": { "name": "Avoid complex and lengthy regular expressions in core logic", "description": "Keep code readable, maintainable, and efficient by avoiding the use of overly complex regular expressions in business-critical logic.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Code Review", "Static Code Analyzer" ], "framework": "All", "principles": [ "CODE_QUALITY", "PERFORMANCE" ] }, "C047": { "name": "Retry logic must not be duplicated in multiple places", "description": "Centralize retry logic to improve consistency, maintainability, and observability of error handling and retry mechanisms.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Code Review", "Static Code Analyzer" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C048": { "name": "Do not bypass architectural layers (controller/service/repository)", "description": "Maintain a clear layered architecture, ensuring logic and data flow are well-structured and maintainable.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Static Analyzer", "Architectural boundary checker" ], "framework": "All", "principles": [ "DESIGN_PATTERNS", "MAINTAINABILITY" ] }, "C049": { "name": "Always include a clear default case in switch/case statements", "description": "Avoid missing logic for unexpected values, increasing stability and safety of the application.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Linter" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C050": { "name": "Do not call APIs in loops without batching or throttling", "description": "Prevent system overload, resource contention, API rate limit violations, or the backend being perceived as under attack (DDoS).", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Performance review" ], "framework": "All", "principles": [ "CODE_QUALITY", "PERFORMANCE" ] }, "C051": { "name": "Do not use `sleep`, `wait`, or `delay` in business logic", "description": "Avoid uncontrolled delays that cause asynchronous issues, make debugging and testing harder, and increase the risk of race conditions in production environments.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Static analyzer", "manual review" ], "framework": "All", "principles": [ "CODE_QUALITY", "PERFORMANCE" ] }, "C052": { "name": "Parsing or data transformation logic must be separated from controllers", "description": "Enforce separation of concerns — controllers should only handle requests and delegate processing, improving testability, maintainability, and reuse.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Code review / Architecture enforcement" ], "framework": "All", "principles": [ "CODE_QUALITY", "DESIGN_PATTERNS", "MAINTAINABILITY" ] }, "C053": { "name": "Avoid vague function names like \"handle\" or \"process\"", "description": "Clarify function behavior, reduce hidden logic, and improve code readability and traceability.", "category": "Common", "severity": "minor", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "AI reviewer / naming linter" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C054": { "name": "Do not process large datasets without pagination or lazy loading", "description": "Prevent loading all data into memory, avoid out-of-memory errors, and improve performance and response time.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Code review", "ORM warning", "API response profiler" ], "framework": "All", "principles": [ "PERFORMANCE" ] }, "C055": { "name": "Cache results of expensive functions if reused", "description": "Reduce processing time and resource usage by caching results of resource-heavy operations.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Code review", "performance profiler" ], "framework": "All", "principles": [ "CODE_QUALITY", "PERFORMANCE" ] }, "C056": { "name": "Do not process large datasets without logging or resource monitoring", "description": "Track resource usage (CPU, RAM, I/O), detect anomalies early, and ensure system stability.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Logging", "APM (Application Performance Monitoring)" ], "framework": "All", "principles": [ "PERFORMANCE", "RELIABILITY" ] }, "C057": { "name": "Use optimal data structures instead of arrays for frequent lookups", "description": "Reduce algorithm complexity, improve access speed, and optimize performance.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Static analyzer", "AI reviewer" ], "framework": "All", "principles": [ "PERFORMANCE" ] }, "C058": { "name": "Enums must have clear display labels", "description": "Ensure enums shown in logs, UIs, or APIs are understandable and user-friendly.", "category": "Common", "severity": "minor", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Manual review" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C059": { "name": "Do not create abstractions just to group constants", "description": "Avoid unnecessary abstractions (class, enum) that add complexity without behavior or clear domain meaning.", "category": "Common", "severity": "minor", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Manual review" ], "framework": "All", "principles": [ "CODE_QUALITY", "MAINTAINABILITY" ] }, "C060": { "name": "Do not override superclass methods and ignore critical logic", "description": "Preserve important behavior or lifecycle logic defined in the superclass to ensure correctness and prevent silent errors.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Manual review" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C061": { "name": "Write unit tests for business logic", "description": "Ensure that core business flows are verifiable, help catch bugs early, avoid regressions, and increase system reliability.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Manual review" ], "framework": "All", "principles": [ "CODE_QUALITY", "TESTABILITY", "MAINTAINABILITY" ] }, "C062": { "name": "Interfaces or abstractions should not hold state", "description": "Keep interfaces focused on defining behavior, making them easier to mock, implement, and test.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Manual review" ], "framework": "All", "principles": [ "CODE_QUALITY", "DESIGN_PATTERNS" ] }, "C063": { "name": "Do not repeat the same test logic", "description": "Avoid duplication in tests, making them easier to maintain, read, and extend when business logic changes.", "category": "Common", "severity": "minor", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Manual review" ], "framework": "All", "principles": [ "CODE_QUALITY", "TESTABILITY", "MAINTAINABILITY" ] }, "C064": { "name": "Interfaces should expose only necessary behavior", "description": "Prevent leaking implementation details, improve encapsulation, and reduce coupling between modules.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Manual review" ], "framework": "All", "principles": [ "CODE_QUALITY", "DESIGN_PATTERNS" ] }, "C065": { "name": "Each test case should verify only one behavior", "description": "Make test failures easier to diagnose and ensure clarity and maintainability in test code.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Manual review" ], "framework": "All", "principles": [ "CODE_QUALITY", "TESTABILITY" ] }, "C066": { "name": "Test names should reflect what is being tested", "description": "Help readers quickly understand the purpose of a test, making the test suite self-documenting and easier to trace on failure.", "category": "Common", "severity": "minor", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Manual review" ], "framework": "All", "principles": [ "CODE_QUALITY", "TESTABILITY" ] }, "C067": { "name": "Do not hardcode configuration inside code", "description": "Improve configurability, reduce risk when changing environments, and make configuration management flexible and maintainable.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Manual review" ], "framework": "All", "principles": [ "CODE_QUALITY", "MAINTAINABILITY" ] }, "C068": { "name": "Avoid unclear return types in functions", "description": "Help callers know what data they receive, enable type checking, reduce hidden errors, and improve predictability.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Manual review" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C069": { "name": "Components should communicate via abstractions", "description": "Reduce module coupling, improve testability, ease mocking, and ensure replaceability without affecting callers.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Manual review" ], "framework": "All", "principles": [ "CODE_QUALITY", "DESIGN_PATTERNS", "TESTABILITY" ] }, "C070": { "name": "Tests should not rely on real time", "description": "Improve test stability and speed; avoid flaky tests caused by system clock or real-world timing.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Manual review" ], "framework": "All", "principles": [ "CODE_QUALITY", "TESTABILITY" ] }, "C071": { "name": "Test class names should reflect the corresponding module", "description": "Make it easy to identify the scope of testing, improve discoverability, and provide clear organization in the test structure.", "category": "Common", "severity": "minor", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Manual Review" ], "framework": "All", "principles": [ "CODE_QUALITY", "MAINTAINABILITY" ] }, "C072": { "name": "Each test should assert only one behavior", "description": "Reduce ambiguity when a test fails, ensuring each test case validates a single, specific logic path.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Manual Review" ], "framework": "All", "principles": [ "CODE_QUALITY", "TESTABILITY" ] }, "C073": { "name": "All required configurations must be validated at startup", "description": "Prevent unclear runtime errors due to missing or incorrect config. Ensure the app fails fast if essential settings are absent.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Manual Review" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C074": { "name": "Avoid magic numbers/values in code", "description": "Improve clarity and self-documentation in code, so readers can understand the meaning of values without additional context.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0.0", "status": "draft", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Linter (ESLint", "PMD", "Detekt", "etc.)" ], "framework": "All", "principles": [ "CODE_QUALITY", "MAINTAINABILITY" ] }, "C075": { "name": "All functions must explicitly declare return types", "description": "Improve clarity, predictability, and enforce strict type control to avoid silent errors during refactoring or logic changes.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Type checker", "Linter" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "C076": { "name": "All public functions must declare explicit types for arguments", "description": "Ensure type safety for function inputs, reduce runtime errors, and enable static analysis during compilation or code review.", "category": "Common", "severity": "major", "languages": [ "All languages" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "Type checker", "Linter" ], "framework": "All", "principles": [ "CODE_QUALITY", "MAINTAINABILITY" ] }, "D001": { "name": "Keep parameter names consistent when overriding methods", "description": "Maintain consistency between inherited classes", "category": "Common", "severity": "major", "languages": [ "dart" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "`dart lint` (`avoid_renaming_method_parameters`)" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "D002": { "name": "Avoid using single cascade (..) operators", "description": "Write clear, readable code", "category": "Common", "severity": "major", "languages": [ "dart" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "`dart lint` (`avoid_single_cascade_in_expression_statements`)" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "D003": { "name": "Avoid calling methods/accessing properties on dynamic types", "description": "Prevent runtime errors due to lack of type checking", "category": "Common", "severity": "critical", "languages": [ "dart" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "`dart lint` (`avoid_dynamic_calls`)" ], "framework": "All", "principles": [ "CODE_QUALITY", "SECURITY" ] }, "D004": { "name": "Use standard `package:` imports", "description": "Reduce confusion in imports", "category": "Common", "severity": "major", "languages": [ "dart" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "`dart lint` (`always_use_package_imports`)" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "D005": { "name": "Always declare function return types", "description": "Clarify logic and increase reliability in type checking", "category": "Common", "severity": "major", "languages": [ "dart" ], "version": "1.0", "status": "activated", "tags": [ "Common", "readability", "code-quality" ], "tools": [ "`dart lint` (`always_declare_return_types`)" ], "framework": "All", "principles": [ "CODE_QUALITY" ] }, "D006": { "name": "Do not override `==` and `hashCode` in mutable classes", "description": "Prevent logic errors when using mutable objects in collections.", "category": "Common", "severity": "critical", "languages": [ "dart" ], "version": "1.0", "status": "activated",