You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
body: `This pull request may have been opened accidentally. I'm going to close it now, but feel free to check out our [contribution guidelines](https://docs.github.com/en/contributing), or raise a new issue.`
Copy file name to clipboardExpand all lines: content/code-security/concepts/code-quality/code-quality.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ category:
20
20
21
21
{% data variables.product.prodname_code_quality %} analyzes your code for quality and coverage issues and delivers {% data variables.product.prodname_copilot_short %}-powered fixes you can apply in one click. It runs in two places:
22
22
23
-
***On pull requests**, {% data variables.product.prodname_code_quality_short %} uses deterministic {% data variables.product.prodname_codeql %} rules to detect known anti-patterns and posts findings as inline comments before code is merged. If you upload a Cobertura XML coverage report, coverage metrics show whether a change maintains or reduces coverage. You can enforce quality and coverage thresholds with rulesets to block pull requests that don't meet your criteria, so new quality debt doesn't accumulate.
23
+
***On pull requests**, {% data variables.product.prodname_code_quality_short %} uses deterministic {% data variables.product.prodname_codeql %} rules to detect known anti-patterns and posts findings as inline comments before code is merged. If you upload a Cobertura XML coverage report, line coverage metrics show whether a change maintains or reduces coverage. You can enforce quality and coverage thresholds with rulesets to block pull requests that don't meet your criteria, so new quality debt doesn't accumulate.
24
24
***On the default branch**, rules-based scans identify existing quality debt across your codebase, with autofixes you can apply directly or assign to {% data variables.copilot.copilot_cloud_agent %} to resolve on your behalf. AI-powered analysis also runs on recently changed files, flagging issues that fall outside existing rule sets, including languages not yet covered by {% data variables.product.prodname_codeql %} queries.
25
25
26
26
> [!NOTE]
@@ -32,14 +32,14 @@ Here's what {% data variables.product.prodname_code_quality %} looks like in pra
32
32
33
33
For developers and teams:
34
34
35
-
***A developer opens a pull request** that introduces a reliability or maintainability issue. {% data variables.product.prodname_code_quality_short %} posts a comment explaining the issue and offers a one-click fix before the code is merged. The developer also sees a report of coverage metrics, and can tell at a glance whether the pull request improves or reduces coverage compared to the default branch.
35
+
***A developer opens a pull request** that introduces a reliability or maintainability issue. {% data variables.product.prodname_code_quality_short %} posts a comment explaining the issue and offers a one-click fix before the code is merged. The developer also sees a report of line coverage metrics, and can tell at a glance whether the pull request improves or reduces coverage compared to the default branch.
36
36
***A team inherits a large codebase** with years of accumulated quality debt. {% data variables.product.prodname_code_quality_short %} scans the default branch, surfaces findings with autofixes on a dashboard, and the team assigns remediation work to {% data variables.copilot.copilot_cloud_agent %} to open fix pull requests automatically.
37
37
***A team adopts AI coding assistants** and needs assurance that generated code meets the same bar as hand-written code. AI-powered analysis catches issues in recently changed files that rule-based queries weren't written for, while {% data variables.product.prodname_codeql %} rules cover well-defined anti-patterns.
38
38
39
39
For administrators and leads:
40
40
41
41
***An engineering lead sets coverage and quality thresholds** using rulesets. Pull requests that don't meet the criteria are blocked from merging, so no new quality or coverage debt accumulates.
42
-
***An administrator needs visibility across repositories** for audits or compliance reporting. {% data variables.product.prodname_code_quality_short %} reports through the security overview alongside security tools, so they can see quality posture across the organization at a glance, identify which repositories need attention, and track improvement metrics using standard {% data variables.product.github %} audit controls and policies.
42
+
***An administrator needs visibility across repositories** for audits or compliance reporting. {% data variables.product.prodname_code_quality_short %} reports through the security overview alongside security tools, so they can see current quality posture across the organization, review how open findings have changed over time, and identify which repositories need attention. See [AUTOTITLE](/code-security/how-tos/maintain-quality-code/explore-code-quality).
Copy file name to clipboardExpand all lines: content/code-security/how-tos/maintain-quality-code/explore-code-quality.md
+78-5Lines changed: 78 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,33 +22,106 @@ redirect_from:
22
22
23
23
## Viewing code quality insights for your organization
24
24
25
+
The organization-level dashboard has two tabs:
26
+
27
+
* The **Health** tab shows a snapshot of your organization's current code health.
28
+
* The **Trends** tab shows how open findings have changed over a selected period of time, so you can track progress and identify repositories that need attention.
29
+
25
30
1. On {% data variables.product.prodname_dotcom %}, navigate to the main page of your organization. For example, from [https://github.com/settings/organizations](https://github.com/settings/organizations?ref_product=github&ref_type=engagement&ref_style=text&utm_campaign=code-quality-ga-july-2026&utm_medium=docs&utm_source=docs-explore-cq-org-settings).
26
31
{% data reusables.organizations.security-overview %}
27
-
1. In the "Insights" section of the sidebar, click {% octicon "code-square" aria-hidden="true" aria-label="code-square" %} **Code quality**.
32
+
1. In the "Insights" section of the sidebar, click **{% data variables.code-quality.code_quality_ui_settings %}**.
28
33
29
34
> [!NOTE]
30
35
> What you see on the dashboard depends on your access:
36
+
>
31
37
> * Organization owners see data for **every** repository that has {% data variables.product.prodname_code_quality_short %} enabled.
32
38
> * All other organization members see data only for repositories where they can view {% data variables.product.prodname_code_quality_short %} findings (the repository-level pages), up to a maximum of 3,000 repositories.
33
39
34
-
## Interpreting the score distribution chart
40
+
## Filtering dashboard data
41
+
42
+
A filter bar at the top of the dashboard applies to both the **Health** and **Trends** tabs. You can filter by:
43
+
44
+
* Reliability score
45
+
* Maintainability score
46
+
* {% data variables.code-quality.all_findings %}
47
+
* {% data variables.code-quality.recent_suggestions %}
48
+
* Topic
49
+
* Team
50
+
* Visibility
51
+
* Any custom properties defined for your organization
52
+
53
+
You can also sort the dashboard data using the **Sort** control in the same filter bar.
54
+
55
+
## Viewing current code health
56
+
57
+
The **Health** tab shows a snapshot of your organization's code health right now.
58
+
59
+
### Interpreting the score distribution chart
35
60
36
61
The score distribution chart provides a visual overview of the code health of your organization. Each bubble represents a collection of repositories with the same maintainability and reliability scores.
62
+
37
63
* The **position** of each bubble demonstrates the overall health of those repositories. Higher bubbles represent higher maintainability scores, while bubbles further to the right represent higher reliability scores.
38
64
* The **color and border pattern** of a bubble indicate the severity of the lower score for those repositories. For example, a bubble with a "Poor" score in either category will always be red with a dashed border.
39
65
* The **size** of each bubble represents the number of repositories with that particular score combination.
40
66
41
67
To view the maintainability score, reliability score, and number of repositories represented by a particular bubble, hover over the bubble.
42
68
43
-
## Exploring the repository table
69
+
###Exploring the repository table
44
70
45
71
Below the bubble chart, there is a table that lists all repositories in your organization. Here, you can view code quality findings, along with more detailed information about those findings.
46
72
47
73
You can sort the repository table in ascending or descending order for any column by clicking the column header.
48
74
49
-
## Investigating low-scoring repositories
75
+
###Investigating low-scoring repositories
50
76
51
77
1. To filter the dashboard data for the lowest-performing repositories, on the score distribution chart, click the bubble with the lowest combined scores.
52
78
1. Scroll down to the repository table. By default, the table is sorted from most to least recent repository scan, helping you prioritize current quality issues.
53
-
1. Optionally, to prioritize repositories with the highest number of {% data variables.product.prodname_codeql %} findings, click **Standard Findings** twice.
79
+
1. Optionally, to prioritize repositories with the highest number of {% data variables.product.prodname_codeql %} findings, click **{% data variables.code-quality.all_findings %}** twice.
54
80
1. To view the repository-level dashboard for a specific repository, click the repository's name.
81
+
82
+
## Tracking quality trends over time
83
+
84
+
The **Trends** tab shows how open findings across repositories that you have access to and that match the current filters have changed over time, so you can tell whether your code quality work is having an effect and where to focus attention next.
85
+
86
+
1. On the organization-level dashboard, click the **Trends** tab.
87
+
1. Use the **Period** dropdown to select a time range: the last 7, 14, or 30 days.
88
+
1. Review the "Open findings over time" graph, which shows the total number of open findings across applicable repositories for the selected period.
89
+
1. Optionally, use the buttons above the graph to group the data by **Health score** or **Severity**.
90
+
1. Hover over a point on the graph to see the open finding count for that day.
91
+
92
+
### Understanding the trends data
93
+
94
+
Keep the following in mind when you interpret the graph:
95
+
96
+
* The graph is based on daily snapshots of open findings. If no analysis ran on a given day, there may be no data point for that day.
97
+
* Historical data is only available from when {% data variables.product.prodname_code_quality_short %} started taking snapshots, so the available time range may initially be limited.
98
+
* The graph tracks the total count of open findings, not individual findings being opened or fixed. A change in the count doesn't necessarily mean developers fixed or introduced problems.
99
+
* Enabling {% data variables.product.prodname_code_quality_short %} on additional repositories can increase the finding count shown in the graph. An increase after enabling new repositories doesn't necessarily mean code quality is declining.
100
+
* The graph tracks the total count of open findings for the repositories you are currently filtering on. The total count includes:
101
+
102
+
* New findings that are introduced by code changes or when code quality analysis is enabled on new repositories
103
+
* Findings that are fixed in the code or dismissed by users
104
+
105
+
## Identifying repositories that need attention
106
+
107
+
Below the trends graph, two tables help you identify which repositories need attention over the selected time period:
108
+
109
+
***Most improved repositories** lists repositories with the largest decrease in open findings over the selected time period.
110
+
***Repositories needing improvement** lists repositories with the largest increase in open findings over the selected time period.
111
+
112
+
Both tables include the following columns:
113
+
114
+
***Repository**: The name of the repository.
115
+
***Total open**: The number of open findings for the repository at the end of the selected time period.
116
+
***Net change**: How the open finding count for the repository has changed over the selected time period.
117
+
***Dismissed**: How many findings were dismissed for the repository over the selected time period.
118
+
119
+
The number of findings for a repository is affected by findings being fixed and dismissed. You can use the repository-level dashboard to confirm what changed.
120
+
121
+
To investigate a repository, click its name to open its repository-level {% data variables.product.prodname_code_quality_short %} dashboard, where you can review individual findings and take remediation action.
122
+
123
+
## Next steps
124
+
125
+
To understand the code health information available on the repository-level dashboard, see [AUTOTITLE](/code-security/how-tos/maintain-quality-code/interpret-results).
126
+
127
+
If you're planning to enable {% data variables.product.prodname_code_quality_short %} across many repositories, see [AUTOTITLE](/code-security/how-tos/maintain-quality-code/roll-out-at-scale).
Copy file name to clipboardExpand all lines: content/code-security/how-tos/maintain-quality-code/restrict-code-coverage.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,9 @@ category:
19
19
* {% data variables.product.prodname_code_quality %} is enabled on the repository.
20
20
* Code coverage data is uploaded to {% data variables.product.github %} for the pull request branch. See [AUTOTITLE](/code-security/how-tos/maintain-quality-code/set-up-code-coverage).
21
21
22
+
> [!NOTE]
23
+
> Coverage thresholds are evaluated against **line coverage**. See [AUTOTITLE](/code-security/reference/code-quality/code-coverage).
24
+
22
25
## Creating a coverage threshold rule
23
26
24
27
{% data reusables.repositories.navigate-to-repo %}
@@ -28,8 +31,8 @@ category:
28
31
1. Under "Branch rules", select **Restrict code coverage**.
29
32
1. Expand **Additional settings** to configure thresholds. A value of 0 means that the threshold is disabled.
30
33
31
-
***Minimum coverage percentage**: enter a value to block pull requests where aggregated coverage falls below this percentage.
32
-
***Maximum coverage drop**: enter a value to block pull requests where coverage drops by more than this many percentage points relative to the default branch.
34
+
***Minimum line coverage percentage**: enter a value to block pull requests where aggregated line coverage falls below this percentage.
35
+
***Maximum line coverage drop**: enter a value to block pull requests where line coverage drops by more than this many percentage points relative to the default branch.
Copy file name to clipboardExpand all lines: content/code-security/how-tos/maintain-quality-code/set-pr-thresholds.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ You can block pull requests that don't meet your code quality standards by addin
21
21
You can set thresholds for:
22
22
23
23
***{% data variables.product.prodname_codeql %} findings**, by the lowest severity of results you require to be resolved.
24
-
***Code coverage**, by the minimum percentage of code that must be covered by tests.
24
+
***Code coverage**, by the minimum percentage of lines that must be covered by tests.
25
25
26
26
You can enforce these thresholds at the **repository** level, or at the **organization** level to apply the same standard across many repositories at once. Choose the organization level when you want a consistent quality bar across teams, and the repository level when a single project needs its own standard. {% data variables.product.prodname_code_quality_short %} {% data variables.code-quality.recent_suggestions %} cannot be set as a threshold.
0 commit comments