C# Rule S6669 ignoring changes to regex format

We are running SonarQube Community Build v24.12.0.100206 and are experiencing the exact same problem as described in https://community.sonarsource.com/t/c-rule-s6669-ignoring-changes-to-regex-format (Create a new issue here just according to the FAQ!)

We have a custom Quality Profile for C# which works great except for rule S6669. The parameter we want to have is ^m?Logger$ but analysis keeps showing code rules violations: Rename this field 'mLogger' to match the regular expression '^_?[Ll]og(ger)?$'.

Is anyone using a customized S6669 rule succesfully?

Hi,

Welcome to the community and thanks for following directions! :smiley:

I assume you mean this thread. Your link just comes back to your own post.

For clarity, are there other rules where you’ve customized parameters and the new values are used?

 
Thx,
Ann

Hi @SonarWelcome

We’re investigating the mentioned issue and we will get back to you soon.

Regards,
Ismail

Hello @SonarWelcome

Would you be able to perform the following actions, to investigate the issue:

  1. Login into your SonarQube Server instance
  2. Open the URL: <your SQ server>/api/qualityprofiles/search?project=<your project key>&language=cs This should give you the uuid of the quality profile associated to your project.
  3. Open the URL: <your SQ server>/api/rules/list?qprofile=<the quality profile uuid from step 2>&language=cs

You should get a JSON response, please look for the rule csharpsquid:S6669 in the actives section.

On my side, this is what I get:

  "actives": {
    [...]
    "csharpsquid:S6669": [
      {
        "qProfile": "2f560f8e-c7d0-4ae3-a0e7-7a862cbf8160",
        "inherit": "OVERRIDES",
        "severity": "MINOR",
        "params": [
          {
            "key": "format",
            "value": "^m?Logger$"
          }
        ],
        "createdAt": "2025-02-14T15:17:49+0100",
        "updatedAt": "2025-02-14T15:18:14+0100",
        "prioritizedRule": false,
        "impacts": [
          {
            "softwareQuality": "MAINTAINABILITY",
            "severity": "LOW"
          }
        ]
      }
    ],
  }

so I can confirm the change of the parameter has been taken into account (at least on the server side).

Please do the same and let us know.

1 Like