Avoid certain kinds of CodeSmells for naming conventions

  • ALM used : GitHub
  • CI system used : Circle CI
  • Languages of the repository : Swift
  • Error observed : No errors.
  • Steps to reproduce : Create new branches in GitHub, commit code, perform SonarCloud Analysis
  • Potential workaround : None identified

Hello Team,
Our iOS project has synced with the SonarCube portal and we are trying to resolve all the code smells. Currently, we are following a naming convention for variables, where we are using underscores and all these variable names are considered as CodeSmells. Is there a solution or a syntax which we could use to avoid these code smells to be detected ?

class BeneficiaryItemCell: UITableViewCell {
    @IBOutlet weak var ib_lblName: UILabel!
    @IBOutlet weak var ib_lblCauseLocation: UILabel!
    @IBOutlet weak var ib_lblTitle: UILabel!
    @IBOutlet weak var ib_imgView: UIImageView!
    @IBOutlet weak var ib_lblSeparator: UILabel!
}

Below is the screenshot for your reference:

Thank you.

Hey there.

If you have a different naming convention for your variables (that you don’t want to change), you can extend the Quality Profile and supply a different regular expression.