Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UT validation of checkstyle-model.xml #92

Closed
rnveach opened this issue Mar 17, 2017 · 5 comments
Closed

Add UT validation of checkstyle-model.xml #92

rnveach opened this issue Mar 17, 2017 · 5 comments
Labels

Comments

@rnveach
Copy link
Member

rnveach commented Mar 17, 2017

Not identified in #28 (comment) but should be part of it,

https://github.com/checkstyle/sonar-checkstyle/blob/1e94e2a197deffc0b64e2320e14e0ea597a86f21/checkstyle-sonar-plugin/src/main/resources/com/sonar/sqale/checkstyle-model.xml

There is currently no validation on this file and it contains information on different Checkstyle checks.

We need to investigate what this file is used for and how some XML fields relate to the Check for proper validation.

@rnveach
Copy link
Member Author

rnveach commented Mar 28, 2017

Currently checks in the file are split into multiple groups.
Software - which contains only NewlineAtEndOfFileCheck
Security features - which contains only HeaderCheck
Memory use - which contains only SuperFinalizeCheck
Processor use - which contains only SuperCloneCheck
Maintainability - which contains 1000 lines of checks (not sure on count)
and more.

There is also Compiler, Hardware, Language, OS, etc.
Full list of characteristics can be found at: https://github.com/SonarSource/sonarqube/blob/cfa372a57a3065302dc92c77f3ba2068c7ddf771/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinition.java#L164-L372

Besides Maintainability it is not really clear why those checks were placed into those groups.
This kind of split may be harder to maintain and validate too. Should we just ensure all checks are listed and assume their location is valid?

@rnveach
Copy link
Member Author

rnveach commented Mar 28, 2017

The following checks are missing from the file:

com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck
com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineCheck
com.puppycrawl.tools.checkstyle.checks.regexp.RegexpMultilineCheck
com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck
com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck
com.puppycrawl.tools.checkstyle.checks.DescendantTokenCheck
com.puppycrawl.tools.checkstyle.checks.imports.ImportControlCheck
com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck
com.puppycrawl.tools.checkstyle.checks.TranslationCheck
com.puppycrawl.tools.checkstyle.checks.regexp.RegexpCheck
com.puppycrawl.tools.checkstyle.checks.FileContentsHolder
com.puppycrawl.tools.checkstyle.checks.regexp.RegexpOnFilenameCheck
com.puppycrawl.tools.checkstyle.checks.SuppressWarningsHolder

Where should they be placed and how should their debt be rated?

AnnotationLocationCheck is listed, but is listed under the wrong package.

@romani
Copy link
Member

romani commented Apr 5, 2017

I think we should use only "Maintainability", that is kind of general.

Memory use - which contains only SuperFinalizeCheck
Processor use - which contains only SuperCloneCheck

left them as is.

Software - which contains only NewlineAtEndOfFileCheck
Security features - which contains only HeaderCheck

Should go to "Maintainability".

Where should they be placed and how should their debt be rated?

Should go to "Maintainability". Let find some defaults (most used values amount all) and this values them. I do not care. Users probably too. Sonar's estimation of how much time it takes to fix violation is always wrong, just always.

@muhlba91
Copy link
Contributor

sqale is questionable - closing this as investigative issue for sqale is located in #219

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants