Package org.sonar.api.issue
Interface Issue
-
- All Superinterfaces:
java.io.Serializable
public interface Issue extends java.io.Serializable- Since:
- 3.6
-
-
Field Summary
Fields Modifier and Type Field Description static intMESSAGE_MAX_SIZEMaximum number of characters in the message.static java.lang.StringRESOLUTION_ACKNOWLEDGEDDeprecated.since 10.4 as Security Hotspot are deprecated.static java.lang.StringRESOLUTION_FALSE_POSITIVEDeprecated.since 10.4 in favor ofIssueStatusstatic java.lang.StringRESOLUTION_FIXEDDeprecated.since 10.4 in favor ofIssueStatusstatic java.lang.StringRESOLUTION_REMOVEDDeprecated.since 10.4 in favor ofIssueStatusstatic java.lang.StringRESOLUTION_SAFEDeprecated.since 10.4 as Security Hotspot are deprecated.static java.lang.StringRESOLUTION_WONT_FIXDeprecated.since 10.4 in favor ofIssueStatusstatic java.util.List<java.lang.String>RESOLUTIONSDeprecated.since 10.4 in favor ofIssueStatusstatic java.util.List<java.lang.String>SECURITY_HOTSPOT_RESOLUTIONSDeprecated.since 10.4 as Security Hotspot are deprecatedstatic java.lang.StringSTATUS_CLOSEDDeprecated.since 10.4 in favor ofIssueStatusstatic java.lang.StringSTATUS_CONFIRMEDDeprecated.since 10.4 in favor ofIssueStatusstatic java.lang.StringSTATUS_IN_REVIEWDeprecated.since 8.1, status has been mapped as `TO_REVIEW`static java.lang.StringSTATUS_OPENDeprecated.since 10.4 in favor ofIssueStatusstatic java.lang.StringSTATUS_REOPENEDDeprecated.since 10.4 in favor ofIssueStatusstatic java.lang.StringSTATUS_RESOLVEDDeprecated.since 10.4 in favor ofIssueStatusstatic java.lang.StringSTATUS_REVIEWEDDeprecated.since 10.4 as Security Hotspot are deprecatedstatic java.lang.StringSTATUS_TO_REVIEWDeprecated.since 10.4 as Security Hotspot are deprecatedstatic java.util.List<java.lang.String>STATUSESDeprecated.since 10.4 in favor ofIssueStatus
-
Method Summary
All 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()Deprecated.since 10.4 in favor ofIssueStatusRuleKeyruleKey()java.lang.Stringseverity()Deprecated.since 10.1java.lang.Stringstatus()Deprecated.since 10.4 in favor ofIssueStatusjava.util.Collection<java.lang.String>tags()java.util.DateupdateDate()
-
-
-
Field Detail
-
MESSAGE_MAX_SIZE
static 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_OPEN
@Deprecated(since="10.4") static final java.lang.String STATUS_OPEN
Deprecated.since 10.4 in favor ofIssueStatusDefault status when creating an issue.- See Also:
- Constant Field Values
-
STATUS_CONFIRMED
@Deprecated(since="10.4") static final java.lang.String STATUS_CONFIRMED
Deprecated.since 10.4 in favor ofIssueStatus- See Also:
- Constant Field Values
-
STATUS_REOPENED
@Deprecated(since="10.4") static final java.lang.String STATUS_REOPENED
Deprecated.since 10.4 in favor ofIssueStatus- See Also:
- Constant Field Values
-
STATUS_RESOLVED
@Deprecated(since="10.4") static final java.lang.String STATUS_RESOLVED
Deprecated.since 10.4 in favor ofIssueStatus- See Also:
- Constant Field Values
-
STATUS_CLOSED
static final java.lang.String STATUS_CLOSED
Deprecated.since 10.4 in favor ofIssueStatus- See Also:
- Constant Field Values
-
RESOLUTION_FIXED
@Deprecated(since="10.4") static final java.lang.String RESOLUTION_FIXED
Deprecated.since 10.4 in favor ofIssueStatus- See Also:
- Constant Field Values
-
RESOLUTION_FALSE_POSITIVE
@Deprecated(since="10.4") static final java.lang.String RESOLUTION_FALSE_POSITIVE
Deprecated.since 10.4 in favor ofIssueStatus- See Also:
- Constant Field Values
-
RESOLUTION_REMOVED
@Deprecated(since="10.4") static final java.lang.String RESOLUTION_REMOVED
Deprecated.since 10.4 in favor ofIssueStatusResolution when rule has been uninstalled or disabled in the Quality profile.- See Also:
- Constant Field Values
-
RESOLUTION_WONT_FIX
@Deprecated(since="10.4") static final java.lang.String RESOLUTION_WONT_FIX
Deprecated.since 10.4 in favor ofIssueStatusIssue is irrelevant in the context and was muted by user.- Since:
- 5.1
- See Also:
- Constant Field Values
-
RESOLUTION_SAFE
@Deprecated(since="10.4") static final java.lang.String RESOLUTION_SAFE
Deprecated.since 10.4 as Security Hotspot are deprecated.Security Hotspot has been reviewed and resolved as safe.- Since:
- 8.1
- See Also:
- Constant Field Values
-
RESOLUTION_ACKNOWLEDGED
@Deprecated(since="10.4") static final java.lang.String RESOLUTION_ACKNOWLEDGED
Deprecated.since 10.4 as Security Hotspot are deprecated.Security Hotspot has been reviewed and acknowledged that it poses a risk.- Since:
- 9.4
- See Also:
- Constant Field Values
-
RESOLUTIONS
@Deprecated(since="10.4") static final java.util.List<java.lang.String> RESOLUTIONS
Deprecated.since 10.4 in favor ofIssueStatus
-
SECURITY_HOTSPOT_RESOLUTIONS
@Deprecated(since="10.4") static final java.util.List<java.lang.String> SECURITY_HOTSPOT_RESOLUTIONS
Deprecated.since 10.4 as Security Hotspot are deprecated
-
STATUS_TO_REVIEW
@Deprecated(since="10.4") static final java.lang.String STATUS_TO_REVIEW
Deprecated.since 10.4 as Security Hotspot are deprecated- See Also:
- Constant Field Values
-
STATUS_IN_REVIEW
@Deprecated(since="8.1") 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_REVIEWED
@Deprecated(since="10.4") static final java.lang.String STATUS_REVIEWED
Deprecated.since 10.4 as Security Hotspot are deprecated- See Also:
- Constant Field Values
-
STATUSES
@Deprecated(since="10.4") static final java.util.List<java.lang.String> STATUSES
Deprecated.since 10.4 in favor ofIssueStatusReturn all available statuses- Since:
- 4.4
-
-
Method Detail
-
key
java.lang.String key()
Unique generated key. It looks like "d2de809c-1512-4ae2-9f34-f5345c9f1a13".
-
componentKey
java.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".
-
ruleKey
RuleKey ruleKey()
-
language
java.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
-
status
@Deprecated(since="10.4") java.lang.String status()
Deprecated.since 10.4 in favor ofIssueStatusSee constant values inIssue.
-
resolution
@CheckForNull @Deprecated(since="10.4") java.lang.String resolution()
Deprecated.since 10.4 in favor ofIssueStatusThe 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.
-
creationDate
java.util.Date creationDate()
-
updateDate
java.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.
-
isNew
boolean isNew()
During a scan return if the current issue is a new one.- Returns:
- always false on server side
- Since:
- 4.0
-
isCopied
boolean isCopied()
During a scan returns true if the issue is copied from another branch.- Since:
- 6.6
-
effort
@CheckForNull Duration effort()
- Since:
- 5.5
-
projectKey
java.lang.String projectKey()
- Since:
- 5.0
-
projectUuid
java.lang.String projectUuid()
- Since:
- 5.0
-
componentUuid
java.lang.String componentUuid()
- Since:
- 5.0
-
tags
java.util.Collection<java.lang.String> tags()
- Since:
- 5.1
-
codeVariants
@CheckForNull java.util.Collection<java.lang.String> codeVariants()
- Since:
- 9.17
-
-