We are analyzing the index.vue file of Vue in SonarQube9.9.
Duplications of analysis results pointed out import statements in .vue files as duplicate codes. When referring to the official guide(Metric definitions - SonarCloud), the following description was made.
In JavaScript projects: differences in indentation and in string literals are ignored while detecting duplications. In addition, tokens from import statements and require calls are skipped altogether.
Since the import statement is not pointed out as duplicate code in JavaScript files, it is recommended that import statements not be pointed out as duplicate code in Vue files.
It seems that the import statement is excluded by extractTokens of cpd.ts, but the import statement in the .vue file is not detected as ImportDeclaration by ESlint.
-
which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
SonaQube Developer Edition Version 9.9 (build 65466) -
how is SonarQube deployed: zip, Docker, Helm
Docker -
what are you trying to achieve
We want to make sure that import statements are not pointed out as duplicate code in .vue files. -
what have you tried so far to achieve this
There is no workaround.