-
Notifications
You must be signed in to change notification settings - Fork 9
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
Evaluate Tide, Psalm, PHPStan, etc #54
Comments
Even if we don't use them for custom sniffs, they may be useful for other things, like detecting code that's likely to produce a run-time fatal. |
Also |
https://github.com/phan/phan has similar philosophy to this project, but doesn't seem to have any security-focused stuff. https://github.com/webarx-security/wpbullet is specific for WP and security, but doesn't look active since the initial release. |
I got Psalm roughly working in the Security analysis is a secondary concern for them, so we may be better off w/ a security-focused tool like sonarqube ? There's no WP integration, though, and it could be a lot of work to create one (hi @dingo-d!). If we did though, the underlying SAST seems like it might be the most sophisticated and well-supported out there. There may be other folks in the community who'd also benefit, and we might be able to share the workload. Core could also benefit (cc @whyisjake). They acquired RIPS last year, who've contributed a lot to WP security in the past. They also ran CodeRisk (now offline), which had some very similar functionality to what we're trying to build here. |
https://github.com/exakat/php-static-analysis-tools lists a ton of tools |
I played around w/ sonarqube in the it might be that we'd have to write an extension (in Java) for it to understand that, e.g., |
I had tons of duplications on the text-domain strings, which you just cannot replace with a variable or a constant. SQ would benefit from a WP ruleset, but I never got the time to play around with it (and I don't know java 😂) |
Writing custom sniffs for PHPCS seems relatively difficult, and there are some modern tools like Tide, Psalm and PHPStan.
Would sniff development be easier in those? Maybe for some things like security, but not others? If it is better, it may not be worth migrating existing sniffs, but it could be a good option for future sniffs.
xref https://make.wordpress.org/meta/2021/04/27/automatically-catching-bugs-in-plugins/#comment-9144, https://make.wordpress.org/meta/2021/04/27/automatically-catching-bugs-in-plugins/#comment-9150
The text was updated successfully, but these errors were encountered: