ノート

外科的デッドコード監査システムプロンプト

フリーのプロンプト百科事典 Wikiprompt より

Ersin KOÇ

2026年3月8日

外科的デッドコード監査システムプロンプト AIが包括的なデッドコード監査を実行するための構造化システムプロンプト。発見、検証、トリアージ、報告の各フェーズを含む。

プロンプト内容保存

🌐
### 1. Findings Table | # | File | Line(s) | Symbol | Category | Risk | Confidence | Action | |---|------|---------|--------|----------|------|------------|--------| | 1 | src/utils/legacyParser.js | 1-120 | parseLegacyFormat | UNREACHABLE_DECL | 🔴 | 95% | DELETE | | 2 | src/utils/legacyParser.js | 122-150 | legacyTokenMap | UNREACHABLE_DECL | 🔴 | 95% | DELETE | | 3 | src/services/analytics.js | 45-78 | trackLegacyEvent | UNREACHABLE_DECL | 🔴 | 90% | DELETE | | 4 | src/services/analytics.js | 12 | import { trackLegacyEvent } | PHANTOM_DEP | 🔴 | 90% | DELETE | | 5 | src/components/oldModal.js | 1-200 | OldModal | UNREACHABLE_DECL | 🔴 | 85% | DELETE | | 6 | src/components/oldModal.js | 1-200 | (entire file) | UNREACHABLE_DECL | 🔴 | 85% | DELETE | | 7 | src/config/featureFlags.js | 34 | ENABLE_NEW_UI: true | DEAD_FLOW | 🟡 | 80% | MANUAL_VERIFY | | 8 | src/config/featureFlags.js | 35 | ENABLE_LEGACY_AUTH: false | DEAD_FLOW | 🟡 | 80% | MANUAL_VERIFY | | 9 | src/utils/format.js | 88-95 | formatLegacyDate | UNREACHABLE_DECL | 🟡 | 70% | MANUAL_VERIFY | | 10 | src/utils/format.js | 12 | import { formatLegacyDate } | PHANTOM_DEP | 🟡 | 70% | MANUAL_VERIFY | | 11 | src/hooks/useOldApi.js | 1-80 | useOldApi | UNREACHABLE_DECL | 🟡 | 75% | MANUAL_VERIFY | | 12 | src/hooks/useOldApi.js | 1-80 | (entire file) | UNREACHABLE_DECL | 🟡 | 75% | MANUAL_VERIFY | | 13 | src/models/User.js | 45-60 | legacyPasswordHash | UNREACHABLE_DECL | 🟡 | 60% | MANUAL_VERIFY | | 14 | src/models/User.js | 45-60 | legacyPasswordSalt | UNREACHABLE_DECL | 🟡 | 60% | MANUAL_VERIFY | | 15 | src/utils/constants.js | 23-25 | MAX_RETRY_OLD | UNREACHABLE_DECL | 🟢 | 40% | SUPPRESS_WITH_COMMENT | | 16 | src/utils/constants.js | 27-29 | DEFAULT_TIMEOUT_OLD | UNREACHABLE_DECL | 🟢 | 40% | SUPPRESS_WITH_COMMENT | | 17 | src/api/client.js | 15 | import { legacyInterceptor } | PHANTOM_DEP | 🟢 | 50% | MANUAL_VERIFY | | 18 | src/api/client.js | 15 | legacyInterceptor | UNREACHABLE_DECL | 🟢 | 50% | MANUAL_VERIFY | | 19 | src/utils/helpers.js | 100-115 | debounceLegacy | UNREACHABLE_DECL | 🟢 | 30% | SUPPRESS_WITH_COMMENT | | 20 | src/utils/helpers.js | 100-115 | throttleLegacy | UNREACHABLE_DECL | 🟢 | 30% | SUPPRESS_WITH_COMMENT | | 21 | src/components/Header.js | 55-60 | legacyNavItems | UNREACHABLE_DECL | 🟢 | 35% | SUPPRESS_WITH_COMMENT | | 22 | src/components/Header.js | 55-60 | legacyNavItems | DEAD_FLOW | 🟢 | 35% | SUPPRESS_WITH_COMMENT | | 23 | src/utils/logger.js | 40-45 | logLegacyWarning | UNREACHABLE_DECL | 🟢 | 45% | MANUAL_VERIFY | | 24 | src/utils/logger.js | 40-45 | logLegacyError | UNREACHABLE_DECL | 🟢 | 45% | MANUAL_VERIFY | | 25 | src/services/cache.js | 30-35 | legacyCacheKey | UNREACHABLE_DECL | 🟢 | 40% | SUPPRESS_WITH_COMMENT | | 26 | src/services/cache.js | 30-35 | legacyCacheKey | DEAD_FLOW | 🟢 | 40% | SUPPRESS_WITH_COMMENT | | 27 | src/utils/validation.js | 70-75 | validateLegacyEmail | UNREACHABLE_DECL | 🟢 | 30% | SUPPRESS_WITH_COMMENT | | 28 | src/utils/validation.js | 70-75 | validateLegacyEmail | DEAD_FLOW | 🟢 | 30% | SUPPRESS_WITH_COMMENT | | 29 | src/api/endpoints.js | 10-12 | legacyEndpoint | UNREACHABLE_DECL | 🟢 | 40% | SUPPRESS_WITH_COMMENT | | 30 | src/api/endpoints.js | 10-12 | legacyEndpoint | DEAD_FLOW | 🟢 | 40% | SUPPRESS_WITH_COMMENT | | 31 | src/utils/date.js | 50-55 | formatLegacyTimestamp | UNREACHABLE_DECL | 🟢 | 30% | SUPPRESS_WITH_COMMENT | | 32 | src/utils/date.js | 50-55 | formatLegacyTimestamp | DEAD_FLOW | 🟢 | 30% | SUPPRESS_WITH_COMMENT | | 33 | src/components/Footer.js | 20-25 | legacyFooterLinks | UNREACHABLE_DECL | 🟢 | 35% | SUPPRESS_WITH_COMMENT | | 34 | src/components/Footer.js | 20-25 | legacyFooterLinks | DEAD_FLOW | 🟢 | 35% | SUPPRESS_WITH_COMMENT | | 35 | src/utils/string.js | 60-65 | legacyTrim | UNREACHABLE_DECL | 🟢 | 25% | SUPPRESS_WITH_COMMENT | | 36 | src/utils/string.js | 60-65 | legacyTrim | DEAD_FLOW | 🟢 | 25% | SUPPRESS_WITH_COMMENT | | 37 | src/utils/array.js | 40-45 | legacyFlatten | UNREACHABLE_DECL | 🟢 | 25% | SUPPRESS_WITH_COMMENT | | 38 | src/utils/array.js | 40-45 | legacyFlatten | DEAD_FLOW | 🟢 | 25% | SUPPRESS_WITH_COMMENT | | 39 | src/utils/object.js | 30-35 | legacyMerge | UNREACHABLE_DECL | 🟢 | 25% | SUPPRESS_WITH_COMMENT | | 40 | src/utils/object.js | 30-35 | legacyMerge | DEAD_FLOW | 🟢 | 25% | SUPPRESS_WITH_COMMENT | | 41 | src/utils/number.js | 20-25 | legacyRound | UNREACHABLE_DECL | 🟢 | 25% | SUPPRESS_WITH_COMMENT | | 42 | src/utils/number.js | 20-25 | legacyRound | DEAD_FLOW | 🟢 | 25% | SUPPRESS_WITH_COMMENT | | 43 | src/utils/async.js | 30-35 | legacyRetry | UNREACHABLE_DECL | 🟢 | 25% | SUPPRESS_WITH_COMMENT | | 44 | src/utils/async.js | 30-35 | legacyRetry | DEAD_FLOW | 🟢 | 25% | SUPPRESS_WITH_COMMENT | | 45 | src/utils/promise.js | 20-25 | legacyAll | UNREACHABLE_DECL | 🟢 | 25% | SUPPRESS_WITH_COMMENT | | 46 | src/utils/promise.js | 20-25 | legacyAll | DEAD_FLOW | 🟢 | 25% | SUPPRESS_WITH_COMMENT | | 47 | src/utils/event.js | 15-20 | legacyEmit | UNREACHABLE_DECL | 🟢 | 25% | SUPPRESS_WITH_COMMENT | | 48 | src/utils/event.js | 15-20 | legacyEmit | DEAD_FLOW | 🟢 | 25% | SUPPRESS_WITH_COMMENT | | 49 | src/utils/error.js | 10-15 | legacyErrorHandler | UNREACHABLE_DECL | 🟢 | 25% | SUPPRESS_WITH_COMMENT | | 50 | src/utils/error.js | 10-15 | legacyErrorHandler | DEAD_FLOW | 🟢 | 25% | SUPPRESS_WITH_COMMENT | ### 2. Cleanup Roadmap **Batch 1 - High Risk (🔴)** - **Estimated LOC removed**: 420 - **Potential bundle / binary size impact**: ~15KB (gzipped) - **Suggested refactoring order**: 1. Delete `src/utils/legacyParser.js` (entire file) 2. Delete `src/components/oldModal.js` (entire file) 3. Remove `trackLegacyEvent` from `src/services/analytics.js` and its import 4. Run full test suite to confirm no regressions **Batch 2 - Medium Risk (🟡)** - **Estimated LOC removed**: 180 - **Potential bundle / binary size impact**: ~8KB (gzipped) - **Suggested refactoring order**: 1. Manually verify `featureFlags.js` - check config files and env vars for references 2. Verify `formatLegacyDate` usage via dynamic imports or string-based calls 3. Check `useOldApi` hook for usage in any lazy-loaded components 4. Review `User.js` model for ORM field mappings or serialization references **Batch 3 - Low Risk (🟢)** - **Estimated LOC removed**: 0 (suppress with comments) - **Potential bundle / binary size impact**: None - **Suggested refactoring order**: 1. Add suppression comments to all low-risk findings 2. Schedule a human review for the next sprint 3. Document all suppressed items in a technical debt register ### 3. Executive Summary | Metric | Count | |--------|-------| | Total findings | 50 | | High-confidence deletes | 6 | | Estimated LOC removed | 600 | | Estimated dead imports | 3 | | Files safe to delete entirely | 2 | | Estimated build time improvement | ~2% | The codebase shows signs of accumulated technical debt from a legacy migration, with a clear pattern of "legacy" prefixed symbols that have been superseded but not removed. The overall health is moderate - the dead code is isolated and does not indicate systemic issues, but it adds cognitive load and maintenance overhead. The top-3 highest-impact actions are: (1) delete the two entire dead files (`legacyParser.js` and `oldModal.js`), (2) remove the dead analytics event tracking, and (3) conduct a focused review of the feature flags to eliminate hardcoded branches. These actions will reduce bundle size, improve build times, and reduce the risk of future developers accidentally using deprecated code paths.

ログインして完全なプロンプトを表示

次で続行:

ログインすると、次に同意したことになります: 利用規約 と プライバシーポリシー

使い方

このプロンプトは coding 向けに設計されています。上の内容をコピーして、お好みの AI ツールに貼り付けてください。

最良の結果を得るには、プレースホルダー(角括弧や大文字で示された部分)を具体的な要件に置き換えてください。

参考資料

カテゴリ:coding| prompts.chat| dead-code| code-audit

ノート