I have an issue that Sonarqube discovered newly added imports as duplications. I found this topic but the attached issue link reference to non-existent page.
-
What language is this for?
Javascript -
Which rule?
Duplication scan -
Why do you believe it’s a false-positive?
The import of common module is marked as duplication. But I moved common code to common.js file to mitigate duplications to have same source twice in two files. -
Are you using
- SonarQube Server - Enterprise Edition v2025.1.3 (110580)
-
How can we reproduce the problem?
First file - main.js

Second file - main.js in different location

Implementation is common.js file

The main.js file is imported as module in our main.php and common.js is only imported to main javascript files.

I see only possible way to add files to duplication exclusion list. But this does not solve issue and the duplications will not be scanned for whole file anymore. Has not been the issue already solved? How can I solve it?
