A Singapore Government Agency Website

Configure SonarQube project settings

Project administrators can configure analysis behaviour and review issues directly in the SonarQube portal.

This topic explains how to:

  • Configure project versioning
  • Rename untagged analysis
  • Configure new code settings
  • Filter issues

Configure versioning

Project versioning allows teams to compare analysis results across different releases.

Prerequisites

Ensure the following:

  • You have Administrator permission for the SonarQube project.

Steps

  1. Update your CI/CD pipeline to include the following parameter when running the Sonar scanner:
  1. Add the parameter -Dsonar.projectVersion=<version> to your CI/CD pipeline when running the Sonar scanner.

    Example: -Dsonar.projectVersion=1.2.0

  2. Run the CI/CD pipeline.

After the scan completes, SonarQube associates the analysis results with the specified version.

For details on configuring pipelines for SonarQube scans, see
Run SonarQube scans.

Rename untagged analysis

If an analysis was run without specifying a project version, you can rename it manually in SonarQube.

Steps

  1. Log in to the SonarQube portal.

  2. Open the required project.

  3. Click the Activity tab.

  4. Locate the analysis you want to rename.

  5. Click the pencil icon next to the analysis.

  6. In the Name field, enter the version name.

  7. Click Change to apply the changes.

Change Version

Configure new code settings

New Code settings define which code changes SonarQube considers as new during analysis.

Note: By default, SonarQube defines new code based on the previous analysis.

Steps

  1. Log in to the SonarQube portal and open the required project.

  2. Click Project Settings.

  3. Select New Code.

  4. Click Define a specific setting for this project.

  5. Choose one of the following options:

    • Number of days
    • Specific analysis
  6. In the Analysis from dropdown, select the required baseline.

New Code Settings

Filter issues

You can filter issues in SonarQube to review specific findings during code analysis.

Filter by resolution

  1. Open the Issues view in the SonarQube project.

  2. Click Resolution.

    • Select Unresolved to view open issues.
    • Select Fixed to view resolved issues such as bugs, vulnerabilities, or code smells.

Filter Issues

Filter by creation date

To filter issues by date:

  1. Locate the Creation Date filter.
  2. Select the required start date and end date.

Creation Date

Chat with me!
Bot Launcher