Package org.sonar.api.issue
Interface Issue
- 
- All Superinterfaces:
- java.io.Serializable
 
 public interface Issue extends java.io.Serializable- Since:
- 3.6
 
- 
- 
Field SummaryFields Modifier and Type Field Description static intMESSAGE_MAX_SIZEMaximum number of characters in the message.static java.lang.StringRESOLUTION_ACKNOWLEDGEDSecurity Hotspot has been reviewed and acknowledged that it poses a risk.static java.lang.StringRESOLUTION_FALSE_POSITIVEResolution when issue is flagged as false positive.static java.lang.StringRESOLUTION_FIXEDstatic java.lang.StringRESOLUTION_REMOVEDResolution when rule has been uninstalled or disabled in the Quality profile.static java.lang.StringRESOLUTION_SAFESecurity Hotspot has been reviewed and resolved as safe.static java.lang.StringRESOLUTION_WONT_FIXIssue is irrelevant in the context and was muted by user.static java.util.List<java.lang.String>RESOLUTIONSstatic java.util.List<java.lang.String>SECURITY_HOTSPOT_RESOLUTIONSstatic java.lang.StringSTATUS_CLOSEDstatic java.lang.StringSTATUS_CONFIRMEDstatic java.lang.StringSTATUS_IN_REVIEWDeprecated.since 8.1, status has been mapped as `TO_REVIEW`static java.lang.StringSTATUS_OPENDefault status when creating an issue.static java.lang.StringSTATUS_REOPENEDstatic java.lang.StringSTATUS_RESOLVEDstatic java.lang.StringSTATUS_REVIEWEDstatic java.lang.StringSTATUS_TO_REVIEWstatic java.util.List<java.lang.String>STATUSESReturn all available statuses
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description java.lang.Stringassignee()UUID of the user who is assigned to this issue.java.lang.Stringattribute(java.lang.String key)Deprecated.since 9.4, attribute was already not returning any element since 5.2java.util.Map<java.lang.String,java.lang.String>attributes()Deprecated.since 9.4, attribute was already not returning any element since 5.2java.lang.StringauthorLogin()Login of the SCM account that introduced this issue.java.util.DatecloseDate()Date when status was set toSTATUS_CLOSED, else null.java.util.Collection<java.lang.String>codeVariants()java.lang.StringcomponentKey()Components are modules ("my_project"), directories ("my_project:my/dir") or files ("my_project:my/file.c").java.lang.StringcomponentUuid()java.util.DatecreationDate()Durationeffort()java.lang.Doublegap()Arbitrary distance to threshold for resolving the issue.booleanisCopied()During a scan returns true if the issue is copied from another branch.booleanisNew()During a scan return if the current issue is a new one.java.lang.Stringkey()Unique generated key.java.lang.Stringlanguage()java.lang.Integerline()Optional line number.java.lang.Stringmessage()java.lang.StringprojectKey()java.lang.StringprojectUuid()java.lang.Stringresolution()The type of resolution, or null if the issue is not resolved.RuleKeyruleKey()java.lang.Stringseverity()Deprecated.since 10.1java.lang.Stringstatus()See constant values inIssue.java.util.Collection<java.lang.String>tags()java.util.DateupdateDate()
 
- 
- 
- 
Field Detail- 
MESSAGE_MAX_SIZEstatic final int MESSAGE_MAX_SIZE Maximum number of characters in the message. In theory it should be 4_000 UTF-8 characters but unfortunately Oracle DB does not support more than 4_000 bytes, even if column issues.message is created with type VARCHAR2(4000 CHAR). In order to have the same behavior on all databases, message is truncated to 4_000 / 3 (maximum bytes per UTF-8 character) = 1_333 characters.- See Also:
- Constant Field Values
 
 - 
STATUS_OPENstatic final java.lang.String STATUS_OPEN Default status when creating an issue.- See Also:
- Constant Field Values
 
 - 
STATUS_CONFIRMEDstatic final java.lang.String STATUS_CONFIRMED - See Also:
- Constant Field Values
 
 - 
STATUS_REOPENEDstatic final java.lang.String STATUS_REOPENED - See Also:
- Constant Field Values
 
 - 
STATUS_RESOLVEDstatic final java.lang.String STATUS_RESOLVED - See Also:
- Constant Field Values
 
 - 
STATUS_CLOSEDstatic final java.lang.String STATUS_CLOSED - See Also:
- Constant Field Values
 
 - 
RESOLUTION_FIXEDstatic final java.lang.String RESOLUTION_FIXED - See Also:
- Constant Field Values
 
 - 
RESOLUTION_FALSE_POSITIVEstatic final java.lang.String RESOLUTION_FALSE_POSITIVE Resolution when issue is flagged as false positive.- See Also:
- Constant Field Values
 
 - 
