Skip to content

Commit

Permalink
PLUGINAPI-25 Return flow description and type (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbmeneses authored Sep 16, 2022
1 parent 4defb1a commit f20c694
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import javax.annotation.CheckForNull;
import org.sonar.api.batch.rule.Severity;
import org.sonar.api.batch.sensor.Sensor;
import org.sonar.api.batch.sensor.issue.NewIssue.FlowType;

/**
* Represents an issue detected by a {@link Sensor}.
Expand All @@ -36,6 +37,19 @@ interface Flow {
* @return Ordered list of locations for the execution flow
*/
List<IssueLocation> locations();

/**
* @since 9.11
* @return Flow description. Can be null if it's not specified.
*/
@CheckForNull
String description();

/**
* @since 9.11
* @return Type of the flow
*/
FlowType type();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ public interface NewIssue {

/**
* The type of the flow reported for a given issue. Issue may have many flows reported with different types.
* @since 9.11
*/
enum FlowType {
DATA, EXECUTION
UNDEFINED, DATA, EXECUTION
}

/**
Expand Down Expand Up @@ -76,7 +77,7 @@ enum FlowType {
/**
* Register a flow for this issue. A flow is an ordered list of issue locations that help to understand the issue.
* It should be a <b>path that backtracks the issue from its primary location to the start of the flow</b>.
* Several flows can be registered.
* Several flows can be registered. The type of the flow will be undefined.
* @since 5.2
*/
NewIssue addFlow(Iterable<NewIssueLocation> flowLocations);
Expand Down

0 comments on commit f20c694

Please sign in to comment.