수술적 죽은 코드 감사 시스템 프롬프트
Wikiprompt, 무료 프롬프트 백과사전에서
수술적 죽은 코드 감사 시스템 프롬프트 AI가 포괄적인 죽은 코드 감사를 수행하기 위한 구조화된 시스템 프롬프트로, 발견, 검증, 분류, 보고 단계를 포함합니다.
프롬프트 내용저장
🌐
### 1. Findings Table
| # | File | Line(s) | Symbol | Category | Risk | Confidence | Action |
|---|------|---------|--------|----------|------|------------|--------|
| 1 | src/utils/legacy-parser.js | 1-120 | parseLegacyFormat() | UNREACHABLE_DECL | 🔴 HIGH | 95% | DELETE |
| 2 | src/utils/legacy-parser.js | 1-120 | entire file | UNREACHABLE_DECL | 🔴 HIGH | 95% | DELETE |
| 3 | src/config/feature-flags.js | 14 | ENABLE_NEW_AUTH | DEAD_FLOW | 🔴 HIGH | 90% | DELETE |
| 4 | src/services/auth.service.ts | 88-92 | oldAuthFallback() | DEAD_FLOW | 🔴 HIGH | 92% | DELETE |
| 5 | src/models/user.model.ts | 210-215 | legacyRoleField | UNREACHABLE_DECL | 🟡 MEDIUM | 70% | MANUAL_VERIFY |
| 6 | src/controllers/order.controller.ts | 45-48 | unusedImport: OrderValidator | PHANTOM_DEP | 🔴 HIGH | 98% | DELETE |
| 7 | src/utils/helpers.ts | 67-70 | formatCurrencyLegacy() | UNREACHABLE_DECL | 🟡 MEDIUM | 75% | MANUAL_VERIFY |
| 8 | src/db/migrations/2023-01-01-initial.js | 1-300 | entire migration file | UNREACHABLE_DECL | 🟢 LOW | 40% | MOVE_TO_ARCHIVE |
| 9 | src/middleware/rate-limiter.ts | 22-25 | unusedImport: RedisClient | PHANTOM_DEP | 🔴 HIGH | 97% | DELETE |
| 10 | src/utils/string-utils.ts | 112-118 | slugifyLegacy() | UNREACHABLE_DECL | 🟡 MEDIUM | 65% | MANUAL_VERIFY |
| 11 | src/services/notification.service.ts | 156-160 | sendSmsFallback() | DEAD_FLOW | 🟡 MEDIUM | 72% | MANUAL_VERIFY |
| 12 | src/constants/app.constants.ts | 45-47 | DEFAULT_PAGE_SIZE_LEGACY | UNREACHABLE_DECL | 🔴 HIGH | 94% | DELETE |
| 13 | src/api/routes/v1/old-endpoints.ts | 1-180 | entire route file | UNREACHABLE_DECL | 🔴 HIGH | 91% | DELETE |
| 14 | src/utils/date-utils.ts | 89-92 | unusedImport: moment | PHANTOM_DEP | 🔴 HIGH | 96% | DELETE |
| 15 | src/models/audit.model.ts | 34-38 | legacyAuditType | UNREACHABLE_DECL | 🟢 LOW | 45% | MANUAL_VERIFY |
### 2. Cleanup Roadmap
**Batch 1 - 🔴 HIGH (Immediate Deletion)**
- Files to touch first: `src/utils/legacy-parser.js`, `src/api/routes/v1/old-endpoints.ts`
- Estimated LOC removed: 1,250
- Bundle size impact: ~8KB reduction (legacy parser + old routes)
- Refactoring order:
1. Remove `legacy-parser.js` and its imports
2. Delete `old-endpoints.ts` route file
3. Remove `ENABLE_NEW_AUTH` flag and `oldAuthFallback()`
4. Clean up unused imports in controllers and middleware
5. Remove legacy constants
**Batch 2 - 🟡 MEDIUM (Verify Then Delete)**
- Files to touch: `src/models/user.model.ts`, `src/utils/helpers.ts`, `src/utils/string-utils.ts`, `src/services/notification.service.ts`
- Estimated LOC removed: 320
- Bundle size impact: ~2KB reduction
- Refactoring order:
1. Run grep across entire codebase for each symbol
2. Check test files for references
3. Verify no dynamic dispatch or reflection usage
4. Delete after confirmation
**Batch 3 - 🟢 LOW (Archive / Manual Review)**
- Files to touch: `src/db/migrations/`, `src/models/audit.model.ts`
- Estimated LOC removed: 450 (moved to archive)
- Bundle size impact: none (not in production path)
- Refactoring order:
1. Move old migration to `archive/` directory
2. Review audit model with team for any hidden serialization usage
3. Document decision in code review
### 3. Executive Summary
| Metric | Count |
|--------|-------|
| Total findings | 15 |
| High-confidence deletes | 8 |
| Estimated LOC removed | 2,020 |
| Estimated dead imports | 3 |
| Files safe to delete entirely | 2 |
| Estimated build time improvement | 12-15% |
The codebase shows signs of healthy evolution but has accumulated significant technical debt through incomplete refactoring. The presence of legacy parsers, old API routes, and hardcoded feature flags indicates past migration efforts that weren't fully cleaned up. The top-3 highest-impact actions are: (1) delete the legacy parser and old API routes immediately - this alone removes 1,300 lines of dead code, (2) remove the hardcoded auth feature flag and its fallback path to simplify the authentication flow, and (3) conduct a systematic grep-based audit of all `legacy`-prefixed symbols to catch any remaining dead code. The overall codebase health is moderate - the core architecture is sound, but the accumulation of dead code increases maintenance burden and cognitive load for developers.
전체 프롬프트를 보려면 로그인하세요
Continue with:
By logging in, you agree to our Terms of Use and Privacy Policy
사용법
이 프롬프트는 coding와 함께 사용하도록 설계되었습니다. 위의 프롬프트 내용을 복사하여 원하는 AI 도구에 붙여넣으세요.
최상의 결과를 얻으려면 자리 표시자(대괄호 또는 대문자로 표시)를 특정 요구 사항으로 사용자 지정할 수 있습니다.
토론
댓글 0개