GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing docs.gitlab.com — Code Quality | GitLab Docs
/ Code Quality
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 tierDifferent features are available in different GitLab tiers, as shown in the following table: Scan code for quality violationsCode Quality is an open system that supports importing results from many scanning tools. To find violations and surface them, you can:
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 jobMany 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:
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, The CodeClimate engine runs:
Migrate from CodeClimate-based scanningThe 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:
View Code Quality resultsCode Quality results are shown in the: Merge request reportsCode 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
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
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
The project quality view displays an overview of the code quality findings. The view can be found under Analyze > CI/CD analytics, and requires Code Quality report formatYou 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:
The format is different from the CodeClimate report format in the following ways:
For example, this is a compliant report: json Integrate common tools with Code QualityMany tools natively support the required report format to integrate their results with Code Quality. They may call it a “CodeClimate report”, “GitLab Code Quality report”, or another similar name. Other tools can be configured to create JSON output by providing a custom template or format specification. Because the report format has only a few required fields, this output type might work for a Code Quality report. If you already use a tool in your CI/CD pipeline, you should adapt the existing job to add a Code Quality report. Adapting the existing job prevents you from running a separate job that may confuse developers and make your pipelines take longer to run. If you don’t already use a tool, you can write a CI/CD job from scratch or adopt the tool by using a component from the CI/CD Catalog. Code scanning toolsESLintIf you already have an ESLint job in your CI/CD pipelines, you should add a report to send its output to Code Quality. To integrate its output:
You can also use or adapt the ESLint CI/CD component to run the scan and integrate its output with Code Quality. StylelintIf you already have a Stylelint job in your CI/CD pipelines, you should add a report to send its output to Code Quality. To integrate its output:
For more details and an example CI/CD job definition, see the documentation for MyPyIf you already have a MyPy job in your CI/CD pipelines, you should add a report to send its output to Code Quality. To integrate its output:
You can also use or adapt the MyPy CI/CD component to run the scan and integrate its output with Code Quality. Flake8If you already have a Flake8 job in your CI/CD pipelines, you should add a report to send its output to Code Quality. To integrate its output:
You can also use or adapt the Flake8 CI/CD component to run the scan and integrate its output with Code Quality. PylintIf you already have a Pylint job in your CI/CD pipelines, you should add a report to send its output to Code Quality. To integrate its output:
You can also use or adapt the Pylint CI/CD component to run the scan and integrate its output with Code Quality. RuffIf you already have a Ruff job in your CI/CD pipelines, you should add a report to send its output to Code Quality. To integrate its output:
You can also use or adapt the documented Ruff GitLab CI/CD integration to run the scan and integrate its output with Code Quality. golangci-lintIf you already have a
You can also use or adapt the golangci-lint CI/CD component to run the scan and integrate its output with Code Quality. PMD Copy/Paste DetectorThe PMD Copy/Paste Detector (CPD) requires additional configuration because its default output doesn’t conform to the required format. You can use or adapt the PMD CI/CD component to run the scan and integrate its output with Code Quality. SwiftLintUsing SwiftLint requires additional configuration because its default output doesn’t conform to the required format. You can use or adapt the SwiftLint CI/CD component to run the scan and integrate its output with Code Quality. RuboCopUsing RuboCop requires additional configuration because its default output doesn’t conform to the required format. You can use or adapt the RuboCop CI/CD component to run the scan and integrate its output with Code Quality. RoslynatorUsing Roslynator requires additional configuration because its default output doesn’t conform to the required format. You can use or adapt the Roslynator CI/CD component to run the scan and integrate its output with Code Quality. Documentation scanning toolsYou can use Code Quality to scan any file stored in a repository, even if it isn’t code. ValeIf you already have a Vale job in your CI/CD pipelines, you should add a report to send its output to Code Quality. To integrate its output:
You can also use or adapt an open source job definition to run the scan and integrate its output with Code Quality, for example:
markdownlint-cli2If you already have a markdownlint-cli2 job in your CI/CD pipelines, you should add a report to send its output to Code Quality. To integrate its output:
For more details and an example CI/CD job definition, see the documentation for Was this page helpful?
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |