Comments (5)
I would like to work on the issue.
Let's clarify requirements.
I assume that:
- license header starts from the first line of a class and may start from /, /* or //
- 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.
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.
StrictDuplicateCode has been removed from Checkstyle
from checkstyle.
any further explanation for removal reason? is there or will there be replacement? thanks
from checkstyle.
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)
- Improve documentation - how to add usage of `var` to check `IllegalType`? HOT 6
- Column number in `DetailNode` should start with 1 HOT 16
- LITERAL_DEFAULT token support in RightCurlyCheck
- False Negative of ClassFanOutCheck with "new" Keyword HOT 6
- MagicNumberCheck NPE when ignoring field declarations HOT 11
- Parse exception for RAW string template (Java 21+) HOT 3
- IllegalType Not Working For Annotation Using FQN HOT 3
- Remove Support for String Template Syntax
- Re-enable and Monitor `YAMLSchemaValidation` inspection HOT 6
- Resolve `TailRecursion` inspection violations by replacing tail recursive calls HOT 3
- log() method incorrectly calculates the column number when Tabs are used HOT 8
- WhitespaceAround reports a violation when switch expression is passed as a method argument HOT 2
- Parameter name should be provided after @param tag HOT 1
- Please REMOVE most badges from the README HOT 5
- Please, add a small section to the README on how to install and use this tool HOT 5
- Test to ensure website checks/filters are in alphabetical order
- Fix performance test HOT 3
- build failure due to maven.plugin.json HOT 2
- Github generate site fails to generate links with anchors.
- Fix PMD 7.1.0 Violations HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from checkstyle.