From ec5c44dd34ba4e77d43a0f6b67c9326a38c243dc Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Mon, 23 Feb 2015 21:51:43 +0100 Subject: Fix quality flaws --- .../org/sonar/batch/report/IssuesPublisher.java | 46 +++++++++++++--------- 1 file changed, 28 insertions(+), 18 deletions(-) (limited to 'sonar-batch') diff --git a/sonar-batch/src/main/java/org/sonar/batch/report/IssuesPublisher.java b/sonar-batch/src/main/java/org/sonar/batch/report/IssuesPublisher.java index a8e03ed8a4c..8be01240274 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/report/IssuesPublisher.java +++ b/sonar-batch/src/main/java/org/sonar/batch/report/IssuesPublisher.java @@ -81,33 +81,43 @@ public class IssuesPublisher implements ReportPublisher { if (message != null) { builder.setMsg(message); } - if (issue.effortToFix() != null) { - builder.setEffortToFix(issue.effortToFix()); + Double effortToFix = issue.effortToFix(); + if (effortToFix != null) { + builder.setEffortToFix(effortToFix); } - if (issue.debtInMinutes() != null) { - builder.setDebtInMinutes(issue.debtInMinutes()); + + Long debtInMinutes = issue.debtInMinutes(); + if (debtInMinutes != null) { + builder.setDebtInMinutes(debtInMinutes); } - if (issue.resolution() != null) { - builder.setResolution(issue.resolution()); + String resolution = issue.resolution(); + if (resolution != null) { + builder.setResolution(resolution); } - if (issue.status() != null) { - builder.setStatus(issue.status()); + String status = issue.status(); + if (status != null) { + builder.setStatus(status); } - if (issue.checksum() != null) { - builder.setChecksum(issue.checksum()); + String checksum = issue.checksum(); + if (checksum != null) { + builder.setChecksum(checksum); } builder.setManualSeverity(issue.manualSeverity()); - if (issue.reporter() != null) { - builder.setReporter(issue.reporter()); + String reporter = issue.reporter(); + if (reporter != null) { + builder.setReporter(reporter); } - if (issue.assignee() != null) { - builder.setAssignee(issue.assignee()); + String assignee = issue.assignee(); + if (assignee != null) { + builder.setAssignee(assignee); } - if (issue.actionPlanKey() != null) { - builder.setActionPlanKey(issue.actionPlanKey()); + String actionPlanKey = issue.actionPlanKey(); + if (actionPlanKey != null) { + builder.setActionPlanKey(actionPlanKey); } - if (issue.authorLogin() != null) { - builder.setAuthorLogin(issue.authorLogin()); + String authorLogin = issue.authorLogin(); + if (authorLogin != null) { + builder.setAuthorLogin(authorLogin); } String diff = diffsToString(issue.currentChange()); if (diff != null) { -- cgit v1.2.3