by mywittyname · 8y ago · 0 comments
It would be a lot of work, but I think it's easier than trying to get authors of defunked blogs to take down 10 year old answers.
As a side-effect, this increases awareness among developers that you can't blindly accept what's on SO. If developers begin to lose trust in SO, then SO is going to be incentivized to do something about, or go the way of expertsexchange.
For greenfield projects it can be a godsend, if you have the experience to know which warnings you should disable and the discipline to keep the entire code base warning-free. I've done this with StyleCop / FxCop in C#.
Here's a list of PHP static analysis tools: https://github.com/exakat/php-static-analysis-tools
[0]: https://plugins.jetbrains.com/plugin/7622-php-inspections-ea...
I was thinking that they could do analysis on code snippets that are copy-pasted into the editor. It should be straight-forward to compare the contents to a finger-print database and issue a warning when they find a match to online code examples that are marked as vulnerable.
$sql = "SELECT * FROM table WHERE id = " . $_GET["id"];
It's all about education. This does apply to any language.