What are the usage of sqPrefixkey and idePrefixKey?

So far i had setup the sonarlint and sonarqube properly but confused on the usage of sqPrefixkey and idePrefixkey and the value of both key changed themselves from time to time.

My understanding on sqPrefixkey was it is referring to the modules configured while performing scan but why sonarlint change the value automatically or not even populate it at all or populate with the wrong module/path

1 Like

Hi @SlackOng95

Those properties are uses to convert IDE file paths to SonarQube server file paths. This is important to correctly synchronize issue attributes. The value should be stable, except if your project contains a lot of similar file paths, that could confuse our matching algorithm. Or if you change your project structure a lot.

For example, if SonarLint has detected:

  • idePrefix=foo
  • sqPrefix=bar
    Then to convert a local file path from your IDE, for example foo/src/Main.php, the operation is to remove idePrefix -> src/Main.php and then prepend sqPrefix -> bar/src/Main.php.

So when SonarLint needs to query server side issues of the file foo/src/Main.php, it will call something like: http://yourSQserver/api/issues/search?component=bar/src/Main.php

If you think those properties have a bad value, please provide a bit more details:

  • SonarLint flavor and version
  • a list of local files paths in your IDE project
  • a list of remote files paths in your SQ project
    (you can share file path with me privately if you think file names contains sensitive data).

++

1 Like

Hi Henry,

Appreciate and thanks for your input.

So far only 1 or 2 project keep having the changes on these 2 values so i think it is still fine for us to ignore the changes once we have finalized the values

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.