SystemsDK

PHP Copy/Paste Detector

  • Home
  • PHP Copy/Paste Detector

PHP Copy/Paste Detector

PHP Copy/Paste Detector is a Copy/Paste Detector for PHP code. It scans a PHP project for duplicated code, in order to “Don’t Repeat Yourself”.
 
Most developers would agree that simply copying and pasting code is a poor form of re-use and a bad practice in general. However, it is common because proper re-use takes extra time and money (in the short term).
 
Now you have possibility to save your time and use tool for detecting copy/paste. You can download tool on our GitHub page.

PHPCPD key features:

Protection against weak reuse

The real cost of developing software is not in the typing of the code, so simply duplicating code does little to increase productivity. Duplicating bugs over and over makes matters worse. In addition, the opportunity for collecting and documenting useful, reusable code is lost. Creating more code moves your code coverage metrics in the wrong direction and increases your testing burden.

Protection against duplicate bugs and security vulnerabilities

The most obvious problem is duplicating the problems inherent in the original code throughout the project. Worse still is that each copied version is usually modified for its specific context, making tracking down the bugs more difficult.

Protection against new errors

After code is copied it’s usually modified to suit its new location. Such modifications are typically a manual editing process and are thus prone to all of the sorts of human errors that plague any repetitive, manual task. These edits are often made hastily, without a full understanding of the original code, allowing for subtler semantic errors.