Bug 270987 - Code Analysis not working with current Version of phpcs and php-cs-fixer
Code Analysis not working with current Version of phpcs and php-cs-fixer
Status: RESOLVED FIXED
Product: php
Classification: Unclassified
Component: Code
8.2
All All
: P2 (vote)
: Dev
Assigned To: junichi11
issues@php
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-28 08:10 UTC by OwnerOfThisIsle
Modified: 2017-08-21 06:31 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
screenshot of Enabled option (11.10 KB, image/png)
2017-07-05 04:56 UTC, junichi11
Details

Note You need to log in before you can comment on or make changes to this bug.
Description OwnerOfThisIsle 2017-06-28 08:10:18 UTC
In both cases the problem is that it uses wrong cmd line arguments:

Case PHPCS:
If I use the Feature under Source->Inspect...
Then choose Code Sniffer:
It uses the not working Parameter --runtime-set Default_standard PSR2
when it should correctly use --Standard PSR2
The former worked in older Versions of phpcs, but is not allowed anymore.
Details:
https://github.com/squizlabs/PHP_CodeSniffer/issues/1529

Case PHP-CS-FIXER
If I use the Feature under Source->Inspect...
Then choose Coding Standards Fixer:
It uses the not working Parameter --level PSR2
which leads to the Output
[Symfony\Component\Console\Exception\RuntimeException]  
  The "--level" option does not exist.  




In General:
Since those cmd line arguments seem to be not constant enough, it might be a better alternative to provide an Option to add custom Parameters in the config 
area Tools->Options->PHP->Code Analysis
Comment 1 Tomas Mysik 2017-06-29 06:47:43 UTC
Junichi could be interested in this issue I guess ;)

Thanks.
Comment 2 junichi11 2017-06-29 11:33:49 UTC
I'll try to look at it later.

Thanks.
Comment 3 junichi11 2017-07-05 04:56:17 UTC
Created attachment 164693 [details]
screenshot of Enabled option

Tomas, currently, If a customizer is used, all analyzer's commands are run. So, I think that "Enabled" option should be added to each analyzer customizer panel. May I do it?
Comment 4 Tomas Mysik 2017-07-05 08:25:18 UTC
Feel free to do whatever is needed and/or you think that should be done :)

Thanks!
Comment 5 junichi11 2017-07-05 11:20:55 UTC
(In reply to Tomas Mysik from comment #4)
> Feel free to do whatever is needed and/or you think that should be done :)

I'll do it. Thank you for your answer!
Comment 6 junichi11 2017-07-05 23:37:02 UTC
Fixed.

http://hg.netbeans.org/web-main/rev/c06ab7245812

Code Sniffer:
Use --standard=PSR2 instead of --runtime-set default_standard PSR2.

CS-Fixer:
Add a version ComboBox.
If version 2 is selected, just show the option text field.

All analyzers:
Add an "Enabled" checkbox to each customizer panel.


@OwnerOfThisIsle
Could you verify it when it will be available in a development build?

Thanks!
Comment 7 OwnerOfThisIsle 2017-07-06 06:52:46 UTC
I think I could check, when and where can I get a dev build?
Comment 8 junichi11 2017-07-06 07:00:00 UTC
(In reply to OwnerOfThisIsle from comment #7)
> I think I could check, when and where can I get a dev build?

If it is available, a message is added automatically to this issue. Probably, tomorrow or later.

You can download it here[1].

[1] http://bits.netbeans.org/download/trunk/nightly/latest/

Thanks.
Comment 9 junichi11 2017-07-20 22:33:22 UTC
Although a message is not added, probably this is available in a dev version because the new dev version is released.

Thanks.
Comment 10 OwnerOfThisIsle 2017-08-17 09:04:39 UTC
Hi, i tried a nightly and saw the PHPCS Call using the correct param.
Unfortunately I cannot tell much more, cause the nightly was pretty unstable and kept throwing popup Windows at me..
Comment 11 junichi11 2017-08-18 06:18:49 UTC
(In reply to OwnerOfThisIsle from comment #10)
> Hi, i tried a nightly and saw the PHPCS Call using the correct param.

Thanks for your verification!

> Unfortunately I cannot tell much more, cause the nightly was pretty unstable
> and kept throwing popup Windows at me..

Does it mean that Code Analysis features have a problem? It would be nice if you can check your log.
Comment 12 OwnerOfThisIsle 2017-08-18 07:22:21 UTC
I can't tell if the Errors are related:

java.lang.StackOverflowError
	at java.util.HashMap.putVal(HashMap.java:628)
	at java.util.HashMap.put(HashMap.java:611)
	at java.util.HashSet.add(HashSet.java:219)
	at org.netbeans.modules.javascript2.model.api.ModelUtils.resolveTypeFromSemiType(ModelUtils.java:639)
	at org.netbeans.modules.javascript2.model.api.ModelUtils.resolveAssignments(ModelUtils.java:1294)
	at org.netbeans.modules.javascript2.model.api.ModelUtils.resolveAssignments(ModelUtils.java:1262)
	at org.netbeans.modules.javascript2.model.api.ModelUtils.resolveTypes(ModelUtils.java:1215)
	at org.netbeans.modules.javascript2.model.api.ModelUtils.resolveTypes(ModelUtils.java:1232)
	at org.netbeans.modules.javascript2.model.api.ModelUtils.resolveTypes(ModelUtils.java:1232)
	at
... hundred times the last two lines

They occur often (2 per Minute) and look more less the same as above.
Comment 13 junichi11 2017-08-21 06:31:05 UTC
(In reply to OwnerOfThisIsle from comment #12)
> I can't tell if the Errors are related:
> 
> java.lang.StackOverflowError
> 	at java.util.HashMap.putVal(HashMap.java:628)
> 	at java.util.HashMap.put(HashMap.java:611)
> 	at java.util.HashSet.add(HashSet.java:219)
> 	at
> org.netbeans.modules.javascript2.model.api.ModelUtils.
> resolveTypeFromSemiType(ModelUtils.java:639)
> 	at
> org.netbeans.modules.javascript2.model.api.ModelUtils.
> resolveAssignments(ModelUtils.java:1294)
> 	at
> org.netbeans.modules.javascript2.model.api.ModelUtils.
> resolveAssignments(ModelUtils.java:1262)
> 	at
> org.netbeans.modules.javascript2.model.api.ModelUtils.
> resolveTypes(ModelUtils.java:1215)
> 	at
> org.netbeans.modules.javascript2.model.api.ModelUtils.
> resolveTypes(ModelUtils.java:1232)
> 	at
> org.netbeans.modules.javascript2.model.api.ModelUtils.
> resolveTypes(ModelUtils.java:1232)
> 	at
> ... hundred times the last two lines
> 
> They occur often (2 per Minute) and look more less the same as above.

Thank you!
It seems that JavaScript area has a problem. You should report it with detail as a new issue if possible.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo