C++ subclass header file duplications

Must-share information (formatted with Markdown):

Version - Enterprise Edition v2025.4.2 (112048)

The duplication detector for C++ counts all declarations of overridden methods in headers for sub-classes as duplicated code. The language requires this ‘duplication’ in order to define the interface for the sub-classes so it doesn’t make sense to count it. If the implementations of the overridden methods in the cpp files were duplicated then that would be a different matter.
In addition, the new code duplication detection calculates a percentage across the modified lines and has no minimum number of lines so 2 lines of code duplicated in a change results in 100% duplication
File exclusion is much too blunt a tool to control this behaviour.

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

1 Like