Operations 2 min read

Configuring SonarQube Code Quality Checks in CI Pipelines: Issues and Preview Modes

This article explains how continuous delivery pipelines rely on SonarQube for code quality enforcement, compares the Issues and Preview modes for displaying analysis results in commits, and provides the necessary SonarQube command‑line parameters to configure each mode in a CI/CD workflow.

DevOps Cloud Academy
DevOps Cloud Academy
DevOps Cloud Academy
Configuring SonarQube Code Quality Checks in CI Pipelines: Issues and Preview Modes

The core of continuous delivery is the pipeline, and the most critical step within the pipeline is ensuring code quality; typically, quality checks are enforced in both the commit and integration pipelines, with configuration guidance available in the official SonarQube documentation.

Issues mode displays related information in the commit view while detailed analysis must be viewed on the SonarQube platform, making it suitable for configuration in the commit pipeline.

Preview mode also shows information in the commit view, but it can pinpoint the exact code line of an issue; the SonarQube platform does not store any data for this mode.

To configure SonarQube for either mode, add the appropriate SonarQube parameters to your CI job, specifying the analysis mode, GitLab project ID, commit SHA, and branch name, for example:

-Dsonar.analysis.mode=preview -Dsonar.gitlab.project_id=${projectid} -Dsonar.gitlab.commit_sha=${commit_sha}
-Dsonar.gitlab.ref_name=${branchName}
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

ci/cdSonarQubeissues modepreview mode
DevOps Cloud Academy
Written by

DevOps Cloud Academy

Exploring industry DevOps practices and technical expertise.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.