Checkstyle project on nemo.sonarqube.com

191 views
Skip to first unread message

Roman Ivanov

unread,
Jun 30, 2015, 9:53:46 PM6/30/15
to sona...@googlegroups.com
Hi Sonar team,

I am owner of Checkstyle project, checkstyle project has a profile at http://nemo.sonarqube.org/dashboard/index?id=com.puppycrawl.tools%3Acheckstyle
Last analysis was done at - Version 6.8-SNAPSHOT / June 2 2015 9:51 PM 

Please let me know period of refresh ? Can it be set up to one a week or so ? 

We are pretty active in development and static analysis issues resolving. 
Is it possible for me (as owner of Checkstyle project) adjust rules(suppression) in SonarQube for checkstyle project ? 

We a have bunch of false-positives/wontfix that I would like to suppress. 
Example: "TODO" strings in TODOCommnetCheck - it is not avoidable as "TODO" is part of javadoc, Indentation parameters ....


We have a link from our github page to sonarqube profile - https://github.com/checkstyle/checkstyle/blob/master/README.md , I we would like to keep Sonar analysis up to date, and let other see our status.

thanks,
Roman Ivanov

Fabrice Bellingard

unread,
Jul 1, 2015, 6:39:47 AM7/1/15
to Roman Ivanov, sona...@googlegroups.com
Hi Roman,

