Wednesday, October 10, 2012

PHP Copy and Paste detection tool installation

In order to install it you will need to:

1. Upgrade to latest PHPUnit 3.7
2. Install https://github.com/theseer/fDOMDocument (see instructions inside)
3. Install https://github.com/sebastianbergmann/phpcpd (see instructions inside)

Then you can run it like:

$ phpcpd /path/to/project/directory

You will see the copy&paste report:


Found 3 exact clones with 53 duplicated lines in 5 files:

  - /usr/local/src/phpunit/PHPUnit/Framework/Constraint/Or.php:136-157
    /usr/local/src/phpunit/PHPUnit/Framework/Constraint/And.php:143-164

  - /usr/local/src/phpunit/PHPUnit/Framework/Constraint/Or.php:136-157
    /usr/local/src/phpunit/PHPUnit/Framework/Constraint/Xor.php:141-162

  - /usr/local/src/phpunit/PHPUnit/Framework/Comparator/Scalar.php:121-132
    /usr/local/src/phpunit/PHPUnit/Framework/Comparator/Numeric.php:102-113

0.19% duplicated lines out of 27640 total lines of code.

14 comments:

  1. Really like that you are providing such information on PHP MYSQl with JAVASCRIPT ,being enrolled at http://www.wiziq.com/course/5871-php-mysql-with-basic-javascript-integrated-course i really thank you for providing such information it was helpful.

    ReplyDelete
  2. Cool guide. Thanks for sharing a very detailed steps,it's so nice blog post

    PHP 5 developer

    ReplyDelete
  3. Dropping by here on your blog is worth it. I found this article really useful and the website developer will be interesting to this idea. Thanks for sharing this and I hope it can helpful too. Keep it up.

    ReplyDelete
  4. Well, the information above is pretty good regarding PHP Application Development Company which you share with us.
    Hire PHP Mysql Developers

    ReplyDelete
  5. This is the really good informative Post on Blogger and I really like to read it. Thanks for Presenting with us.
    Family Winter Vacation Ideas | Summer Vacation Ideas

    ReplyDelete
  6. Hi, I went through your this post and found

    really interesting. I landed this page through

    internet search and found
    this page very good.I am a web designer and

    works in a web design

    company

    as a designer I liked the color of your blog

    also.

    Thanks,
    minu

    ReplyDelete
  7. Cakephp is really an amazing e commerce development platform. One must cakephp development for building applications for his business as cakephp development various benefits and features.

    ReplyDelete
  8. Congratulations Admin! Thank you so much for taking the time to share this exciting information.
    conception site internet

    ReplyDelete
  9. "0.19% duplicated lines out of 27640 total lines of code." is laughable.
    It shows that PHP CPD is a terribly bad clone detector.

    CloneDR typically finds 10%+ duplicated code in a system.
    Check out www.semanticdesigns.com/Products/CloneDR, and see the clone detection reports.

    ReplyDelete
  10. "0.19% duplicated lines out of 27640 total lines of code." is laughable.
    It shows that PHP CPD is a terribly bad clone detector.

    CloneDR typically finds 10%+ duplicated code in a system.
    Check out www.semanticdesigns.com/Products/CloneDR, and see the clone detection reports.

    ReplyDelete
  11. web content solutions allows you to create a strong web presence. It can be easily integrated with an already existing website. δημιουργία e-shop

    ReplyDelete
  12. Thanks or this read mate. Well, this is my first visit to your blog! But I admire the precious time and effort you put into it, especially into interesting articles you share here!
    Web development Company

    ReplyDelete

Zend Framework Development Blog
Look at my new project for ZF developers