am having a class, which is giving me sonar issues. That is just a temporary class and I would ignore it in future sprints. How can I mark that particular class to be ignored from sonar analysis, as we have guidelines to commit code only if no sonar issues found.
annotation to skip sonar analysis on a class
12.3k Views Asked by anurag1007 At
2
There are 2 best solutions below
Related Questions in SONARQUBE
- How to specify SonarQube rule description as a markdown/html resource file instead of using annotation?
- No 'Code Coverage' decorations in SonarQube 5.1+
- Upgrade H2 from sonarqube 4.5.1 to 5.1.1
- Logging error when executing Maven SonarQube plugin
- Analysis fails on PHP project with NullPointerException, fails on foreach($arrayOfArrays as list($item1, $item2)) {}
- Sonarqube ghost projects in issues
- Sonnar runner in Jenkins error in java project
- Reports missing on SonarQube dashboard after upgrade
- Exception in SonarQube.Msbuild.Runner
- How can I integrate ReSharper's Dotsettings File in SonarQube?
- Upgrade from SonarQube 4.3.2 to 4.5LTS (No Response)
- Properties file exclude multiple paths
- Technical debt on custom web rule in sonarqube 5.1
- sonar project.properties to ignore files containing a regular expression
- Sonarqube SVN Plugin fails with code E155007 'is not a working copy'
Related Questions in SONARQUBE-SCAN
- How to specify wildcards in sonar-project.properties
- How to scan phtml and embedded javascript files in SonarQube?
- How to show sonar issues as compile time error?
- SonarQube shows projectKey is null, but it is defined in sonar-project.properties
- SonarQube error: Component key length is longer than the maximum authorized
- SonarQube don't show new metrics
- ERROR: No FxCop analysis has been performed on this project, whereas it contains cs files
- SonarQube 6.0 - org.sonar.java.se.ExplodedGraphWalker$MaximumStepsReachedException: reached limit of 16000 steps for method
- SonarQube analysis java and net together
- Unable to run analysis on SonarQube after upgrade to version 6.2
- How To Use The Sonar Maven Plug-in
- Sonar Web Page is not displayed
- SonarQube 5.6 with Java Project (JDK 1.6)
- Sonarqube 6.2 finds only code duplication, no bugs, vulnerabilities or code smells
- SonarQube showing wrong information from clearcase "Blame"
Related Questions in SONAR-RUNNER
- Sonarqube ghost projects in issues
- Sonnar runner in Jenkins error in java project
- Properties file exclude multiple paths
- Technical debt on custom web rule in sonarqube 5.1
- SonarQube with Sonar-runner cannot store report
- Sonar can't find plugin - Java
- Sonar and TFS 2013 : No ProjectInfo.xml files were found
- SonarQube PHP no code coverage
- Unable to delete the persistit_tempvol file after Executing sonar Embedded Runner from Java
- Relationship between SonarQube Runner and SonarQube.MSBuild.Runner
- How to specify wildcards in sonar-project.properties
- How to scan phtml and embedded javascript files in SonarQube?
- SonarQube runner throws org.sonar.runner.impl.RunnerException
- How see duplications from last analysis?
- Integrating JaCoCo with Sonar for integration test coverage in Android
Related Questions in SONARLINT
- Sonarlint CLI to report on new issues only
- Running SonarLint VisualStudio plugin without SonarQube
- java mapping naming between postgres and sonarlint
- How do I set java version for a particular sonarlint scan?
- How to capture C# Issues from SonarLint CLI
- Generating the "Issue report" for C# project using SonarLint
- SonarLint can't connect to remote server
- Sonar seems to ignore variables set in catch block
- How to create Intellij idea maven/gradle plugin which checks code-quality at real time?
- Serializable Object.class
- Getting PHP lint / PhpStorm inspect errors every day from command line
- How can I split this function for low congnitive complexity?
- How to serialize a generic class that can be its own type parameter?
- Unable to install Sonarlint on Eclipse
- annotation to skip sonar analysis on a class
Related Questions in SONARQUBE5.1
- Sonar qube is not getting started
- How to upgrade database Sonarqube running on Windows
- WARN web[o.s.s.n.NotificationService] Unable to deliver notification
- Sonarqube won't upgrade to 5.1.x after incompatible plugins have been uninstalled
- Build failure due to Sonar plugin
- Sonar started but builds are failing
- Sonarqube Eclipse plugin not working in incremental analysis mode
- sonarqube "Apply project exclusions" very slow
- Does continuous inspection still work with Sonar 5.1.X?
- 1 sonarqube server connected to 2 different jenkins server
- ERROR: No FxCop analysis has been performed on this project, whereas it contains cs files
- How can I add a lines of code measure to a project in SonarQube from an external source?
- Configure SonarQube Quality Gate threshold for new issues rather than increase in value
- How to add history widgets in SonarQube 6.2?
- Unit Test Coverage is not coming in Sonarqube
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Generally speaking you do have multiple options: (i assume you are using java, but there are equivalent solutions for other languages)
ignoring the whole class
There is a property called
sonar.exclusionwhich you can set to ignore that specific class. This needs to be set either yoursonar-project.propertiesor based on the scanner you are using. For details take a look hereignoring just some lines with issues
In the java world you can use line comments with
//NOSONAR <reason>to exclude lines from detection. There are equivalents in other languages too.ignoring just some issues on the class/method
In Java you can use the
@SuppressWarnings("<rule id>")to exclude issues from classes and methods for detection. see https://stackoverflow.com/a/30383335/3708208Define multiple ignore criteria for wildcard and rules
you can also define special settings in sonarqube, to ignore special files and folders via wildcard input, and which rules should be ignored. see https://stackoverflow.com/a/53639382/3708208