Bug found in a CheckRule (UnusedFunctionParametersCheck.java)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Bug found in a CheckRule (UnusedFunctionParametersCheck.java)

Barry Krein

Hello everyone,

 

firstly thanks for the work put into Sonar!

 

I am setting up Sonar for our software and on the analyzing part it seems as if Sonar PHP Plugin has some problems with some files.

The files are part of an older Zend Framework.

 

I have attached one of the files.

 

Link the java file where the error occured in:

https://github.com/SonarCommunity/sonar-php/blob/d241fc0375e042fc4dde77d713b74e26a7dcd0b0/php-checks/src/main/java/org/sonar/php/checks/UnusedFunctionParametersCheck.java

 

I have looked at it but i have no clue what might be a problem wihtout knowing what the Java Code is actually doing, sorry.

So i hope someone here has an idea what might be the problem.

 

I have a hunch, maybe it’s because oft he breaks inside the method signatures. That’s the only „abnormality“ i have seen in that file.

 

For the time being i exclude every file that causes this error.

 

Here ist the Error to it:

 

INFO: ------------------------------------------------------------------------

INFO: EXECUTION FAILURE

INFO: ------------------------------------------------------------------------

Total time: 32:03.165s

Final Memory: 105M/8025M

INFO: ------------------------------------------------------------------------

ERROR: Error during Sonar runner execution

org.sonar.runner.impl.RunnerException: Unable to execute Sonar

        at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)

        at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)

        at java.security.AccessController.doPrivileged(Native Method)

        at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)

        at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)

        at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)

        at org.sonar.runner.api.Runner.execute(Runner.java:100)

        at org.sonar.runner.Main.executeTask(Main.java:70)

        at org.sonar.runner.Main.execute(Main.java:59)

        at org.sonar.runner.Main.main(Main.java:53)

Caused by: org.sonar.squidbridge.api.AnalysisException: Unable to analyze file: /XXX/XXX/XXX/XXX/XXX/Zend/Gdata/Gapps.php

        at org.sonar.squidbridge.AstScanner.scanFiles(AstScanner.java:127)

        at org.sonar.squidbridge.ProgressAstScanner.scanFiles(ProgressAstScanner.java:43)

        at org.sonar.plugins.php.PHPSquidSensor.analyse(PHPSquidSensor.java:104)

        at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:59)

        at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:51)

        at org.sonar.batch.phases.DatabaseModePhaseExecutor.execute(DatabaseModePhaseExecutor.java:120)

        at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:264)

        at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)

        at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)

        at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:235)

        at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:230)

        at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:220)

        at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)

        at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)

        at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:57)

        at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45)

        at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:135)

        at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)

        at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)

        at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:158)

        at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95)

        at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)

        at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:497)

        at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)

        ... 9 more

Caused by: java.lang.NullPointerException

        at org.sonar.php.checks.UnusedFunctionParametersCheck.visitNode(UnusedFunctionParametersCheck.java:119)

        at com.sonar.sslr.impl.ast.AstWalker.visitNode(AstWalker.java:114)

        at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:85)

        at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)

        at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)

        …

 

Thanks for any help!

 

Best regards!

 

Barry Krein

CTO / CIO

 

sig

 

NetDoktor.de GmbH  |  Erika-Mann-Straße 23  |  80636 München

 

Tel:

+49 89-7464669-81

Fax:

+49 89-7464669-1

E-Mail:

 

[hidden email]

 

Web:

http://www.netdoktor.de

Blog:

http://blog.netdoktor.de

Twitter: 

http://twitter.com/NetDoktorde

Facebook:

http://fb.com/NetDoktorde

 

Die NetDoktor.de GmbH ist ein Unternehmen der Verlagsgruppe Georg v. Holtzbrinck

Sitz, Erfüllungsort und Gerichtsstand München HRB 123340

