Hello Sonar Community,
we have a problem with a custom rule changing the cognitive complexity (cc in the following) for Rust. We want to increase cc from 15 to 25. For that, we created a new Quality Profile, extending the existing Sonar Way Profile. We only changed the one rule regarding cc, setting it to 25. We also set this new Quality Profile as default for all projects and double checked that it is used by the corresponding projects in the projects settings.
However, every analysis that runs still does use the old value of 15, creating a High maintainability issue for values over 15:
“Refactor this function to reduce its Cognitive Complexity from 22 to the 15 allowed.”
- SonarQube Version: SonarQube Server Developer Edition v2025.5 (113872)
- Docker
- Build server: GitLab
- Trying to achieve: increase Rust cognitive complexity rule from 15 to 25 in a custom Quality Profile
- Tried so far: created custom Quality Profile (extended from Rust Sonar Way), overrode rule “Cognitive Complexity of functions should not be too high” and set value from 15 to 25, looked through issues tackling similar problems like:
Parameter changes not applied for Cognitive Complexity rule - #4 by ganncamp
Looking forward to all helpful answers! ![]()
Thanks and cheers
Phil

