Affects PMD Version:
6.20.0
Rule:
LawOfDemeter.
Description:
Let this be a discussion area to enumerate issues and bugs with Law of Demeter as it currently exists. I think it's a wonderful rule and if the implementation can be fine-tuned, it will certainly add value to PMD and java development practices.
Spinning off from the comment below:
I'll also add a few links to add perspective to my above comment:
https://alvinalexander.com/java/java-law-of-demeter-java-examples
https://stackoverflow.com/questions/47347068/optional-monad-and-the-law-of-demeter-in-java
https://stackoverflow.com/questions/53529338/a-factory-method-may-violate-the-law-of-demeter
https://stackoverflow.com/questions/33034777/law-of-demeter-static-property-access
https://www.tedinski.com/2018/12/18/the-law-of-demeter.html
https://programmingideaswithjake.wordpress.com/2015/02/28/law-of-demeter-and-how-to-work-with-it/
https://enterprisecraftsmanship.com/posts/law-of-demeter-and-immutability/
https://dzone.com/articles/the-genius-of-the-law-of-demeter
https://stackoverflow.com/questions/26021140/law-of-demeter-with-data-model-objects/26021695#26021695
https://dzone.com/articles/the-beautiful-law-of-demeter
https://stackoverflow.com/questions/67561/do-fluent-interfaces-violate-the-law-of-demeter
https://www.markwithall.com/programming/2015/05/03/fluent-apis-and-the-law-of-demeter.html
Code Samples demonstrating the issues
linusjf/LearnJava@52d87ec#r36394771
linusjf/LearnJava@878c209#r36411248
linusjf/LearnJava@8da2d18#r36413611
linusjf/LearnJava@2d45a3c#r36416295
linusjf/LearnJava@92abb13#r36424853
linusjf/LearnJava@56532f8#r36427376
linusjf/LearnJava@513e18d#r36427685
linusjf/LearnJava@3aba5a7#r36428021
Running through: [CLI | Ant | Maven | Gradle | Designer | Other]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4