Search in sources :

Example 1 with DefaultServerIssue

use of org.sonarsource.sonarlint.core.container.model.DefaultServerIssue in project sonarlint-core by SonarSource.

the class IssueStoreReaderTest method createApiIssue.

private ServerIssue createApiIssue(String moduleKey, String filePath) {
    DefaultServerIssue issue = new DefaultServerIssue();
    issue.setFilePath(filePath);
    issue.setModuleKey(moduleKey);
    return issue;
}
Also used : DefaultServerIssue(org.sonarsource.sonarlint.core.container.model.DefaultServerIssue)

Example 2 with DefaultServerIssue

use of org.sonarsource.sonarlint.core.container.model.DefaultServerIssue in project sonarlint-core by SonarSource.

the class IssueStoreReader method transformIssue.

private static ServerIssue transformIssue(ScannerInput.ServerIssue pbIssue, String moduleKey, String filePath) {
    DefaultServerIssue issue = new DefaultServerIssue();
    issue.setAssigneeLogin(pbIssue.getAssigneeLogin());
    issue.setAssigneeLogin(pbIssue.getAssigneeLogin());
    issue.setChecksum(pbIssue.getChecksum());
    issue.setLine(pbIssue.getLine());
    issue.setFilePath(filePath);
    issue.setModuleKey(moduleKey);
    issue.setManualSeverity(pbIssue.getManualSeverity());
    issue.setMessage(pbIssue.getMsg());
    issue.setSeverity(pbIssue.getSeverity().name());
    if (pbIssue.hasType()) {
        // type was added recently
        issue.setType(pbIssue.getType());
    }
    issue.setCreationDate(Instant.ofEpochMilli(pbIssue.getCreationDate()));
    issue.setResolution(pbIssue.getResolution());
    issue.setKey(pbIssue.getKey());
    issue.setRuleKey(pbIssue.getRuleRepository() + ":" + pbIssue.getRuleKey());
    return issue;
}
Also used : DefaultServerIssue(org.sonarsource.sonarlint.core.container.model.DefaultServerIssue)

Aggregations

DefaultServerIssue (org.sonarsource.sonarlint.core.container.model.DefaultServerIssue)2