Code Monkey home page Code Monkey logo

Comments (5)

ychulovskyy avatar ychulovskyy commented on May 16, 2024

I would like to work on the issue.
Let's clarify requirements.
I assume that:

  1. license header starts from the first line of a class and may start from /, /* or //
  2. all the comments should be ignored until package declaration (yep, it's possible that the class is in default package but it's the case we can ignore since it should not appear)
    Are you OK with the assertions? They will help to use simple text parsing instead of TreeWalker.
    Question: should we add "ignoreHeader" property to StrictDuplicateCodeCheck?
    If yes, should it be set to true by default?

from checkstyle.

romani avatar romani commented on May 16, 2024

Hi Yuri, thanks for desire to help, I appreciate that.

That Check have to be removed from Checkstyle completely, it is extremely buggy. Whole concept of searching code duplication should be reviewed, reimplemented and re-tested before introducing it to Checkstyle.

Doing strict compare of code is worst realization. Amount of false positives that such tools produce make them unusable. I even in favour of keeping items separately with copy paste father then introducing dependency between classes. I am not asking completely abandon idea of code duplication ..... but that should not be done Checkstyle for now, and should be moved to our experimental project (sevntu.checkstyle).

Resolution:
please do me a favour - remove that Check completely from Checkstyle to make Checkstyle more reliable for users.

Similar problem but in different scope is: #473

from checkstyle.

mkordas avatar mkordas commented on May 16, 2024

StrictDuplicateCode has been removed from Checkstyle

from checkstyle.

ewoks avatar ewoks commented on May 16, 2024

any further explanation for removal reason? is there or will there be replacement? thanks

from checkstyle.

romani avatar romani commented on May 16, 2024

reason of removal - #523 (comment)
No replacement is planned for now, may be eventually after all completion of hundred ideas of dirty code detection in Java. I would recommend to use CPD to copy paste detection is you are crazy about that. But what I really recommend it to review your application to minimize dependencies between code, look at report against Chekstyle - http://checkstyle.sourceforge.net/dsm/index.html

from checkstyle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.