Skip to main content

Fixing code quality findings in your repository backlog

Generate autofixes for findings on the default branch of your repository, or dismiss findings that aren't relevant.

누가 이 기능을 사용할 수 있나요?

쓰기 권한이 있는 사용자

GitHub Team 또는 GitHub Enterprise Cloud

If you're new to Code Quality, see Raising your repository's code quality score for a guided walkthrough of reviewing and improving your repository's quality scores.

How Code Quality works on your default branch

Code Quality scans your default branch and reports findings on "코드 품질" pages on the Security and quality tab of your repository. It runs two types of analysis.

  1. 표준 결과: Code Quality uses CodeQL to perform a deterministic, rules-based scan of your default branch. Finding are grouped by rule and language, labeled by severity (Error, Warning, Note), and each includes a suggested autofix.

  2. AI 결과: Code Quality uses AI-powered analysis to identify quality issues in the files most recently pushed to your default branch, including issues that rule-based analysis may not detect - such as best practices, naming conventions, or design considerations.

참고

The "AI 결과" page for recently changed files is currently in 공개 미리 보기 and subject to change.

For information on resolving AI 결과, see Fixing code quality findings in recently merged files.

Resolving a standard finding

  1. 리포지토리의 Security and quality 탭으로 이동합니다.

  2. 코드 품질 을(를) 확장하려면 클릭하고, 그런 다음 표준 결과 을(를) 클릭합니다.

  3. Use the dashboard filters to focus on the findings most likely to affect your quality scores. For example, to see all "Error"-level findings for "Reliability", set the filter to:

    is:open category:reliability severity:error

  4. Findings are grouped by rule. Click a rule name to be taken to a detailed view of all findings for that rule.

    Screenshot showing a rule in the "Standard findings" view. The rule name is highlighted in dark orange.

  5. Click Show more, then review the explanation of the rule, what the recommended fix is, supporting code examples and references.

    Screenshot showing the results for a code quality rule. The text "Show more" is highlighted in dark orange.

  6. To the right of an individual finding, click Generate fix.

  7. Review the diff of the proposed change. If you agree with it, click Open pull request.

  8. In the "Commit autofix to branch" dialog, select "Open a pull request", then click Commit change.

  9. When the autofix pull request is ready for review, change its status from "Draft" to "Ready for review", and wait for CI checks to pass before merging.

  10. Alternatively, if a finding isn't relevant or actionable, click Dismiss. For example, you might dismiss a finding that is in legacy code no longer maintained, is a known exception to your team's coding standards, or is a false positive that doesn't pose a real quality risk.

To raise a maintainability or reliability score, you must resolve every finding at the highest severity level currently affecting that metric. See 메트릭 및 등급 참조.

Verifying that your code quality scores have updated

After your autofix pull requests are merged, return to the "표준 결과" view to confirm that:

  • The number of findings has decreased.
  • The maintainability or reliability score has improved, if you resolved all findings at the current minimum severity level for that metric.

Next steps