Initial commit
This commit is contained in:
117
skills/analysis/codebase-auditor/examples/sample_report.md
Normal file
117
skills/analysis/codebase-auditor/examples/sample_report.md
Normal file
@@ -0,0 +1,117 @@
|
||||
# Codebase Audit Report
|
||||
|
||||
**Generated**: 2024-10-21 14:30:00
|
||||
**Codebase**: `/Users/connor/projects/example-app`
|
||||
**Tech Stack**: javascript, typescript, react, node
|
||||
**Total Files**: 342
|
||||
**Lines of Code**: 15,420
|
||||
|
||||
---
|
||||
|
||||
## Executive Summary
|
||||
|
||||
### Overall Health Score: **72/100**
|
||||
|
||||
#### Category Scores
|
||||
|
||||
- **Quality**: 68/100 ⚠️
|
||||
- **Testing**: 65/100 ⚠️
|
||||
- **Security**: 85/100 ✅
|
||||
- **Technical Debt**: 70/100 ⚠️
|
||||
|
||||
#### Issue Summary
|
||||
|
||||
- **Critical Issues**: 2
|
||||
- **High Issues**: 8
|
||||
- **Total Issues**: 47
|
||||
|
||||
---
|
||||
|
||||
## Detailed Findings
|
||||
|
||||
### 🚨 CRITICAL (2 issues)
|
||||
|
||||
#### Potential API key found in code
|
||||
|
||||
**Category**: Security
|
||||
**Subcategory**: secrets
|
||||
**Location**: `src/utils/api.ts:12`
|
||||
|
||||
Found potential secret on line 12
|
||||
|
||||
```typescript
|
||||
const API_KEY = "sk_live_1234567890abcdef1234567890abcdef";
|
||||
```
|
||||
|
||||
**Impact**: Exposed secrets can lead to unauthorized access and data breaches
|
||||
|
||||
**Remediation**: Remove secret from code and use environment variables or secret management tools
|
||||
|
||||
**Effort**: LOW
|
||||
|
||||
---
|
||||
|
||||
#### Use of eval() is dangerous
|
||||
|
||||
**Category**: Security
|
||||
**Subcategory**: code_security
|
||||
**Location**: `src/legacy/parser.js:45`
|
||||
|
||||
Found on line 45
|
||||
|
||||
```javascript
|
||||
const result = eval(userInput);
|
||||
```
|
||||
|
||||
**Impact**: eval() can execute arbitrary code and is a security risk
|
||||
|
||||
**Remediation**: Refactor to avoid eval(), use safer alternatives like Function constructor with specific scope
|
||||
|
||||
**Effort**: MEDIUM
|
||||
|
||||
---
|
||||
|
||||
### ⚠️ HIGH (8 issues)
|
||||
|
||||
#### High cyclomatic complexity (28)
|
||||
|
||||
**Category**: Code Quality
|
||||
**Subcategory**: complexity
|
||||
**Location**: `src/services/checkout.ts:156`
|
||||
|
||||
Function has complexity of 28
|
||||
|
||||
**Impact**: High complexity makes code difficult to understand, test, and maintain
|
||||
|
||||
**Remediation**: Refactor into smaller functions, extract complex conditions
|
||||
|
||||
**Effort**: HIGH
|
||||
|
||||
---
|
||||
|
||||
#### Line coverage below target (65.3%)
|
||||
|
||||
**Category**: Testing
|
||||
**Subcategory**: test_coverage
|
||||
**Location**: `coverage/coverage-summary.json`
|
||||
|
||||
Current coverage is 65.3%, target is 80%
|
||||
|
||||
**Impact**: Low coverage means untested code paths and higher bug risk
|
||||
|
||||
**Remediation**: Add tests to increase coverage by 14.7%
|
||||
|
||||
**Effort**: HIGH
|
||||
|
||||
---
|
||||
|
||||
## Recommendations
|
||||
|
||||
1. **Immediate Action Required**: Address all 2 critical security and quality issues before deploying to production.
|
||||
2. **Sprint Focus**: Prioritize fixing the 8 high-severity issues in the next sprint. These significantly impact code quality and maintainability.
|
||||
3. **Testing Improvements**: Increase test coverage to meet the 80% minimum threshold. Focus on critical paths first (authentication, payment, data processing).
|
||||
4. **Security Review**: Conduct a thorough security review and penetration testing given the security issues found.
|
||||
|
||||
---
|
||||
|
||||
*Report generated by Codebase Auditor Skill (2024-25 Standards)*
|
||||
Reference in New Issue
Block a user