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.

28 comments:

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

    PHP 5 developer

    ReplyDelete
  2. 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
  3. Well, the information above is pretty good regarding PHP Application Development Company which you share with us.
    Hire PHP Mysql Developers

    ReplyDelete
  4. 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
  5. 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
  6. Congratulations Admin! Thank you so much for taking the time to share this exciting information.
    conception site internet

    ReplyDelete
  7. "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
  8. "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
  9. web content solutions allows you to create a strong web presence. It can be easily integrated with an already existing website. δημιουργία e-shop

    ReplyDelete
  10. 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
  11. Thanks, You just made my day a little easier.
    SEO Company Bangalore

    ReplyDelete
  12. Thanks for the information, you guys are great in Scriptcase publications also.

    ReplyDelete
  13. Gгeеtings! Very helрful аdviсe in thіs paгticulаr ρoѕt! I am glad to read this post, its an interesting one. I am always searching for quality posts.
    website design

    ReplyDelete
  14. This comment has been removed by the author.

    ReplyDelete
  15. Dear, I tried it myself but it didn’t work properly so after that I Hire PHP Developers to install it on my PHP site but he said me that something happen with this code. If anyone uses it so tell me?

    ReplyDelete
  16. I am very happy when read this blog post because blog post written in good manner and write on good topic. Thanks for sharing valuable information…....

    by MGT 521 provider

    ReplyDelete
  17. I absolutely admired every bit of it and i additionally accept you book apparent to analysis out fresh things in your site.
    by MGT 521 Week 6 provider

    ReplyDelete
  18. Nice to read this blog. I learned some thing from this blog. Bangalore Website Developers

    ReplyDelete
  19. Hi, probably our entry may be off topic but anyways, I have been surfing around your blog and it looks very professional. It’s obvious you know your topic and you

    appear fervent about it. I’m developing a fresh blog plus I’m struggling to make it look good, as well as offer the best quality content. I have learned much at your

    web site and also I anticipate alot more articles and will be coming back soon. Thanks you.



    PHP Course in Chennai

    ReplyDelete
  20. Pleasant article...this post is spectacular with quotation of each info yet as info.
    by MGT 521 Week 1 provider

    ReplyDelete
  21. I actually loved reading your blog. It was very well authored and very simple to understand.
    by Homework Help provider

    ReplyDelete
  22. This truly is the pleasant theme to discuss.I have read the other topics on your site.
    by ACC 205 Week 3 provider

    ReplyDelete
  23. Outstanding publish I like ones write-up love how we identified as much as possible, what you are doing a terrific career many of others just like you by means of that sort of helpful sites provide awareness in order to all of us associated with a lot of things. I understand other sorts of useful information sites from the internet sites in addition to We are a lot engaged with your running a blog knowledge, My partner and i likewise begun to write information sites and also this form sites definitely guide me out. We by now book marked your own web page as well as distributed ones internet sites to my personal co-workers not just us although them all like your current blogging ability, trust an individual produce far more useful sites similar to this one along with good luck for ones potential weblogs.

    Jimmy Wilson from Dark Knight Rises Jacket

    ReplyDelete
  24. I inspired with this post. I seldom discovered this. I ran into this and intriguing stuff is available here.
    by BCOM 275 Entire Course provider

    ReplyDelete
  25. Recently I saw your all post, and i really wanna say that your blog is informative. Your post about PHP/MySQL is really helpful.

    Thanks,

    PHP Development

    ReplyDelete
  26. The dispatched letters is very informative. It is a great pleasure reading it.
    by LDR 531 Individual Assignment Provider

    ReplyDelete
  27. Ways & Works Consulting is an ISO 9001:2015 certified HR Consulting Firm, Manpower Recruitment and Practical Training firm career with an aim to provide value aided service to employersTop Manpower Recruitement company in india . with an in-depth understanding of their requirements. We are working as a perfect bridge between the employer and employee to fulfil their needs by placing the best suitable at place.

    ReplyDelete