Issues not detecting in main branch

I integrated SonarQube into an existing GitLab project where the ‘dev’ branch serves as the master branch. The SonarQube checks are set to run on the merge_request, dev, and main branches. After implementing the CI changes in the dev branch, the pipeline ran without detecting any issues. However, when I created a new branch from dev and modified the value of a key in a map,the maintainability rating failed, suggesting the key should be made into a variable. There are many variables are initialized in a similar manner.I’m unsure why this issue wasn’t detected in the dev branch.

Hi,

Welcome to the community!

You haven’t given us a lot to go on here: SonarQube version, language, rule, code snippet, …

 
Ann

we are using sonarQube 9.9 community edition and using for a maven project

Hi,

Thanks for those details.

Would you like to provide some details on this part?

What was the value before modification? Could we get a screenshot of the issue? What rule are we talking about?

 
Ann