Perform comprehensive code quality analysis on the ExFabrica Agentic Factory codebase, including linting, type checking, test coverage analysis, and security vulnerability scanning.
Run comprehensive code quality analysis including linting, type checking, test coverage, and security scanning on your ExFabrica Agentic Factory codebase. Use it before commits or CI/CD to catch issues early, with options to analyze specific workspaces, auto-fix problems, or generate detailed reports.
/plugin marketplace add hubexab/EAF-PluginClaude/plugin install exfabrica-af-plugin@exfabrica-af-marketplacePerform comprehensive code quality analysis on the ExFabrica Agentic Factory codebase, including linting, type checking, test coverage analysis, and security vulnerability scanning.
/analyze-code [workspace] [--fix] [--strict] [--report]
backend - Analyze backend application onlyfrontend - Analyze frontend application onlyapi-client - Analyze shared API client libraryChecks
Configuration
apps/backend/.eslintrc.jsapps/frontend/.eslintrc.json.eslintrc.jsonChecks
Configuration
apps/backend/tsconfig.jsonapps/frontend/tsconfig.app.jsontsconfig.base.jsonMetrics
Thresholds
Checks
yarn audit)Metrics
Checks
When you execute this command, Claude will:
Preparation
Linting Analysis
--fix flag is usedType Checking
any types in strict modeCoverage Analysis
Security Scanning
yarn audit to check for vulnerabilitiesComplexity Analysis
Report Generation
/analyze-code
Runs all analysis checks on the complete codebase.
/analyze-code backend
Focuses analysis on the NestJS backend application.
/analyze-code frontend
Focuses analysis on the Angular frontend application.
/analyze-code --fix
Automatically fixes ESLint and formatting issues.
/analyze-code --strict --report
Runs strict analysis and generates detailed HTML report.
/analyze-code backend --fix
Auto-fixes linting issues in backend code.
Code Quality Analysis Report
============================
Workspace: All
Analyzed Files: 342
Duration: 1m 47s
š LINTING (ESLint)
ā Backend: 0 errors, 3 warnings
ā Frontend: 2 errors, 7 warnings
ā¹ API Client: 0 errors, 1 warning
š TYPE CHECKING (TypeScript)
ā Backend: 0 errors
ā Frontend: 0 errors
ā API Client: 0 errors
š TEST COVERAGE
ā Backend: 82.5% (above 80% threshold)
ā Frontend: 73.2% (below 75% threshold)
ā API Client: 88.1% (above 80% threshold)
š SECURITY
ā 3 moderate vulnerabilities found
ā¹ 12 low severity issues
Recommendation: Run 'yarn audit fix'
š COMPLEXITY
ā 5 functions with high complexity (>10)
ā¹ 3 files with code duplication
Recommendation: Refactor complex functions
š¦ DEPENDENCIES
ā All dependencies up to date
ā¹ 2 unused dependencies detected
Overall Grade: B (Good)
Recommendations: Fix frontend linting errors, improve frontend test coverage
ā ERRORS (2)
apps/frontend/src/app/components/user-profile/user-profile.component.ts:45:7
error 'userId' is declared but never used @typescript-eslint/no-unused-vars
apps/frontend/src/app/services/data.service.ts:128:5
error Missing return type on function @typescript-eslint/explicit-function-return-type
ā ļø WARNINGS (11)
apps/backend/src/users/users.service.ts:67:3
warning Function 'processUserData' has complexity of 12 complexity
[... additional warnings ...]
Error-Level Rules
no-unused-vars - No unused variablesno-console - No console.log in production code@typescript-eslint/no-explicit-any - Avoid using any type@typescript-eslint/explicit-function-return-type - Explicit return typesWarning-Level Rules
complexity - Cyclomatic complexity > 10max-lines-per-function - Functions > 50 linesno-duplicate-imports - Duplicate import statementsWhen using --strict, additional checks are enabled:
strictNullChecks - Strict null checkingstrictFunctionTypes - Strict function typesnoImplicitAny - No implicit any typesnoImplicitThis - No implicit thisalwaysStrict - Parse in strict modeCritical Issues
Warning Issues
When using --report, generates detailed HTML reports in:
reports/code-analysis/index.html - Main reportreports/code-analysis/coverage/ - Coverage reportsreports/code-analysis/linting/ - ESLint reportsreports/code-analysis/complexity/ - Complexity metricsOpen in browser for interactive exploration.
Error: Cannot find ESLint configuration
Solution: Ensure .eslintrc.js or .eslintrc.json exists in workspace
Error: Type errors in node_modules/@types/...
Solution: Update @types packages or exclude from type checking
yarn upgrade @types/node @types/jest
Warning: No coverage data found
Solution: Run tests with coverage first
/test-all --coverage
Error: JavaScript heap out of memory
Solution: Increase Node.js memory
export NODE_OPTIONS="--max-old-space-size=4096"
The --fix flag can automatically resolve:
Fixable Issues
Not Auto-Fixable
- task: Script@1
displayName: 'Code Quality Analysis'
inputs:
script: |
/analyze-code --strict --report
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage/cobertura-coverage.xml'
Fail the build if:
Analyze before committing
/analyze-code --fix
Run strict analysis before merging to main
/analyze-code --strict
Review HTML report for complex issues
/analyze-code --report
Fix errors immediately, schedule warnings
Monitor trends over time
any types/test-all --coverage - Run tests and generate coverage/deploy - Deploy only after passing analysis/generate-api-client - Update API client after backend changesNote: This command integrates with pre-commit hooks to ensure code quality before commits. Configure in config/hooks.json to run automatically.