Geschäftsführer: Markus Pöhlmann, Markus Schunk

 



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Gapps.php (85K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Bug found in a CheckRule (UnusedFunctionParametersCheck.java)

Linda Martin
Hello Barry,

Indeed you pointed out a bug, thank you! The following ticket has been created: SONARPHP-467
It has been fixed and it will be available in PHP Plugin version 2.6. 

In the mean time, you can download here a SNAPSHOT version that contains the fix
in order to verify that it fixes the issues on your side.

Thank you,

Best regards,

Linda.

On 21 May 2015 at 15:34, Barry Krein <[hidden email]> wrote:

Hello everyone,

 

firstly thanks for the work put into Sonar!

 

I am setting up Sonar for our software and on the analyzing part it seems as if Sonar PHP Plugin has some problems with some files.

The files are part of an older Zend Framework.

 

I have attached one of the files.

 

Link the java file where the error occured in:

https://github.com/SonarCommunity/sonar-php/blob/d241fc0375e042fc4dde77d713b74e26a7dcd0b0/php-checks/src/main/java/org/sonar/php/checks/UnusedFunctionParametersCheck.java

 

I have looked at it but i have no clue what might be a problem wihtout knowing what the Java Code is actually doing, sorry.

So i hope someone here has an idea what might be the problem.

 

I have a hunch, maybe it’s because oft he breaks inside the method signatures. That’s the only „abnormality“ i have seen in that file.

 

For the time being i exclude every file that causes this error.

 

Here ist the Error to it:

 

INFO: ------------------------------------------------------------------------

INFO: EXECUTION FAILURE

INFO: ------------------------------------------------------------------------

Total time: 32:03.165s

Final Memory: 105M/8025M

INFO: ------------------------------------------------------------------------

ERROR: Error during Sonar runner execution

org.sonar.runner.impl.RunnerException: Unable to execute Sonar

        at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)

        at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)

        at java.security.AccessController.doPrivileged(Native Method)

        at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)

        at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)

        at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)

        at org.sonar.runner.api.Runner.execute(Runner.java:100)

        at org.sonar.runner.Main.executeTask(Main.java:70)

        at org.sonar.runner.Main.execute(Main.java:59)

        at org.sonar.runner.Main.main(Main.java:53)

Caused by: org.sonar.squidbridge.api.AnalysisException: Unable to analyze file: /XXX/XXX/XXX/XXX/XXX/Zend/Gdata/Gapps.php

        at org.sonar.squidbridge.AstScanner.scanFiles(AstScanner.java:127)

        at org.sonar.squidbridge.ProgressAstScanner.scanFiles(ProgressAstScanner.java:43)

        at org.sonar.plugins.php.PHPSquidSensor.analyse(PHPSquidSensor.java:104)

        at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:59)

        at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:51)

        at org.sonar.batch.phases.DatabaseModePhaseExecutor.execute(DatabaseModePhaseExecutor.java:120)

        at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:264)

        at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)

        at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)

        at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:235)

        at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:230)

        at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:220)

        at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)

        at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)

        at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:57)

        at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45)

        at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:135)

        at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)

        at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)

        at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:158)

        at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95)

        at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)

        at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:497)

        at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)

        ... 9 more

Caused by: java.lang.NullPointerException

        at org.sonar.php.checks.UnusedFunctionParametersCheck.visitNode(UnusedFunctionParametersCheck.java:119)

        at com.sonar.sslr.impl.ast.AstWalker.visitNode(AstWalker.java:114)

        at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:85)

        at com.sonar.sslr.impl.ast.AstWalker.visitChildren(AstWalker.java:99)

        at com.sonar.sslr.impl.ast.AstWalker.visit(AstWalker.java:87)

        …

 

Thanks for any help!

 

Best regards!

 

Barry Krein

CTO / CIO

 

sig

 

NetDoktor.de GmbH  |  Erika-Mann-Straße 23  |  80636 München

 

Tel:

<a href="tel:%2B49%2089-7464669-81" value="+4989746466981" target="_blank">+49 89-7464669-81

Fax:

+49 89-7464669-1

E-Mail:

 

[hidden email]

 

Web:

http://www.netdoktor.de

Blog:

http://blog.netdoktor.de

Twitter: 

http://twitter.com/NetDoktorde

Facebook:

http://fb.com/NetDoktorde

 

Die NetDoktor.de GmbH ist ein Unternehmen der Verlagsgruppe Georg v. Holtzbrinck

Sitz, Erfüllungsort und Gerichtsstand München HRB 123340

Geschäftsführer: Markus Pöhlmann, Markus Schunk

 



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Loading...