How to Exclude Scanning Files in Sonarqube

mqzerr
3 min readJan 26, 2022

Code Quality Control

Introduction

SonarQube is an open-source platform developed by SonarSource for continuous inspection of code quality to perform automatic reviews with static analysis of code to detect bugs, code smells, and security vulnerabilities on 20+ programming languages. https://www.sonarqube.org/

Sonarqube

Stop manual code reviews. Easily integrate Codacy into your DevOps Process. The easiest tool to setup and ensure your team is writing high quality code. Over 12000 Quality Rules. Cloud and Self-Hosted. for GitHub, GitLab and BB. Pull Request Integrations.

The process sonarqube is scanning your code and then generate report for you. So during scan your code you will need to exclude file or any path of your project such as any library code that you used in the project (jquery, css, bootstrap js,…). Below is the step to exclude all of that file.

How to exclude …?

  1. Go to your project that you already scan by sonar scan

2. Then view your project detail

after view your project you will see the “Project Setting” => “General Setting”

3. Go to “Analyse Scope

4. Scroll to “Source File Exclusions

Then add your any file to exclude from your project scanning. For the pattern of exclusion please follow the link below:

After you have add the exclusion file already, you need to re-scan to take affect.

Thank you, and cheers !!!

This article is just the way that I shared to everyone about sonar because I used to search and find this solution in the internet but I cannot find it. Currently I just solved it by this way.

#sonarqube#code#quality#control#file#exclusion#scan#sharingiscaring##startfromyou#cambodia#devopskh

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

mqzerr
mqzerr

Written by mqzerr

DevOps engineer at ABA Bank Cambodia — Be your own unique :)

No responses yet

Write a response