get_unused_code
Find code no production entry point reaches, including dead code, possibly unused functions, and test-only exports, so you can verify functions before cleanup or deletion.
Instructions
Find code nothing runs: functions no production entry point (endpoint, CLI command, cron job, event handler, worker, entry file) reaches. Pass functions to check whether specific functions are wired in.
CALL THIS WHEN: • Before cleaning up a module or deleting a function • After merging new code, to confirm an entry point reaches it
RETURNS:
• Dead: unreached, named in no other file, and no production file imports its file. Safe to delete.
• Possibly unused: unreached, but named in other files (string dispatch, dynamic loading) or its file is imported. Listed with the files that name it; check before deleting.
• Used only by tests: exported functions and class methods only test files reference.
With functions: each one's status, and the call path from an entry point when it's reachable.
USE INSTEAD OF: reference searches; references do not prove code runs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | Yes | Repository name — one of your connected repos. | |
| module | No | Limit to one module | |
| functions | No | Function names or Class.method names to check instead of listing everything unused |