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

Sonar PMD Analysis issue #281

Open
ayush-c-gupta-db opened this issue Jun 3, 2021 · 2 comments
Open

Sonar PMD Analysis issue #281

ayush-c-gupta-db opened this issue Jun 3, 2021 · 2 comments

Comments

@ayush-c-gupta-db
Copy link

ayush-c-gupta-db commented Jun 3, 2021

Sonar PMD analysis is failing.

@ayush-c-gupta-db
Copy link
Author

We are getting below Error while running Sonar PMD Analysis

:
[07:13:08][Step 2/2] May 18, 2021 1:13:08 AM net.sourceforge.pmd.lang.java.rule.design.NPathComplexityRule getReportLevel
[07:13:08][Step 2/2] WARNING: Rule NPathComplexity uses deprecated property 'minimum'. Future versions of PMD will remove support for this property. Please use 'reportLevel' instead!
[07:13:08][Step 2/2] May 18, 2021 1:13:08 AM net.sourceforge.pmd.lang.java.rule.design.NPathComplexityRule getReportLevel
[07:13:08][Step 2/2] WARNING: Rule NPathComplexity uses deprecated property 'minimum'. Future versions of PMD will remove support for this property. Please use 'reportLevel' instead!
[07:13:08][Step 2/2] ERROR: Fail to execute PMD. Following file is ignored: esa-persistence/src/main/java/com/db/esa/impl/SearchHelper.java
[07:13:08][Step 2/2] net.sourceforge.pmd.PMDException: Error while parsing file:///home/dbtrace/buildAgent/work/4b0958ddc1a8da6f/esa-persistence/src/main/java/com/db/esa/impl/SearchHelper.java
[07:13:08][Step 2/2] at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:99)
[07:13:08][Step 2/2] at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:51)
[07:13:08][Step 2/2] at org.sonar.plugins.pmd.PmdTemplate.process(PmdTemplate.java:101)
[07:13:08][Step 2/2] at org.sonar.plugins.pmd.PmdExecutor.executeRules(PmdExecutor.java:131)
[07:13:08][Step 2/2] at org.sonar.plugins.pmd.PmdExecutor.executePmd(PmdExecutor.java:98)
[07:13:08][Step 2/2] at org.sonar.plugins.pmd.PmdExecutor.execute(PmdExecutor.java:80)
[07:13:08][Step 2/2] at org.sonar.plugins.pmd.PmdSensor.execute(PmdSensor.java:71)
[07:13:08][Step 2/2] at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
[07:13:08][Step 2/2] at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
[07:13:08][Step 2/2] at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59)
[07:13:08][Step 2/2] at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)
[07:13:08][Step 2/2] at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59)
[07:13:08][Step 2/2] at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
[07:13:08][Step 2/2] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
[07:13:08][Step 2/2] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
[07:13:08][Step 2/2] at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:400)
[07:13:08][Step 2/2] at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:395)
[07:13:08][Step 2/2] at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:358)
[07:13:08][Step 2/2] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
[07:13:08][Step 2/2] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
[07:13:08][Step 2/2] at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:141)
[07:13:08][Step 2/2] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
[07:13:08][Step 2/2] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
[07:13:08][Step 2/2] at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73)
[07:13:08][Step 2/2] at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
[07:13:08][Step 2/2] at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
[07:13:08][Step 2/2] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[07:13:08][Step 2/2] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[07:13:08][Step 2/2] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[07:13:08][Step 2/2] at java.lang.reflect.Method.invoke(Method.java:498)
[07:13:08][Step 2/2] at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
[07:13:08][Step 2/2] at com.sun.proxy.$Proxy0.execute(Unknown Source)
[07:13:08][Step 2/2] at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
[07:13:08][Step 2/2] at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
[07:13:08][Step 2/2] at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
[07:13:08][Step 2/2] at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
[07:13:08][Step 2/2] at org.sonarsource.scanner.cli.Main.main(Main.java:61)
[07:13:08][Step 2/2] Caused by: net.sourceforge.pmd.lang.java.ast.ParseException: Line 75, Column 53: Cannot use the diamond generic notation when running in JDK inferior to 1.7 mode!
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.throwParseException(JavaParser.java:23)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.checkForBadDiamondUsage(JavaParser.java:88)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.TypeArguments(JavaParser.java:2270)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.ClassOrInterfaceType(JavaParser.java:2195)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.AllocationExpression(JavaParser.java:4623)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.PrimaryPrefix(JavaParser.java:3918)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.PrimaryExpression(JavaParser.java:3731)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.PostfixExpression(JavaParser.java:3593)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.UnaryExpressionNotPlusMinus(JavaParser.java:3555)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.UnaryExpression(JavaParser.java:3408)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.MultiplicativeExpression(JavaParser.java:3302)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.AdditiveExpression(JavaParser.java:3249)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.ShiftExpression(JavaParser.java:3192)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.RelationalExpression(JavaParser.java:3131)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.InstanceOfExpression(JavaParser.java:3095)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.EqualityExpression(JavaParser.java:3042)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.AndExpression(JavaParser.java:3002)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.ExclusiveOrExpression(JavaParser.java:2962)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.InclusiveOrExpression(JavaParser.java:2922)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.ConditionalAndExpression(JavaParser.java:2882)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.ConditionalOrExpression(JavaParser.java:2842)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.ConditionalExpression(JavaParser.java:2804)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.Expression(JavaParser.java:2661)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.VariableInitializer(JavaParser.java:1460)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.VariableDeclarator(JavaParser.java:1335)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.LocalVariableDeclaration(JavaParser.java:5051)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.BlockStatement(JavaParser.java:4971)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.Block(JavaParser.java:4932)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.MethodDeclaration(JavaParser.java:1615)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.ClassOrInterfaceBodyDeclaration(JavaParser.java:1239)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.ClassOrInterfaceBody(JavaParser.java:1194)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.ClassOrInterfaceDeclaration(JavaParser.java:650)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.TypeDeclaration(JavaParser.java:539)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.ast.JavaParser.CompilationUnit(JavaParser.java:276)
[07:13:08][Step 2/2] at net.sourceforge.pmd.lang.java.AbstractJavaParser.parse(AbstractJavaParser.java:59)
[07:13:08][Step 2/2] at net.sourceforge.pmd.SourceCodeProcessor.parse(SourceCodeProcessor.java:111)
[07:13:08][Step 2/2] at net.sourceforge.pmd.SourceCodeProcessor.processSource(SourceCodeProcessor.java:175)
[07:13:08][Step 2/2] at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:96)
[07:13:08][Step 2/2] ... 36 common frames omitted
[07:13:08][Step 2/2]
:

Sonar Version : 7.9,1
PMD Plugin Version: 3.2.1
Java version : openjdk version "11.0.8

@jborgers
Copy link
Owner

It should work in Sonar 8.9/9.4 with sonar-pmd plugin 3.4.0. Can you try?

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

No branches or pull requests

2 participants