How to know which rules Sonar uses when analyzing with a specific versioning?

hello good, at present I am applying the impose the version of java 1.4 and 1.6 for the analysis of it, I would like to know where I can find the rules that it uses.

Beforehand thank you very much

Hi,

Sorry, but I’m having a hard time understanding the question. Could you restate what you’re looking for?

 
Ann

Hi ann
, I would like to know how to identify the rules that sonar applies when specifically analyzing a version of code, for example if I apply the versioning of 1.4 or 1.6 java, where can I find these rules.

Hi,

The default is that everything is on.

If you take a look at the list of tags on Java rules, you’ll see a series of “java7”, “java8”, &etc. Those rules are turned off when sonar.java.source is set for a lower version (docs). That only starts at Java 7 though; there’s nothing specific for e.g. Java 1.4 or 1.6.

 
HTH,
Ann

Hello good afternoon, I understand that we can work with previous versions and what the limitations are, however it is not clear to me what the rules are that apply to each particular case, for example if I run an inspection for a Java7 project according to my sonar is only 1 rule corresponds to that version, which would be applying plus all the other rules that are associated with this and later, without counting the most recent ones that will be omitted as those of 8 or more, but how can I know which ones they are exactly, like to list them for example.

Hi,

Sorry, but I’m a bit confused by this.

Here’s how it works:

  • does the rule target a Java version?
    • no - run the rule
    • yes - is sonar.java.source set to that version or higher?
      • yes - run the rule
      • no - don’t run the rule

 
HTH,
Ann

What happens with this list of rules that do not have the java tag, do they apply to all versions of java or to a specific one?

Hi,

If there’s no tag, it runs for all versions.

 
HTH,
Ann

thacks so much