racodond / sonar-jproperties-plugin

SonarQube Java Properties Analyzer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FP on duplicated-keys-across-files: Treats the same keys in different gradle.properties as duplicates

koral-- opened this issue · comments

If the property with the same key is defined in gradle.properties of different modules then it is not a duplication. Modules may use the same or different properties on purpose. They are accessible only from buildscripts, not from source code of modules.
More info: https://docs.gradle.org/current/userguide/build_environment.html

Maybe if file is called gradle.properties and is located in the module root directory (by default it is the same directory where build.gradle is located) then it should be excluded from this check?

Plugin version: 2.3

Hi @koral--,

This rule is pretty generic and should be tuned according to your needs.
Because so many tools and frameworks use .properties files to set configuration, it is not possible to deal with all specific cases.

Thus, either you can deactivate the rule because it does not bring any value in your context or it raises too many false positives or you can tune the rule to exclude gradle.properties files to be checked against this rule (see http://docs.sonarqube.org/display/SONAR/Narrowing+the+Focus#NarrowingtheFocus-IgnoreIssues)

David

Thanks, I've already excluded **/gradle.properties but didn't recognized that this rule was designed to be generic.