npx claudepluginhub koriym/pasta-lunchDetect spaghetti code using PHPMD metrics. Measures CBO, CC, NPath to identify refactoring targets.
PHP Alert for Spaghetti Twisted Architecture
Order your code quality check - from Piccolo to Mamma Mia!
Detect spaghetti code using PHPMD metrics.
PASTA focuses on tangled, complex code - the kind that's hard to test, hard to change, and hard to understand. These issues aren't caught by type checkers like PHPStan or Psalm, yet they're often what kills project sustainability over time.
Unlike general code quality tools, it specifically targets metrics that indicate code entanglement: cyclomatic complexity, coupling, and structural bloat.
/plugin marketplace add koriym/pasta-lunch
/plugin install pasta-lunch@pasta-lunch
composer require --dev koriym/pasta-lunch
# Via composer script (default target: src)
composer pasta
composer pasta:html > report.html
# Direct execution
./vendor/bin/pasta
./vendor/bin/pasta --format=md > report.md
./vendor/bin/pasta --format=html > report.html
# Custom exclude patterns (default: *Module.php)
./vendor/bin/pasta src --exclude="*Module.php,*Test.php"
# No exclusions
./vendor/bin/pasta src --no-exclude
Add to your project's composer.json:
{
"scripts": {
"pasta": "bin/pasta src",
"pasta:html": "bin/pasta src --format=html"
}
}
Usage:
composer pasta
composer pasta:html > report.html
| Level | Meaning | |
|---|---|---|
| ๐ | Piccolo | Clean code |
| ๐๐ | Medio | Acceptable |
| ๐๐๐ | Grande | Refactoring required |
| ๐๐๐๐ | Mamma Mia! | Unmaintainable |
See Sample Report for an example HTML output.
| Metric | Piccolo | Medio | Grande | Mamma Mia! |
|---|---|---|---|---|
| CyclomaticComplexity (CC) | โค10 | 11-15 | 16-20 | 21+ |
| NPathComplexity | โค100 | 101-200 | 201-500 | 501+ |
| CouplingBetweenObjects (CBO) | โค10 | 11-15 | 16-20 | 21+ |
| ExcessiveClassComplexity (ECC) | โค50 | 51-80 | 81-120 | 121+ |
| ExcessiveMethodLength | โค50 | 51-100 | 101-150 | 151+ |
| ExcessiveParameterList | โค5 | 6-10 | 11-15 | 16+ |
| TooManyFields | โค10 | 11-15 | 16-20 | 21+ |
| TooManyPublicMethods | โค10 | 11-15 | 16-20 | 21+ |
See Issue Types for detailed documentation.
PASTA thresholds are designed around clean code ideals, not just "acceptable" levels. PHPMD defaults represent the point where "measures should be taken" - meaning code at those thresholds already needs attention.
| Metric | PHPMD Default | PASTA Piccolo | Rationale |
|---|---|---|---|
| NPath | 200 | โค100 | 200 paths exceeds human cognitive capacity |
| CBO | 13 | โค10 | Proper DI keeps coupling under 10 |
| MethodLength | 100 | โค50 | Modern standards favor 30-50 lines |
7-day visitors to each marketplace page
Anthropic's Claude Code plugins, installed from the claude-plugins-official repository
Official marketplace for gstack โ AI engineering workflow skills, code review, QA browser automation, and shipping tools for Claude Code.
Storybook plugins for Claude Code.