![]() Concretely, rules which are designed to target specific java versions (tagged "java7" or "java8") are activated by default in the Sonar Way Java profile. Java version-specific rules are not disabled when is not provided. The feature relies entirely on the property, which is automatically filled by most of the scanners used for analyses (Maven, Gradle). This feature allows the deactivation of rules that target higher versions of Java than the one in use in the project so that false positives aren't generated from irrelevant rules. Java analysis is able to react to the java version used for sources. But if you only want to deactivate a rule across a subset of a file - all the lines of a method or a class - you can use rule keys: "java:S3546"}). If you need to deactivate a rule (or all rules) for an entire file, then issue exclusions are the way to go. The best way to deactivate an individual issue you don't intend to fix is to mark it "Won't Fix" or "False Positive" through the SonarQube UI. This option can of course be added to your sonar.properties configuration. For example, for a Java 8 project, by setting it as follows: =/usr/lib/jvm/jdk1.8.0_211 # Here maven uses the default version of Java on the system but we specify that we want to analyze a Java 8 project. When setting, you need to provide the path to the JDK directory used by the project being analyzed, if different from the Java runtime executing the analysis. Not setting this property, while it would have been required, usually leads to inconsistent or even impossible to fix issues being reported, especially in relation with native JDK classes. By doing this you will specify which JDK classes the analyzer must refer to during the analysis. If this is your case, you will need to set the property manually to point the appropriate JDK (see below). The most common case is to run the analysis with Java 11, while the project itself uses Java 8 or before for its build. In some situations, you might have to analyze a project built with a different version of Java than the one executing the analysis. Wildcards can be used: =directory/**/*.jarĪndroid users, Jack doesn't provide the required. (For example, this should include the junit jar). Wildcards can be used: =path/to/Library.jar,directory/**/*.jarĬomma-separated paths to directories containing the compiled bytecode files corresponding to your test filesĬomma-separated paths to files with third-party libraries (JAR or Zip files) used by your tests. Comma-separated paths to directories containing the compiled bytecode files corresponding to your source files.Ĭomma-separated paths to files with third-party libraries (JAR or Zip files) used by your project. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |