-
Notifications
You must be signed in to change notification settings - Fork 120
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
False Positive: Function argument(s) returned by "func_get_args" might have been modified #127
Comments
You are right, it just checks if a certain statement/call occurs before |
Cool. I'll go through the ones I've been given for MW/MW extensions, and try and get a list of "easy" to detect false positives, through to the more complex ones, but are still false +ve Of course, a workaround for this, code wise, is just to stash what's returned by Will get back to you in a bit Thanks! |
https://github.com/wikimedia/mediawiki So from mediawiki core I reckon these below should be identifiable as false positives. Some are more complex than others, but some are trivially simple Where variables that are manipulated aren't already named parameters in the function definition... Or noting related is touched Hope these are useful to find some test cases :)
|
Thank you for the examples. I think I've fixed most of the issues in 7bd1d16, except for
Fixing that requires reflecting on user-defined classes without loading them, which php7cc currently doesn't do. I'll think about integrating a library like |
Sweet. I think (not tested yet) you've fixed most of the SNR problems here, and a couple of "false positives" because of lack of knowledge of the actual code is ok. In this case, we could easily get rid of the warning by swapping the code around
to
Which would clear the warning too. Thanks! :) |
I don't know if you've tested it again against MediaWiki/some extensions... But I will do so and report back :) |
This seems to be rather a lot of false positives returned by this...
https://phabricator.wikimedia.org/source/mediawiki/browse/master/img_auth.php;1b0c9f6098c31d6bf16a00d37a8aa5cd493270e1$192
The only statements before this is
global $wgImgAuthDetails;
-- this isn't any modificationWe've seen a lot of these false positives in many functions when scanning MediaWiki and extensions deployed on Wikimedia sites
I can give you some more examples if you want to see if it's possible to improve the detection
The text was updated successfully, but these errors were encountered: