I'm trying to analyse a huge java project (over 1 million lines of code) with SonarQube (version has to be 4.5.6 since the rule set is given, we're not allowed to change it and some rules and plugins don't work with 5.x) and stumbling over useless code duplication messages. The project uses EJB and so there are many code fragments repeating in each class with all those ejb methods (most being empty in most classes). Those are all marked as duplicate leading to an too many duplications message in the log.
Futheron: due to the hugeness of the project there are many files which need to import the same packages, so there are many blocks of the same import lines in the code which are reported as duplicates - but what would be a compliant solution to avoid this kind of duplication? Or is there some useful kind of configuration which will ignore such blocks of import lines but doesn't ignore other duplicated code? (this kind of sub problem was asked before here: SonarQube - duplicated block, how to change configuration - but it's not clear for which SonarQube version, so this may be different in SQ 4.5.6)
Furtheron: there are many simple getter and setter methods - due to those having the same structure and are mostly one liners which just differ in the name and member which is set/get, these are also found as duplicated code.
Overall: I get literally thousands of duplication messages, and didn't find one real code duplication yet because those real duplications are buried all over all those wrong ones.
So how to configure SonarQube code duplication to render it useful. Thanks for any hints. So far my solution for this issue is: ignore it - it just doesn't make sense to search for one hit among thousands of false positives.