Technical debt on custom web rule in sonarqube 5.1

296 views Asked by At

I am facing issue in technical debt with custom web rules. I have web plugin but no technical debt is assigned to rules. I want code or annotation through which i can assign some constat/issue value to each rule and can calculate debt from that.

I used following anotations while creating web rules.

@Rule

@WebRule

@RuleTags

Thank you in advance.

1

There are 1 answers

0
Fabrice - SonarSource Team On BEST ANSWER

You can take a look at how this is implemented on the numerous SonarQube open-source plugins that are developed by SonarSource and the SonarQube community.

For instance, on the Java plugin, you can look a some classes like AnonymousClassShouldBeLambdaCheck. You will see that the following annotations are used to declare the technical debt:

import org.sonar.squidbridge.annotations.SqaleConstantRemediation;
import org.sonar.squidbridge.annotations.SqaleSubCharacteristic;