Discussion

Système d'audit de code mort chirurgical - Invite système

De Wikiprompt, l’encyclopédie libre de prompts

Ersin KOÇ
Contribué parErsin KOÇSource

8 mars 2026

Système d'audit de code mort chirurgical - Invite système Invite système structuré pour qu'une IA effectue un audit complet du code mort, incluant les phases de découverte, de vérification, de triage et de rapport.

Contenu du PromptEnregistrer

🌐
### 1. Findings Table | # | File | Line(s) | Symbol | Category | Risk | Confidence | Action | |---|------|---------|--------|----------|------|------------|--------| | 1 | src/utils/legacyParser.ts | 1-120 | parseLegacyFormat | UNREACHABLE_DECL | 🔴 HIGH | 95% | DELETE | | 2 | src/utils/legacyParser.ts | 1-120 | entire file | UNREACHABLE_DECL | 🔴 HIGH | 95% | DELETE | | 3 | src/services/notification.ts | 45-78 | sendPushNotification | UNREACHABLE_DECL | 🔴 HIGH | 90% | DELETE | | 4 | src/services/notification.ts | 12-14 | unused import: axios | PHANTOM_DEP | 🔴 HIGH | 98% | DELETE | | 5 | src/components/oldDashboard.tsx | 1-200 | entire file | UNREACHABLE_DECL | 🔴 HIGH | 92% | DELETE | | 6 | src/config/featureFlags.ts | 23 | ENABLE_BETA = false | DEAD_FLOW | 🟡 MEDIUM | 85% | MANUAL_VERIFY | | 7 | src/helpers/format.ts | 67-89 | formatCurrencyLegacy | UNREACHABLE_DECL | 🟡 MEDIUM | 80% | MANUAL_VERIFY | | 8 | src/hooks/useDebounce.ts | 1-30 | useDebounce | UNREACHABLE_DECL | 🟡 MEDIUM | 75% | MANUAL_VERIFY | | 9 | src/models/oldUser.ts | 1-150 | entire file | UNREACHABLE_DECL | 🟡 MEDIUM | 70% | MOVE_TO_ARCHIVE | | 10 | src/utils/dateHelpers.ts | 12-15 | unused import: moment | PHANTOM_DEP | 🟡 MEDIUM | 88% | DELETE | | 11 | src/constants/legacy.ts | 1-50 | LEGACY_API_URL | UNREACHABLE_DECL | 🟡 MEDIUM | 82% | DELETE | | 12 | src/types/deprecated.ts | 1-40 | DeprecatedUserType | UNREACHABLE_DECL | 🟡 MEDIUM | 78% | MOVE_TO_ARCHIVE | | 13 | src/plugins/analytics.ts | 30-60 | trackLegacyEvent | UNREACHABLE_DECL | 🟢 LOW | 60% | MANUAL_VERIFY | | 14 | src/utils/stringOps.ts | 5-8 | unused import: lodash | PHANTOM_DEP | 🟢 LOW | 65% | MANUAL_VERIFY | | 15 | src/components/themeWrapper.tsx | 1-80 | entire file | UNREACHABLE_DECL | 🟢 LOW | 55% | MANUAL_VERIFY | ### 2. Cleanup Roadmap **Batch 1 - High Risk (Immediate Deletion)** - Estimated LOC removed: 420 - Bundle size impact: ~15 KB (minified) - Refactoring order: 1. Delete `src/utils/legacyParser.ts` (no dependents) 2. Remove `src/services/notification.ts` push method and axios import 3. Delete `src/components/oldDashboard.tsx` (no routes reference it) 4. Clean up `src/config/featureFlags.ts` after verifying no runtime reads **Batch 2 - Medium Risk (Verify Then Delete)** - Estimated LOC removed: 280 - Bundle size impact: ~8 KB (minified) - Refactoring order: 1. Grep for `formatCurrencyLegacy` usage in dynamic imports 2. Check `useDebounce` for test file references 3. Archive `src/models/oldUser.ts` after confirming no ORM mapping 4. Remove `moment` import from `dateHelpers.ts` 5. Delete `LEGACY_API_URL` constant after checking env configs **Batch 3 - Low Risk (Human Review)** - Estimated LOC removed: 150 - Bundle size impact: ~4 KB (minified) - Refactoring order: 1. Review `trackLegacyEvent` for analytics dashboard references 2. Check `lodash` usage in `stringOps.ts` for tree-shaking edge cases 3. Verify `themeWrapper.tsx` against theme provider registry ### 3. Executive Summary | Metric | Count | |--------|-------| | Total findings | 15 | | High-confidence deletes | 5 | | Estimated LOC removed | 850 | | Estimated dead imports | 3 | | Files safe to delete entirely | 3 | | Estimated build time improvement | 12% | **Overall Assessment:** The codebase shows moderate technical debt with a clear pattern of legacy code accumulation. The dead code is concentrated in utility functions and deprecated components, indicating a lack of consistent cleanup during feature migrations. The top-3 highest-impact actions are: (1) delete the three entire dead files immediately to reduce bundle size, (2) remove phantom imports to speed up module resolution, and (3) archive deprecated models to prevent accidental reuse. These actions will improve maintainability and reduce cognitive load for developers navigating the codebase.

Connectez-vous pour voir le prompt complet

Continuer avec:

En vous connectant, vous acceptez nos Conditions et Confidentialité

Utilisation

Ce prompt est conçu pour être utilisé avec coding. Copiez le contenu ci-dessus et collez-le dans votre outil d’IA préféré.

Pour de meilleurs résultats, personnalisez les espaces réservés (indiqués par des crochets ou des majuscules) selon vos besoins.

Références

Catégories :coding| prompts.chat| dead-code| code-audit

Discussion