Text of docs.gitlab.com › ci › testing › code_quality as Styx crawled it on Nov 18, 2026. The page may have changed since. Only its words are kept, without pictures or layout, and only the first part of a long page.

Open the live page

Code Quality | GitLab Docs

/ Code Quality Tier : Free, Premium, Ultimate Offering : GitLab.com, GitLab Self-Managed, GitLab Dedicated Code Quality identifies maintainability issues before they become technical debt. The automated feedback that occurs during code reviews can help your team write better code. The findings appear directly in merge requests, making problems visible when they’re most cost-effective to fix. Code Quality works with multiple programming languages and integrates with common linters, style checkers, and complexity analyzers.

Your existing tools can feed into the Code Quality workflow, preserving your team’s preferences while standardizing how results are displayed. Features per tier Different features are available in different GitLab tiers , as shown in the following table: Feature In Free In Premium In Ultimate Import Code Quality results from CI/CD jobs Use CodeClimate-based scanning See findings in merge request reports See findings in a pipeline report No See findings in the merge request changes view No No Analyze overall health in a project quality summary view No No Scan code for quality violations Code Quality is an open system that supports importing results from many scanning tools.

To find violations and surface them, you can: Directly use a scanning tool and import its results . (Preferred.) Use a built-in CI/CD template to enable scanning. The template uses the CodeClimate engine, which wraps common open source tools. (Deprecated.) You can capture results from multiple tools in a single pipeline. For example, you can run a code linter to scan your code along with a language linter to scan your documentation, or you can use a standalone tool along with CodeClimate-based scanning.

Code Quality combines all of the reports so you see all of them when you view results . Import Code Quality results from a CI/CD job Many development teams already use linters, style checkers, or other tools in their CI/CD pipelines to automatically detect violations of coding standards. You can make the findings from these tools easier to see and fix by integrating them with Code Quality. To see if your tool already has a documented integration, see Integrate common tools with Code Quality .

To integrate a different tool with Code Quality: Add the tool to your CI/CD pipeline. Configure the tool to output a report as a file. This file must use a specific JSON format . Many tools support this output format natively. They may call it a “CodeClimate report”, “GitLab Code Quality report”, or another similar name. Other tools can sometimes create JSON output using a custom JSON format or template. Because the report format has only a few required fields, this output type might work for a Code Quality report.

Declare a codequality report artifact that matches this file. Now, after the pipeline runs, the quality tool’s results are processed and displayed . Use the built-in Code Quality CI/CD template (deprecated) This feature was deprecated in GitLab 17.3 and is planned for removal in 19.0. Integrate the results from a supported tool directly instead. Code Quality also includes a built-in CI/CD template, Code-Quality.gitlab-ci.yaml .

This template runs a scan based on the open source CodeClimate scanning engine. The CodeClimate engine runs: Basic maintainability checks for a set of supported languages . A configurable set of plugins , which wrap open source scanners, to analyze your source code. Migrate from CodeClimate-based scanning The CodeClimate engine uses a customizable set of analysis plugins. Some are on by default; others must be explicitly enabled.

The following integrations are available to replace the built-in plugins: Plugin On by default Replacement Duplication Integrate PMD Copy/Paste Detector . ESLint Integrate ESLint . gofmt No Integrate golangci-lint and enable the gofmt linter . golint No Integrate golangci-lint and enable one of the included linters that replaces golint. golint is deprecated and frozen . govet No Integrate golangci-lint . golangci-lint includes govet by default . markdownlint No (community-supported) Integrate markdownlint-cli2 . pep8 No Integrate an alternative Python linter like Flake8 , Pylint , or Ruff .

RuboCop Integrate RuboCop . SonarPython No Integrate an alternative Python linter like Flake8 , Pylint , or Ruff . Stylelint No (community-supported) Integrate Stylelint . SwiftLint No Integrate SwiftLint . View Code Quality results Code Quality results are shown in the: Merge request reports Merge request changes view Pipeline details view Project quality view Merge request reports Code quality analysis results display in the merge request Reports tab.

Multiple code quality findings with identical fingerprints display as a single entry. To determine which findings are new or resolved, GitLab compares them with the findings from a baseline pipeline on the target branch. For more information, see merge request reports . Merge request changes view Tier : Ultimate Offering : GitLab.com, GitLab Self-Managed, GitLab Dedicated Code Quality results display in the merge request Changes view.

Lines containing Code Quality issues are marked by a symbol beside the gutter. Select the symbol to see the list of issues, then select an issue to see its details. Pipeline details view Tier : Premium, Ultimate Offering : GitLab.com, GitLab Self-Managed, GitLab Dedicated The full list of Code Quality violations generated by a pipeline is shown in the Code Quality tab of the pipeline’s details page. The pipeline details view displays all Code Quality findings that were found on the branch it was run on.

Project quality view Tier : Ultimate Offering : GitLab.com, GitLab Self-Managed Status : Beta Introduced in GitLab 14.5 with a feature flag named project_quality_summary_page . This feature is in beta . Disabled by default. The project quality view displays an overview of the code quality findings. The view can be found under Analyze > CI/CD analytics , and requires project_quality_summary_page feature flag to be enabled for this particular project.

Code Quality report format You can import Code Quality results from any tool that can output a report in the following format. This format is a version of the CodeClimate report format that includes a smaller number of fields. The file you provide as Code Quality report artifact must contain a single JSON array. Each object in that array must have at least the following properties: Name Type Description description String A human-readable description of the code quality violation. check_name String A unique name representing the check, or rule, associated with this violation. fingerprint String A unique fingerprint to identify this specific code quality violation, such as a hash of its contents. location.path String The file containing the code quality violation, expressed as a relative path in the repository.

Do not prefix with ./ . location.lines.begin or location.positions.begin.line Integer The line on which the code quality violation occurred. severity String The severity of the violation, can be one of info , minor , major , critical , or blocker . The format is different from the CodeClimate report format in the following ways: Although the CodeClimate report format supports more properties, Code Quality only processes the fields listed previously.

The GitLab parser does not allow a byte order mark at the beginning of the file. Some tools add a UTF-8 byte order mark to their output by default, particularly tools that originate from a Windows or .NET environment. To check for and remove a UTF-8 byte order mark, run: shell [ " $( head -c3 report.json | od -An -tx1 | tr -d ' \n' ) " = "efbbbf" ] && { sed -i.bak '1s/^\xEF\xBB\xBF//' report.json && echo "BOM removed" || echo "BOM detected but removal failed" } || echo "No BOM found, nothing changed" For example, this is a compliant report: json [ { "description" : "'unused' is assigned a value but never used." , "check_name" : "no-unused

The rest of this page is on the live site.