Code duplication warning doesn't link to any duplicated code

The “1 duplicated blocks of code must be removed.” does not actually say where either of the duplicate code entries in the source. So it’s particularly difficult for programmers to resolve in large projects.

1 Like

Hi,

That issue is raised in the relevant file. If you’ll scroll through the file, you’ll see a brown marginal marker. That indicates where the duplication is. You can click the marker for more details.

 
Ann

Hi Ann,

sorry to reply to such an old topic, but my colleagues and I, too, find it difficult to locate duplicate code in larger files. Is it impossible to report an issue at the precise location?

Hi @oliver,

“Impossible” is such a big word. Let’s go with unlikely. Right now those issues are raised on the file as a whole, which is why they show up at the top. The message indicates how many duplicated blocks there are in the file. When there’s more than one, which block should the issue be raised on?

Yes, I’m being a little simplistic but I’m trying to make the point that it would require entirely redoing how the rule works, and that’s simply not in our priorities at the moment.

 
:woman_shrugging:
Ann

1 Like

Ann,

Sorry to be obtuse, but can you be more specific than ‘brown marginal marker?’ Is this the same marker as missing code coverage, which perhaps is obscuring the duplicated code notice?

Raising on the first block or providing some clue as to the location would certainly be more helpful, though I hear you in that it’s low priority for your team.

1 Like

Hi,

It’s right next to it:
Selection_999(513)

And yes, it looks like the color has changed (again :unamused:), this time to grey.

 
HTH,
Ann

1 Like

Hi Ann,

sorry for the late response but just saw this tread now and don’t want to open an newer one for this theme. I understand your point but why is it so difficult to add more information to the warning?

For example: If my code contains duplicated blocks I can scroll to one of these blocks. With a double click to the grey marker I get the information where I’ll find t´he other block(s). Maybe it will be helpful to add these information to the warning …

Nest regards,
Ralf Ebert

1 Like

Hi Ralf,

Please create a new thread. Probably in the Product Manager for a Day subcategory.

 
Ann