Skip to content

Latest commit

 

History

History
88 lines (61 loc) · 2.93 KB

File metadata and controls

88 lines (61 loc) · 2.93 KB

issue Command Spec

Status: ✅ Done (2026-02-23); ignore/unignore added 2026-03-02; vulnerable functions block added 2026-07-24

Purpose

Show full details of a single quality issue, including file context, pattern description, and suggested fix.

Usage

codacy issue <provider> <organization> <repository> <issueId>
codacy iss gh my-org my-repo 12345
codacy iss gh my-org my-repo 12345 --output json
codacy iss gh my-org my-repo 12345 --ignore
codacy iss gh my-org my-repo 12345 --ignore --ignore-reason FalsePositive --ignore-comment "Not applicable here"
codacy iss gh my-org my-repo 12345 --unignore

The issueId is the resultDataId shown at the bottom of each issue card in issues and pull-request.

Options

Option Short Description
--ignore -I Ignore this issue
--ignore-reason <reason> -R Reason: AcceptedUse (default) | FalsePositive | NotExploitable | TestCode | ExternalCode
--ignore-comment <comment> -m Optional comment
--unignore -U Unignore this issue

API Endpoints

  1. getIssueAnalysisService.getIssue(provider, org, repo, resultDataId)
  2. Then in parallel:
    • getPatternToolsService.getPattern(toolUuid, patternId)
    • getFileContentFileService.getFileContent(provider, org, repo, encodedPath, startLine, endLine)
  3. For ignore/unignore: updateIssueState — uses issue.issueId (UUID string), not resultDataId

File context: ±5 lines around the issue's line number.

Output Format

Rendered via shared printIssueDetail from utils/formatting.ts:

{Severity colored} | {Category} {SubCategory?}
{Issue message}

{FilePath}:{LineNumber}
{Extended line content (±5 lines)}
{Optional: suggestion line in green+bold}

{Optional: Potential false positive warning}

{Pattern description}

Why is this a problem?
{Pattern rationale}

How to fix it?
{Pattern solution}

Tags: {pattern tags}

Detected by: {tool name}
{pattern title} ({pattern id})

Vulnerable Functions block — shown between the false-positive warning and the pattern docs whenever issue.advisoryInformation is present (SCA issues linked to an OSV advisory):

Vulnerable Functions ({advisoryId})
Published: {publishedAt, formatted YYYY-MM-DD}

  • {vulnerableFunctions[0]}
  • {vulnerableFunctions[1]}
  ...

Rendered via printAdvisoryBlock in utils/formatting.ts, called from printIssueCodeContext (so it's also shared with the pull-request --issue detail view). No conditional on issue category — gated purely on advisoryInformation being present, mirroring how the CVE block is gated on cve for finding.

Tests

File: src/commands/issue.test.ts — 20 tests (17 + 3 for the vulnerable functions block).