Fixed? Many duplicate blocks reported for requires in JavaScript files

Developer Edition Version 9.9 (build 65466)

I opened a topic in Feb 2022 Many duplicate blocks reported for requires in JavaScript files
and an enhancement request was opened and implemented for it, but I can’t get it to work.

The enhancement has milestone ‘9.3’ and was merged in May 2022, so I expect it is in my version 9.9 but requires in js code are still being flagged as duplicate code, causing my github PR to fail SonarQube Quality Gate.

Hopefully I am missing something obvious because it would make a big difference to acceptance of SonarQube in my company. Appreciate any help / pointers.

Thanks, /Dave.

Hey there.

My understanding is that you are right, the version of the analyzer included in SonarQube v9.9 should exclude these statements from duplication detection.

Just to ask the dumb question first – have you reanalyzed your project since upgrading to SonarQube v9.9 LTS?

Yes, above image is from a recent analysis with SonarQube v9.9.
SonarQube scan is integrated into our build pipeline, run multiple times per day.
We have been on v9.9 for quite a while (months).

FYI, the change in the PR for the above image was changing the requires from ‘var’ to ‘const’.

Hello @David_Deasy,

Thanks for reporting this. Indeed seems the original fix did not completely fix the use case you are describing. I opened a ticket to fix this.

Thanks!
Victor

1 Like