Examples of IssuesBySeverity


Examples of org.sonar.core.issue.IssuesBySeverity

  public void executeOn(Project project, SensorContext context) {
    sendNotifications(project);
  }

  private void sendNotifications(Project project) {
    IssuesBySeverity newIssues = new IssuesBySeverity();
    IssueChangeContext context = IssueChangeContext.createScan(project.getAnalysisDate());
    Map<DefaultIssue, Rule> shouldSentNotification = new LinkedHashMap<DefaultIssue, Rule>();
    for (DefaultIssue issue : issueCache.all()) {
      if (issue.isNew() && issue.resolution() == null) {
        newIssues.add(issue);
      }
      if (!issue.isNew() && issue.isChanged() && issue.mustSendNotifications()) {
        Rule rule = ruleFinder.findByKey(issue.ruleKey());
        // TODO warning - rules with status REMOVED are currently ignored, but should not
        if (rule != null) {
          shouldSentNotification.put(issue, rule);
        }
      }
    }
    if (!shouldSentNotification.isEmpty()) {
      notifications.sendChanges(shouldSentNotification, context, project, null, null);
    }
    if (!newIssues.isEmpty()) {
      notifications.sendNewIssues(project, newIssues);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.