RESOLUTION_REMOVEDstatic final java.lang.String RESOLUTION_REMOVED Resolution when rule has been uninstalled or disabled in the Quality profile.- See Also:
- Constant Field Values
 
 - 
RESOLUTION_WONT_FIXstatic final java.lang.String RESOLUTION_WONT_FIX Issue is irrelevant in the context and was muted by user.- Since:
- 5.1
- See Also:
- Constant Field Values
 
 - 
RESOLUTION_SAFEstatic final java.lang.String RESOLUTION_SAFE Security Hotspot has been reviewed and resolved as safe.- Since:
- 8.1
- See Also:
- Constant Field Values
 
 - 
RESOLUTION_ACKNOWLEDGEDstatic final java.lang.String RESOLUTION_ACKNOWLEDGED Security Hotspot has been reviewed and acknowledged that it poses a risk.- Since:
- 9.4
- See Also:
- Constant Field Values
 
 - 
RESOLUTIONSstatic final java.util.List<java.lang.String> RESOLUTIONS 
 - 
SECURITY_HOTSPOT_RESOLUTIONSstatic final java.util.List<java.lang.String> SECURITY_HOTSPOT_RESOLUTIONS 
 - 
STATUS_TO_REVIEWstatic final java.lang.String STATUS_TO_REVIEW - Since:
- 7.8
- See Also:
- Constant Field Values
 
 - 
STATUS_IN_REVIEW@Deprecated static final java.lang.String STATUS_IN_REVIEW Deprecated.since 8.1, status has been mapped as `TO_REVIEW`- See Also:
- Constant Field Values
 
 - 
STATUS_REVIEWEDstatic final java.lang.String STATUS_REVIEWED - Since:
- 7.8
- See Also:
- Constant Field Values
 
 - 
STATUSESstatic final java.util.List<java.lang.String> STATUSES Return all available statuses- Since:
- 4.4
 
 
- 
 - 
Method Detail- 
keyjava.lang.String key() Unique generated key. It looks like "d2de809c-1512-4ae2-9f34-f5345c9f1a13".
 - 
componentKeyjava.lang.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".
 - 
ruleKeyRuleKey ruleKey() 
 - 
languagejava.lang.String language() 
 - 
severity@Deprecated(since="10.1") @CheckForNull java.lang.String severity() Deprecated.since 10.1See constants inSeverity.
 - 
message@CheckForNull java.lang.String message() 
 - 
line@CheckForNull java.lang.Integer line() Optional line number. If set, then it's greater than or equal 1.
 - 
gap@CheckForNull java.lang.Double gap() Arbitrary distance to threshold for resolving the issue.
 For examples:- for the rule "Avoid too complex methods" : current complexity - max allowed complexity
- for the rule "Avoid Duplications" : number of duplicated blocks
- for the rule "Insufficient Line Coverage" : number of lines to cover to reach the accepted threshold
 - Since:
- 5.5
 
 - 
statusjava.lang.String status() See constant values inIssue.
 - 
resolution@CheckForNull java.lang.String resolution() The type of resolution, or null if the issue is not resolved. See constant values inIssue.
 - 
assignee@CheckForNull java.lang.String assignee() UUID of the user who is assigned to this issue. Null if the issue is not assigned.
 - 
creationDatejava.util.Date creationDate() 
 - 
updateDatejava.util.Date updateDate() 
 - 
closeDate@CheckForNull java.util.Date closeDate() Date when status was set toSTATUS_CLOSED, else null.
 - 
attribute@Deprecated @CheckForNull java.lang.String attribute(java.lang.String key) Deprecated.since 9.4, attribute was already not returning any element since 5.2
 - 
attributes@Deprecated java.util.Map<java.lang.String,java.lang.String> attributes() Deprecated.since 9.4, attribute was already not returning any element since 5.2
 - 
authorLogin@CheckForNull java.lang.String authorLogin() Login of the SCM account that introduced this issue. Requires the Developer Cockpit Plugin to be installed.
 - 
isNewboolean isNew() During a scan return if the current issue is a new one.- Returns:
- always false on server side
- Since:
- 4.0
 
 - 
isCopiedboolean isCopied() During a scan returns true if the issue is copied from another branch.- Since:
- 6.6
 
 - 
effort@CheckForNull Duration effort() - Since:
- 5.5
 
 - 
projectKeyjava.lang.String projectKey() - Since:
- 5.0
 
 - 
projectUuidjava.lang.String projectUuid() - Since:
- 5.0
 
 - 
componentUuidjava.lang.String componentUuid() - Since:
- 5.0
 
 - 
tagsjava.util.Collection<java.lang.String> tags() - Since:
- 5.1
 
 - 
codeVariants@CheckForNull java.util.Collection<java.lang.String> codeVariants() - Since:
- 9.17
 
 
- 
 
-