Skip to content

Implement Dead Code Hunter GitHub Action #1

@jonathanpopham

Description

@jonathanpopham

Overview

Build a GitHub Action that uses Supermodel's call graph API to find unreachable functions (dead code) in a codebase.

Core Features

  • Create zip archive of repository (respecting .gitignore)
  • Call Supermodel /v1/graphs/call endpoint to get call graph
  • Analyze graph to find functions with zero incoming calls
  • Filter out false positives:
    • Entry points (main, exported functions)
    • Test files
    • User-specified ignore patterns
  • Post findings as PR comment (with file links)
  • Set action outputs (dead-code-count, dead-code-json)
  • Optional: fail action if dead code found

Stretch Goals

  • Auto-generate cleanup PR removing dead code
  • Track dead code trends over time
  • Integrate with GitHub code scanning (SARIF output)

Technical Notes

  • Use @supermodel/typescript-sdk for API calls
  • Use @actions/core and @actions/github for action scaffolding
  • Build with @vercel/ncc for single-file distribution

Reference

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions