AI-assisted code quality analysis tool for PIE Framework elements. This tool helps identify deprecated patterns, risky code, and refactoring opportunities across all PIE packages.
- 🔍 Deprecated Pattern Detection: Identifies outdated APIs, libraries, and patterns
⚠️ Risk Analysis: Finds potentially problematic code patterns- 🔄 Refactoring Suggestions: AI-powered recommendations for code improvements
- ✨ Code Quality Checks: Detects magic numbers, TODO comments, naming inconsistencies, and more
- 📊 Health Reports: Generates detailed reports for each package
- 🎯 Package-specific Analysis: Analyze individual packages or all packages
- 🔄 Dependency Analysis: Maps dependencies and detects circular dependencies
- 📈 Dependency Graphs: Visualizes import/export relationships
cd tools/pie-code-health
npm installnpm run scannpm run scan:package -- --package=graphingnpm run reportnpm run deprecatednpm run risksnpm run dependencies- Outdated React patterns (componentWillMount, etc.)
- Legacy lifecycle methods
- Deprecated prop-types usage
- Old testing utilities
- Deprecated dependencies
- Unsafe DOM manipulation
- Missing error boundaries
- Unhandled promises
- Security vulnerabilities
- Performance anti-patterns
- Component decomposition suggestions
- State management improvements
- Code duplication
- Complex functions that need splitting
- Type safety improvements
- Circular dependencies between files
- Files with too many dependencies (complexity)
- Orphaned files (no imports/exports)
- Magic numbers: Hardcoded numbers without named constants
- Technical debt: TODO, FIXME, HACK comments
- Non-strict equality: Using
==instead of=== - Inconsistent naming: Mixing camelCase and snake_case
Results are saved to reports/ directory:
reports/summary.json- Overall health summaryreports/deprecated.json- Deprecated patterns foundreports/risks.json- Risk analysis resultsreports/complexity.json- Complexity analysisreports/data.json- Complete scan resultsreports/dashboard.html- Interactive dashboardreports/index.html- Static HTML reportreports/package-reports/- Individual package reports
Interactive Dashboard (Recommended):
npm run serveThen open http://localhost:8080 in your browser.
The dashboard provides:
- Overview of all issues by severity
- Interactive charts and visualizations
- Package-level detail views
- Filtering and search capabilities
- Issue categorization
Static HTML Report:
Open reports/index.html directly in your browser (no server needed).
Edit config.json to customize:
- Patterns to detect
- Severity levels
- Ignored files/patterns
- Report format
# Quick health check
npm start
# Deep analysis of graphing package
npm run scan:package -- --package=graphing --deep
# Generate HTML report
npm run report -- --format=htmlThis tool is designed to work with AI assistants (like GitHub Copilot) to:
- Identify patterns that need attention
- Suggest modern replacements
- Generate refactoring plans
- Provide context-aware recommendations
Add new analyzers in src/analyzers/ following the existing patterns.