Quality Profile: Each language plugin comes with a predefined, built-in profile (called “Sonar way”) having set of pre-defined rules and it will be used as default profile during analysis for projects. New quality profiles can be created to configure rules as per project requirements, but it’s optional. SonarQube allows inheritance in quality profiles thereby allowing to inherit rules provided by plugin in the default profile. Custom Rules:It is possible to create custom rules. Custom Rules are considered like any other rule, except that they can be fully edited or even deleted. Rule Templates are provided by plugins to allow users to define their own rules in SonarQube. Sample – Quality profile and customizing rules: In the following screenshot, a new quality profile called “Sample Quality Profile” is created. It is activated for project “Sample project for SonarQube”. It inherits 236 active rules from default java profile “Sonar Way”
Based on project need, changes can be made in the child profile. E.g. changing severity of certain rules for project. The following screenshot shows how severity of a rule can be changed to info from minor.
· Triggering analysis: The SonarQube Scanner is recommended as the default launcher to analyse a project with SonarQube. Various versions of SonarScanner are available for command line, Ant, Maven, Jenkins etc.
Analysis can be carried out in following modes.