[NEW RELEASE] Sonar-Devon4j-Plugin 3.2.1

Hello everyone,

we from devonfw just released the 3.2.1 version of our sonar-devon4j-plugin and would love to have it on the marketplace and added to the plugin library.

This plugin validates davon4j architecture and conventions, read more under
our GitHub page: https://github.com/devonfw/sonar-devon4j-plugin/#sonar-devon4j-plugin

Changelog: https://github.com/devonfw/sonar-devon4j-plugin/blob/master/CHANGELOG.adoc

SonarCloud analysis: https://sonarcloud.io/dashboard?id=devonfw_sonar-devon4j-plugin

PR to sonar-update-center: https://github.com/SonarSource/sonar-update-center-properties/pull/78

Thanks a lot and greetings
Lmar

Old thread to connect the history:

Hi Lmar,

FYI, this hasnā€™t been overlooked. Itā€™s on my list, but not at the top.

Ā 
:smiley:
Ann

Dear Ann,

Thanks for the feedback. No worries. It took us almost a year to get to this point. Will not hurt if it takes another week or two. Thanks for having us on your list. :smile:

Cheers
Jƶrg

1 Like

Still not forgotten. :slightly_smiling_face:

Hi,

Sorry for the looong delay. I finally got to this. Iā€™ve asked for a few changes in your PR. Other than that, weā€™re good to go!

In addition, I have some non-blocking feedback on the plugin. Tracing the threads back, I see that I tested a while ago, but since it has been >1y and it was a new version I wanted to test again.

  • For class- and method-level issues, youā€™ve marked the entire body of the class/method as the issue location. This has the disadvantage of a) being irritating, b) putting your issue message at the bottom of a potentially long block of relevant(?) text. E.G.


    I suggest instead you only use the name/declaration as the issue location.

  • Youā€™ve used colors in your rule descriptions (bravo on adding them! :smiley:) to indicate noncompliant/compliant code sections. Just be aware that this may not be accessible for the colorblind
    Selection_843
    I know we may not present the best example in this area, but weā€™re aware of it and working on it iteratively. :slight_smile:

So! Update your PR per my review, and thatā€™s all we need.

Ā 
:smiley:
Ann

P.S. There was a recent thread about adding architectural checks. You might want to find it and give yourself a plug. :smiley:

Youā€™re in!

Ā 
:smiley:
Ann

1 Like

Great! Thanks for all your help and guidance.

Lmar

Hi Lmar,

As a followup, I still have your plugin loaded in my instance (because Iā€™m lazy) and I just analyzed a project with no Devon4j-related files/etc. I got a lot of NPEs in my analysis logs with instructions to ā€œreport this problem to SonarSourceā€ here in the community. Iā€™m guessing those instructions didnā€™t come from you, but the NPEs did. :smiley:

[ERROR] Unable to run check class com.devonfw.ide.sonarqube.common.impl.check.naming.DevonNamingConventionInterfaceExtendsInterfaceRepositoryCheck - N9 on file 'src/main/java/com/sonarsource/ruleapi/utilities/package-info.java', To help improve SonarJava, please report this problem to SonarSource : see https://www.sonarqube.org/community/
java.lang.NullPointerException: null
	at com.devonfw.ide.sonarqube.common.impl.check.naming.DevonNamingConventionInterfaceExtendsInterfaceCheck.scanFile(DevonNamingConventionInterfaceExtendsInterfaceCheck.java:44)
	at org.sonar.java.model.VisitorsBridge.runScanner(VisitorsBridge.java:149)
	at org.sonar.java.model.VisitorsBridge.lambda$visitFile$1(VisitorsBridge.java:140)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
	at org.sonar.java.model.VisitorsBridge.visitFile(VisitorsBridge.java:140)
	at org.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:90)
	at org.sonar.java.ast.JavaAstScanner.scan(JavaAstScanner.java:67)
	at org.sonar.java.JavaSquid.scanSources(JavaSquid.java:115)
	at org.sonar.java.JavaSquid.scan(JavaSquid.java:109)
	at org.sonar.plugins.java.JavaSquidSensor.execute(JavaSquidSensor.java:88)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59)
	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:387)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:383)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:346)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:141)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at com.sun.proxy.$Proxy23.execute(Unknown Source)
	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
	at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:65)
	at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:104)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:956)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:192)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

It would be nice if you would

  • prioritize this for your next release
  • keep an eye on the community to field these reports until at least your next release

Ā 
Thx!
Ann

Hi Ann,

thanks for the find, I will look into it :smiley:

Are the NPEs only throwns when trying to check package-info.java files or is it the same issue with ā€˜normalā€™ .java files containing classes?

Greetings
Lmar

Hi Lmar,

I didnā€™t notice & my analysis logs are gone. And after encountering this I finally did clean out my plugins directory. But let me know if you canā€™t recreate it on your side & Iā€™ll give it a go.

 
Ann

Hi Ann,

itā€™s all good, the issue should be fixed now and will be live with the next release :slight_smile:

Lmar

1 Like