Must-share information (formatted with Markdown):
- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
- SonarQube - * Community Edition Version 9.3 (build 51899)
- what are you trying to achieve
- I want to query
api/issues/searchendpoint with optional parameters right after runningSonarScanner
- I want to query
- what have you tried so far to achieve this
- I get a response from the query. I observed that sometimes (I could not determine any patterns) the query returns 0 smells.
Hello everyone. I am using SonarQube and SonarScanner to analyze code smells in certain files. My workflow is the following (by using a code snippet).
- Make sure SonarQube is up and the analysis directory has
sonar-project.propertiesfile.-
sonar-project.propertiesfile:
-
sonar.projectKey=PROJECT_NAME
sonar.host.url=URL
sonar.login=TOKEN
sonar.sources=FILE_PATHS
sonar.sourceEncoding=UTF-8
sonar.buildString=STRING
- Run SonarScanner.
- (Right after SonarScanner finishes the execution, immediately) Query the results from the following endpoint:
/api/issues/search?componentKeys=PROJECT_NAME:FILE_PATH&types=CODE_SMELL&statuses=OPEN
I receive the expected smell results from the above endpoint. However, sometimes smell results are just empty (empty list). I could not identify any root cause for this behavior. I do not have SonarScanner logs for the cases where I receive 0 code smells. I re-ran SonarScanner for such files and received non-zero code smell results. I could not reproduce the cases by manual run where I obtained 0 smell results.
So, is there any minimum time that I should wait before querying SonarQube to obtain code smell results per file? What could be the reason for obtaining 0 code smells (which is completely false)?