Skip to content

Mago 0.3.0

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 19 Jan 23:56
· 1 commit to main since this release
59a5cd5

✨ New Plugin: Maintainability

We’ve introduced the maintainability plugin to help you assess and improve the maintainability of your codebase. This plugin includes the following rules:

  • maintainability/cyclomatic-complexity: Detects functions or methods with high cyclomatic complexity, which can make code harder to understand and maintain.
  • maintainability/excessive-parameter-list: Flags methods or functions with too many parameters.
  • maintainability/halstead: Analyzes Halstead complexity metrics for better insight into code readability and maintainability.
  • maintainability/kan-defect: Estimates defect density using the Kan model for defect prediction.
  • maintainability/too-many-enum-cases: Highlights enums with an excessive number of cases.
  • maintainability/too-many-methods: Detects classes with too many methods, indicating potential refactoring opportunities.
  • maintainability/too-many-properties: Flags classes with an excessive number of properties.

You can learn more about each rule and its configuration by using the mago lint --explain command. For example:

mago lint --explain maintainability/too-many-methods

🛠 Improved Linter Output: --sort Flag

The mago lint command now supports a --sort flag, which organizes issues in the output by:

  • Severity level (e.g., errors, warnings).
  • Issue code.
  • Source location.

This ensures consistent output across runs, making it easier to track and prioritize fixes, especially when dealing with recurring issues or focusing on resolving errors first.


This release focuses on maintainability and usability improvements, further empowering you to write cleaner, more maintainable PHP code.