codeclimate-duplication icon indicating copy to clipboard operation
codeclimate-duplication copied to clipboard

Wrong reference to duplication error

Open f-moya opened this issue 4 years ago • 0 comments

Reported by a user and recently confirmed, there are cases where the engine gives a wrong reference to a duplication error. It's not a false positive, but the referenced lines are not the ones that are causing the duplication error.

It indicates the error like following Screen Shot 2021-02-05 at 11 07 25

but the real duplication it's in the declared functions. If you remove the similarities between the functions the duplication does not pop up any warning.

Files to reproduce the problem. wrong-duplication-reference.zip

With the following files it possible to see how there is no warning the the functions are not similar. Therefore the reference to the namespace section where the duplication was supposed to be was wrong, but there was a duplication error. wrong-duplication-reference.zip

f-moya avatar Feb 05 '21 14:02 f-moya