Quality Profile Selection

sonarqube

(Mayur Jaiswal) #1

Hi Team,

I have integrated Sonarqube with Bamboo as a part of CI process. I am analyzing a angular typescript project. But my Quality profile column shows JavaScript. PFB sonar-project.properties file.

**In SONARQUBE UI**
Quality Profile: Stop using 'Sonar way' (JavaScript)
Quality Profile: Use 'Sonar way' (TypeScript)

**In Properties FILE**
sonar.host.url=https://sonarqube67.ae.sda.**.com
sonar.projectKey=eov-ui
sonar.projectName=eov-ui
sonar.projectVersion=1.0
sonar.sources=src
sonar.login=***************
sonar.password=
https.proxyHost=buildproxy01.***.com
http.proxyHost=buildproxy01.***.com
https.proxyPort=3128
http.proxyPort=3128
sonar.language=ts
sonar.exclusions=**/node_modules/**
sonar.ts.tslintconfigpath=tslint.json
sonar.sourceEncoding=UTF-8
sonar.typescript.lcov.reportPaths=coverage/lcov/lcov.info

(G Ann Campbell) #2

Hi,

It’s not clear from what you’ve given us so far just what’s happening. However, I would like to make some comments on the properties you’ve listed.

When you use an authentication token, which is what I assume you’re doing, there’s no need to set even a blank password.

No need to set these here; they won’t be acted on. These only do you good when they’re set in $SONARQUBE_HOME/conf/sonar.properties.

I understand that you used this in an attempt to force your project to be analyzed as TypeScript rather than JavaScript, but it’s ill-advised not least because it prevents the analysis of any other languages that may be in - or may later be added to - your project. Not only that, but it’s not going to change what language analysis thinks your files are. So any files it thought before were JavaScript, it will still think are JavaScript and simply fully ignore rather than analyzing them as TypeScript.

Regarding what you’re seeing on your project homepage

This is really just a reflection of what happened when you added sonar.language=ts. Analysis no longer needed the JavaScript profile (because it was ignoring everything but TypeScript) and it started using the TypeScript profile because you forced it to, even if it didn’t have anything to use it on.

So now let’s get down to your problem. You have TypeScript files that are being analyzed as JavaScript. So

  • what file extension is used for you TS files?
  • if you look in Project-level Administration > General Settings > TypeScript > File suffixes what file extensions are recognized as TypeScript?
  • if you look in Project-level Administration > General Settings > JavaScript > File suffixes what file extensions are recognized as JavaScript?
  • is there anything relevant-seeming in your analysis log?

 
Ann