setono/code-quality-pack
Laravel-friendly code quality pack with ready-to-use tools and config for static analysis, coding standards, refactoring, and CI checks. Helps keep projects consistent and maintainable with minimal setup, ideal for teams and shared repositories.
php artisan make:model --plain), this package fills gaps in domain-specific quality (e.g., Eloquent query analysis, Blade template validation). Risk: Overlap with Laravel’s native tools (e.g., phpunit) may require custom configuration to avoid redundancy.HasFactory usage). Hooks into PHP’s Static Analysis API suggest low coupling with Laravel’s core.Illuminate\Database namespace whitelisting.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| False Positives | Medium | Run against a subset of legacy code first. |
| Performance Overhead | Low | Benchmark in CI (e.g., php -d memory_limit=-1). |
| Rule Conflicts | Medium | Use --ignore flags or fork rules. |
| Laravel-Specific Bugs | High | Test with Laravel’s framework/tests. |
Route::resource usage)?app/Providers)?composer require setono/code-quality-pack.app/Http/Controllers) with --dry-run..github/workflows/quality.yml:
- name: Code Quality
run: vendor/bin/code-quality-pack analyze --format=github
blade-compiler.bind()/singleton() may need namespace exclusions.spatie/laravel-permission) to avoid rule collisions.| Step | Priority | Dependencies |
|---|---|---|
| Install & Configure | High | Composer, PHP 8.2+ |
| Pilot Analysis | Medium | Existing test suite |
| CI/CD Hookup | High | GitHub/GitLab API access |
| Rule Customization | Low | Laravel-specific rule requirements |
| Documentation | Medium | Internal wiki for team onboarding |
composer.json to avoid unexpected rule changes:
"setono/code-quality-pack": "^1.0.0"
.code-quality-pack.json.--parallel flag or split by directory.php -d opcache.enable=1..code-quality-pack.local.json) for dev flexibility.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| CI Blockage | High (no deploys) | Use --allow-failures temporarily. |
| Rule Regression | Medium | Revert to last known good version. |
| False Positives in Prod | Critical | Exclude app/ from strict rules. |
| Maintenance Abandonment | Low | Fork and maintain internally. |
How can I help you explore Laravel packages today?