SonarCloud - Help with new custom rules & remove existing rules

Hello,
I am evaluating SonarCloud for code analysis tool for CI/CD requirements with BitBucket repositories.

I have already set up a SonarCloud account and was able to run code analysis on private BitBucket repositories for Angular & .NET Core projects.

I have couple of questions. Please help with these. Thanks!

  1. How do I add a new custom rule in SonarCloud?
  2. Is there an option to disable or remove existing rules?
  3. How do I stop the merge on pull request on BitBucket side, if the SonarCloud Quality Gate has failed for the pull request analysis?

Hi, can someone please help with the questions? Thanks.

Hi Manish,

Welcome to our community :slight_smile:

I’ll try to answer your questions as much as I can:

  1. It’s not possible to add custom rules in SonarCloud.
  2. You can choose the rules you want by creating a Quality Profile and associate it to your project(s)
  3. It should be possible to stop the merge of the PR on BitBucket side if you have a premium account, you can see more detail here and here. Please note that we haven’t tested this use case ourselves.

Don’t hesitate to come back to us if you have any other questions,

Hope it helps,

Cheers,