Skip to content

Triage the 185 PublicCandidate findings from the dead-code scanner #1997

Description

@hatayama

Context

The dead-code CI gate (PR #1995) fails only on high-confidence categories (Unused / UnusedPrivateMember / UnusedLocal). PublicCandidate findings do not fail CI and still need human triage.

Measured on origin/v3-beta after #1995 (same scanner flags as the CI gate, without --fail-on):

  • Total: 242
  • PublicCandidate: 185
  • TestOnly: 57

PublicCandidate breakdown (from that scan):

Bucket Count
internal with zero references 76
public outside ToolContracts 95
public under ToolContracts 14

(Plan notes that referenced 184/74/96/14 were measured on a different branch; use these v3-beta numbers as the starting baseline, and re-measure when triage work starts.)

Suggested order

  1. Internal zero-reference symbols (76). Callers outside the assembly cannot use them, so "maybe an external consumer needs this" is not a valid keep reason. Deletion decisions are mostly mechanical.
  2. Public symbols outside ToolContracts (95). Ask whether each must stay public, not only whether it can be deleted. Many can become internal and then fall into bucket (1).
  3. Public ToolContracts symbols (14). These are the real extension-API candidates. Only here should a keep attribute (or equivalent) be debated.

Keep attribute

Do not design [UnityCliLoopKeep(reason)] until bucket (3) has concrete examples. Public API cannot be renamed later, and inventing the attribute with zero real keep sites would freeze the wrong shape.

Optional hardening

Consider a count baseline for PublicCandidate (record the current 185, fail CI when a PR increases it). That leaves the existing backlog alone while blocking new inflow.

Activity

  1. hatayama commented on Jul 25, 2026

    @hatayama
    OwnerAuthor

    Completed via #2011 (merged to v3-beta).

    Note: GitHub did not auto-close this issue from the PR's Closes #1997 because the repository default branch is main, and closing keywords only apply when merging into the default branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions