Closed rvantonder closed 8 years ago
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!
This is great! Thank you.
I hope this project is still active enough to take PRs :) I found pfff useful for detecting micro clones (small snippets of repeated expressions or statements). I added support for finding these in PHP boolean expressions. For example:
These errors are quite common, and it has found over a hundred cases in the top 1,000 PHP repositories on github (many of which are inactive though). Here is a collection of issues in active, popular (lots of stars) PHP github repositories that were fixed or are being fixed. Please see the commit message and files for further description.
Only PHP is supported in this PR, partly because it was most suitable to add this initially to scheck. The approach can be generalized to other languages (I have an experimental branch for Javascript).
There's also lots of room for extensions, including detecting other forms of micro clones (duplicate statements, duplicate conditional bodies, etc.) and generating patches based on detection.
This PR includes tests integrated into
scheck -test
andmake test
.