projects are analyzed weekly on Nemo. For Checkstyle, I've checked the jobs and the build is failing:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:37.456s
[INFO] Finished at: Wed Jul 01 06:49:14 CEST 2015
[INFO] Final Memory: 44M/495M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project checkstyle: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test failed: There was an error in the forked process
[ERROR] java.lang.NoClassDefFoundError: com/puppycrawl/tools/checkstyle/api/CheckstyleException
[ERROR] at java.lang.Class.getDeclaredMethods0(Native Method)
[ERROR] at java.lang.Class.privateGetDeclaredMethods(Class.java:2570)
[ERROR] at java.lang.Class.getMethod0(Class.java:2813)
[ERROR] at java.lang.Class.getMethod(Class.java:1663)
[ERROR] at org.apache.maven.surefire.util.ReflectionUtils.tryGetMethod(ReflectionUtils.java:57)
[ERROR] at org.apache.maven.surefire.common.junit3.JUnit3TestChecker.isSuiteOnly(JUnit3TestChecker.java:64)
[ERROR] at org.apache.maven.surefire.common.junit3.JUnit3TestChecker.isValidJUnit3Test(JUnit3TestChecker.java:59)
[ERROR] at org.apache.maven.surefire.common.junit3.JUnit3TestChecker.accept(JUnit3TestChecker.java:54)
[ERROR] at org.apache.maven.surefire.common.junit4.JUnit4TestChecker.accept(JUnit4TestChecker.java:52)
[ERROR] at org.apache.maven.surefire.util.DefaultScanResult.applyFilter(DefaultScanResult.java:97)
[ERROR] at org.apache.maven.surefire.junit4.JUnit4Provider.scanClassPath(JUnit4Provider.java:222)
[ERROR] at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:107)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
[ERROR] Caused by: java.lang.ClassNotFoundException: com.puppycrawl.tools.checkstyle.api.CheckstyleException
[ERROR] at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
[ERROR] at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
[ERROR] at java.security.AccessController.doPrivileged(Native Method)
[ERROR] at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
[ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
[ERROR] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
[ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
[ERROR] ... 15 more
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

FYI, the command used to build the project is:

mvn clean install cobertura:cobertura -Dcobertura.report.format=xml -Dmaven.test.failure.ignore=true -V -Dcheckstyle.skip=true -Dpmd.skip=true -Dcobertura.skip=true


Any idea what's going wrong?




Best regards,

Fabrice BELLINGARD | SonarSource
SonarQube Platform Product Manager
http://sonarsource.com

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/56760e9e-fc5a-469d-8730-87349bf104be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Roman Ivanov

unread,
Jul 1, 2015, 8:10:26 PM7/1/15
to Fabrice Bellingard, sona...@googlegroups.com
Hi Fabrice,

It not clear for me why you do "cobertura:cobertura" and " -Dcobertura.skip=true" in the same time

if you need cobertura XML report, you can do:
mvn clean install cobertura:cobertura -Dpmd.skip=true -Dfindbugs.skip=true -Dcheckstyle.ant.skip=true

FYI (almost always green, a lot of build configs):

If smth is still not working - please let me know, I will assist.

thanks,
Roman Ivanov

Fabrice Bellingard

unread,
Jul 6, 2015, 2:56:27 AM7/6/15
to Roman Ivanov, sona...@googlegroups.com
Hi Roman,

the problem is that you have set to some minimum coverage threshold that fail the build when not reached:

[INFO] <<< cobertura-maven-plugin:2.7:check (default) @ checkstyle <<<
[INFO]
[INFO] --- cobertura-maven-plugin:2.7:check (default) @ checkstyle --- [INFO] Cobertura 2.1.1 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
[INFO] Cobertura: Loaded information on 353 classes.
[ERROR] com.puppycrawl.tools.checkstyle.filters.SuppressionsLoader failed coverage check. Line coverage rate of 76.9% is below 77.0%
[ERROR] com.puppycrawl.tools.checkstyle.checks.metrics.NPathComplexityCheck failed coverage check. Line coverage rate of 89.6% is below 90.0%
[ERROR] com.puppycrawl.tools.checkstyle.checks.ClassResolver failed coverage check. Line coverage rate of 92.9% is below 93.0%
[ERROR] com.puppycrawl.tools.checkstyle.api.FileContents failed coverage check. Line coverage rate of 92.8% is below 93.0%
[ERROR] com.puppycrawl.tools.checkstyle.checks.coding.AbstractSuperCheck failed coverage check. Line coverage rate of 87.9% is below 88.0% [INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3:42.905s
[INFO] Finished at: Mon Jul 06 08:12:32 CEST 2015
[INFO] Final Memory: 63M/495M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:cobertura-maven-plugin:2.7:check (default) on project checkstyle: Coverage check failed. See messages above. -> [Help 1]


, which don't play well with SQ analyses.




Best regards,

Fabrice BELLINGARD | SonarSource
SonarQube Platform Product Manager
http://sonarsource.com

Roman Ivanov

unread,
Jul 6, 2015, 4:27:13 PM7/6/15
to Fabrice Bellingard, sona...@googlegroups.com
do you have possibility to launch us against java8 ?

cobertura give different  results on java8 and java7. Our build system using java8 - https://travis-ci.org/checkstyle/checkstyle/jobs/69790501

Fabrice Bellingard

unread,
Jul 7, 2015, 3:26:35 AM7/7/15
to Roman Ivanov, sona...@googlegroups.com
On Mon, Jul 6, 2015 at 10:27 PM, Roman Ivanov <romani...@gmail.com> wrote:
do you have possibility to launch us against java8 ?

Maybe we could, but that would not solve the original problem which is the threshold that you've set. I'd recommend you to move the configuration for the checks of the Cobertura plugin into a dedicated Maven profile, so that it's not executed all the time.

Roman Ivanov

unread,
Jul 8, 2015, 12:22:49 AM7/8/15
to Fabrice Bellingard, sona...@googlegroups.com
Hi Fabrice,

Maybe we could, but that would not solve the original problem which is the threshold that you've set.

It will resolve a problem,as it work for all contributors and for our CI system - https://github.com/checkstyle/checkstyle/blob/master/.travis.yml#L30https://travis-ci.org/checkstyle/checkstyle/jobs/69812460
We know that problem.

 I'd recommend you to move the configuration for the checks of the Cobertura plugin into a dedicated Maven profile

Done.
Should work fine for java7.


Please let me know exact and final command you build our project , I will place that command to your CI to make sure we will never fail on your side again.

thanks,
Roman Ivanov

Fabrice Bellingard

unread,
Jul 8, 2015, 4:14:11 AM7/8/15
to Roman Ivanov, sona...@googlegroups.com
Thanks Roman, the build is back to green and the latest analysis available online: http://nemo.sonarqube.org/dashboard/index/com.puppycrawl.tools:checkstyle

The command is: 

mvn clean install cobertura:cobertura -Dcobertura.report.format=xml -Dmaven.test.failure.ignore=true -V -Dcheckstyle.skip=true -Dpmd.skip=true


Best regards,

Fabrice BELLINGARD | SonarSource
SonarQube Platform Product Manager
http://sonarsource.com

Roman Ivanov

unread,
Jul 8, 2015, 10:01:41 PM7/8/15
to Fabrice Bellingard, sona...@googlegroups.com
Hi Fabrice,

Thanks a lot, we will try to resolve all violations.
lets come base to questions from original post :

Please let me know period of refresh ? Can it be set up to ones a week or so ? 

We are pretty active in development and static analysis issues resolving. 
Is it possible for me (as owner of Checkstyle project) adjust rules(suppression) in SonarQube for checkstyle project ? 

We a have bunch of false-positives/wontfix that I would like to suppress. 
Example: "TODO" strings in TODOCommnetCheck - it is not avoidable as "TODO" is part of javadoc, Indentation parameters ....


thanks,
Roman Ivanov

Fabrice Bellingard

unread,
Jul 9, 2015, 9:49:34 AM7/9/15
to Roman Ivanov, sona...@googlegroups.com
On Thu, Jul 9, 2015 at 4:01 AM, Roman Ivanov <romani...@gmail.com> wrote:
Hi Fabrice,

Thanks a lot, we will try to resolve all violations.
lets come base to questions from original post :

Please let me know period of refresh ? Can it be set up to ones a week or so ? 

It's run once a week.
 

We are pretty active in development and static analysis issues resolving. 
Is it possible for me (as owner of Checkstyle project) adjust rules(suppression) in SonarQube for checkstyle project ? 

For the moment, this is not possible. There are chances that you'll be able to do so in the future, though.

Roman Ivanov

unread,
Jul 10, 2015, 11:24:31 PM7/10/15
to Fabrice Bellingard, sona...@googlegroups.com
Hi Fabrice,

For the moment, this is not possible. There are chances that you'll be able to do so in the future, though.

Is it possible for you or any other person to update suppression for our project by our polite request ?
 
I will provide detailed instructions , and will try to make a little iteration as possible to not bother you too much.


thanks,
Roman Ivanov

Freddy Mallet

unread,
Jul 17, 2015, 11:09:10 AM7/17/15
to Roman Ivanov, Fabrice Bellingard, sona...@googlegroups.com
Hi Roman,

Feel free to communicate the exclusion filters that you'd like apply to the Checkstyle project.

++


Freddy MALLET | SonarSource
Product Director & Co-Founder
http://sonarsource.com

Roman Ivanov

unread,
Aug 27, 2015, 8:09:20 PM8/27/15
to Freddy Mallet, Fabrice Bellingard, sona...@googlegroups.com
Hi Freddy,

please mark as "wont fix" following cases:

there is no other way to work with javadoc , com.sun.javadoc package is still not deprecated.

2) 
TODO is a part of documentation we need to keep it.

3)
All violations are against c-tors, we intentionally put avoid setters, so all data should come through c-tor arguments.

4)
Standard output is used only in one class that that our CLI (Main.java) that is ok, usage of logger is not appropriate.

thanks,
Roman Ivanov

Roman Ivanov

unread,
Sep 3, 2015, 2:43:04 PM9/3/15
to SonarQube, freddy...@sonarsource.com, fabrice.b...@sonarsource.com
Hi Freddy,

Sorry to bother you and I do know that you are busy with Sonar , and my requests will never be in priority.

As you do not have time to mark cases as "Wontfix" that I described in post above , please delegate that to other engineer. 
G. Ann Campbell, already helped as for some cases at https://groups.google.com/forum/#!topic/sonarqube/e5xnjMxnz04
Please let her to do help us, if that possible.

We are focused on Sonar validation resolving to make them 0 or close to 0, we plan to resolve all cases during September. 
That will help us keep that nemo profile as active and keep it "must fix" from day to day development.
Right now we have too much "wontfixes" that make profile non-usable.

thanks,
Roman Ivanov

Roman Ivanov

unread,
Nov 3, 2015, 5:39:51 PM11/3/15
to SonarQube, fabrice.b...@sonarsource.com
Hi Fabrice,

Please take a look why we lost UTs coverage



thanks,
Roman Ivanov

G. Ann Campbell

unread,
Nov 4, 2015, 9:30:25 AM11/4/15
to SonarQube, fabrice.b...@sonarsource.com
Hi Roman,

First, I would probably be better to start a new thread when the topic changes, although I understand wanting to refer to the history in this one.

I spent a good deal of time in the last few weeks cleaning up nemo projects where analysis was failing. Details are murky at this point, and the logs are gone by now, but from the project history, it appears that your project simply didn't analyze for most of October. There was a successful analysis on Sept. 27, and another on Oct. 11, and that's it. I remember fiddling with the project and getting it to analyze - I guess on the 11th. It worked again on the 28th but has been failing since then:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19:test (default-test) on project checkstyle: Error occurred in starting fork, check output in log -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Here are the checkout and build:

Fetching upstream changes from https://github.com/checkstyle/checkstyle.git
 > git --version
 > git fetch --tags --progress https://github.com/checkstyle/checkstyle.git +refs/heads/*:refs/remotes/origin/*
 > git rev-parse origin/master^{commit}
Checking out Revision 6354f009e8ae25dcbc539df2c06e0395e0bd3bdb (origin/master)
 > git config core.sparsecheckout
 > git checkout -f 6354f009e8ae25dcbc539df2c06e0395e0bd3bdb
 > git rev-list 6354f009e8ae25dcbc539df2c06e0395e0bd3bdb
 > git tag -a -f -m Jenkins Build #296 jenkins-ZZZZ_COBERTURA_checkstyle-296
[ZZZZ_COBERTURA_checkstyle] $ /scratch/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.0.5/bin/mvn clean install cobertura:cobertura -Dcobertura.report.format=xml -Dmaven.test.failure.ignore=true -V -Dcheckstyle.skip=true -Dpmd.skip=true -U

Feel free to advise.


Ann
Reply all
Reply to author
Forward
0 new messages