You may also want to have a look at this pull request, where we’re documenting the possibility of tweaking the minimum token length for reporting duplicated code blocks - we’re still reviewing this information, though:
this is useful. We do not use configuration files yet but will check this out. This should be exactly what we need for the test project case. Just to confirm - would this somehow affect our current setup (via UI) if I throw in this YAML file with ignore paths just for duplication or does this work on top of what is already configured via UI/your defaults?
As of the linked PR I am not sure if I follow fully but it’s not a matter of how long the duplicated block is but that it is about properties (getters/setters). We could potentially use the ignore sub-folder way as for tests as we tend to have dedicated folders for Commands & Dtos, but ideally there would be a way to provide a ignore pattern (which I believe PMD doesn’t support for C#?).
The Codacy Configuration file replaces any configuration set on it, so if you just have an entry with the exclude paths for Duplication, those will be used while the rest of your configurations will remain the same.
This being said, there are some details that will change when you set up the file. For example, you will not be able to ignore files on the UI, so if you are already ignoring any file or wish to ignore files in the future you will have to do it on the Configuration File.
Just to clarify that in the pull request, we’re documenting a few options that add a bit more flexibility over what PMD CPD considers to be a duplicate block. So I was thinking that, for example, setting the flag --ignore-identifiers to false could be enough for PMD CPD to no longer consider the getter and setter methods clones of each other because of the different attribute names mentioned in those lines of code. This would affect how duplicates are detected throughout the entire repository, though.
This is to let you know that we found out that Codacy isn’t reading and applying the Codacy configuration file options that control the PMD CPD duplication detection. Please see my reply on this other thread for more information:
I’m sorry this isn’t a viable solution at the moment, after all.