org.sonar.api.issue
Interface Issue

All Superinterfaces:
Serializable
All Known Implementing Classes:
DefaultIssue

public interface Issue
extends Serializable

Since:
3.6

Field Summary
static int MESSAGE_MAX_SIZE
          Maximum number of characters in the message.
static String RESOLUTION_FALSE_POSITIVE
          Resolution when issue is flagged as false positive.
static String RESOLUTION_FIXED
           
static String RESOLUTION_REMOVED
          Resolution when rule has been uninstalled or disabled in the Quality profile.
static List<String> RESOLUTIONS
           
static String STATUS_CLOSED
           
static String STATUS_CONFIRMED
           
static String STATUS_OPEN
          Default status when creating an issue.
static String STATUS_REOPENED
           
static String STATUS_RESOLVED
           
static List<String> STATUSES
          Return all available statuses
 
Method Summary
 String actionPlanKey()
           
 String assignee()
          Login of the user who is assigned to this issue.
 String attribute(String key)
           
 Map<String,String> attributes()
           
 String authorLogin()
          Login of the SCM account that introduced this issue.
 Date closeDate()
          Date when status was set to STATUS_CLOSED, else null.
 List<IssueComment> comments()
          Non-null list of comments, ordered by chronological order.
 String componentKey()
          Components are modules ("my_project"), directories ("my_project:my/dir") or files ("my_project:my/file.c").
 Date creationDate()
           
 Double effortToFix()
          Arbitrary distance to threshold for resolving the issue.
 boolean isNew()
          During a scan return if the current issue is a new one.
 String key()
          Unique generated key.
 Integer line()
          Optional line number.
 String message()
           
 String reporter()
          Login of the user who reported this issue.
 String resolution()
          The type of resolution, or null if the issue is not resolved.
 RuleKey ruleKey()
           
 String severity()
          See constants in Severity.
 String status()
          See constant values in Issue.
 Date updateDate()
           
 

Field Detail

MESSAGE_MAX_SIZE

static final int MESSAGE_MAX_SIZE
Maximum number of characters in the message.

See Also:
Constant Field Values

STATUS_OPEN

static final String STATUS_OPEN
Default status when creating an issue.

See Also:
Constant Field Values

STATUS_CONFIRMED

static final String STATUS_CONFIRMED
See Also:
Constant Field Values

STATUS_REOPENED

static final String STATUS_REOPENED
See Also:
Constant Field Values

STATUS_RESOLVED

static final String STATUS_RESOLVED
See Also:
Constant Field Values

STATUS_CLOSED

static final String STATUS_CLOSED
See Also:
Constant Field Values

RESOLUTION_FIXED

static final String RESOLUTION_FIXED
See Also:
Constant Field Values

RESOLUTION_FALSE_POSITIVE

static final String RESOLUTION_FALSE_POSITIVE
Resolution when issue is flagged as false positive.

See Also:
Constant Field Values

RESOLUTION_REMOVED

static final String RESOLUTION_REMOVED
Resolution when rule has been uninstalled or disabled in the Quality profile.

See Also:
Constant Field Values

RESOLUTIONS

static final List<String> RESOLUTIONS

STATUSES

static final List<String> STATUSES
Return all available statuses

Since:
4.4
Method Detail

key

String key()
Unique generated key. It looks like "d2de809c-1512-4ae2-9f34-f5345c9f1a13".


componentKey

String componentKey()
Components are modules ("my_project"), directories ("my_project:my/dir") or files ("my_project:my/file.c"). Keys of Java packages and classes are currently in a special format: "my_project:com.company" and "my_project:com.company.Foo".


ruleKey

RuleKey ruleKey()

severity

String severity()
See constants in Severity.


message

@CheckForNull
String message()

line

@CheckForNull
Integer line()
Optional line number. If set, then it's greater than or equal 1.


effortToFix

@CheckForNull
Double effortToFix()
Arbitrary distance to threshold for resolving the issue.

For examples:


status

String status()
See constant values in Issue.


resolution

@CheckForNull
String resolution()
The type of resolution, or null if the issue is not resolved. See constant values in Issue.


reporter

@CheckForNull
String reporter()
Login of the user who reported this issue. Null if the issue is reported by a rule engine.


assignee

@CheckForNull
String assignee()
Login of the user who is assigned to this issue. Null if the issue is not assigned.


creationDate

Date creationDate()

updateDate

Date updateDate()

closeDate

@CheckForNull
Date closeDate()
Date when status was set to STATUS_CLOSED, else null.


attribute

@CheckForNull
String attribute(String key)

attributes

Map<String,String> attributes()

authorLogin

@CheckForNull
String authorLogin()
Login of the SCM account that introduced this issue. Requires the Developer Cockpit Plugin to be installed.


actionPlanKey

@CheckForNull
String actionPlanKey()

comments

List<IssueComment> comments()
Non-null list of comments, ordered by chronological order.

IMPORTANT: existing comments are not loaded when this method is called when analyzing project (from BatchExtension).


isNew

boolean isNew()
During a scan return if the current issue is a new one.

Returns:
always false on server side
Since:
4.0


Copyright © 2009-2014 SonarSource. All Rights Reserved.