SonarCloud ignores custom parameters for the rules for Swift/iOS project

SonarCloud displays false errors due to it does not check a rule according to the custom parameters we set. Whatever the default value is, it checks accordingly and shows an error. For example, we enabled maximum line length rule. Its default value is 120 but set it to 160. Even though we delete and rescan many times it checks the code with default values and shows errors.


Screen Shot 2021-02-04 at 18.16.25

  • ALM used (GitHub, Bitbucket Cloud, Azure DevOps): Bitbucket Cloud
  • CI system used: Bitrise
  • Languages of the repository: Swift
  • Only if the SonarCloud project is public, the URL
    • And if you need help with pull request decoration, then the URL to the PR too

Hi @Omer_Turhan ,

Welcome to the community!

Does this behavior apply to the new lines that were not previously analyzed? Or you see the issue only on the lines that were previously marked as too long with the 120 value?

Best,
Marcin

Hi @Marcin_Majewski ,

Thanks for your answer.
It is happening for new lines. I assumed that previously analyzed lines not updated each rule change, so I deleted all the branches and do the analyzes again, but same thing happened. Moreover, we also get this error on new PR/Branch analyzes too.

Regards,
Omer

Hi,

I managed to reproduce the issue and indeed looks like a bug on our side. The ticket was created, you can track the progress here: https://jira.sonarsource.com/browse/SONARSWIFT-485 Please keep in mind that it may take some time to tackle this issue.

Best,
Marcin

Hi @Marcin_Majewski ,
Thanks for your interest.
I just wanna do an addition, this issue is not specific to this rule, other rules also behave like this, ignores custom parameters.

Hi @Omer_Turhan ,

Can you provide specific example of other rules the ignores the parameter? I would like to investigate it more.

Best,
Marcin

Hi @Marcin_Majewski
For example ‘Function names should comply with a naming convention’ rule too.
We updated its custom parameter format as ^[a-z][a-zA-Z0-9_]*$ but sonar cloud shows an error for migrateSchemaVersion_14_to_15 named function even-though it conforms the regex condition.

Regards,
Omer