diff --git a/src/main/java/net/educoder/ecsonar/model/api/QualityInspectResultData.java b/src/main/java/net/educoder/ecsonar/model/api/QualityInspectResultData.java index 22da559..6d1e32b 100644 --- a/src/main/java/net/educoder/ecsonar/model/api/QualityInspectResultData.java +++ b/src/main/java/net/educoder/ecsonar/model/api/QualityInspectResultData.java @@ -28,6 +28,12 @@ public class QualityInspectResultData { */ private String name; + /** + * 是否识别 true可识别,false,不识别 + */ + private boolean discern; + + /** * 缺陷 */ @@ -88,6 +94,14 @@ public class QualityInspectResultData { this.name = name; } + public boolean isDiscern() { + return discern; + } + + public void setDiscern(boolean discern) { + this.discern = discern; + } + public Quality getBug() { return bug; } diff --git a/src/main/java/net/educoder/ecsonar/services/QualityInspectService.java b/src/main/java/net/educoder/ecsonar/services/QualityInspectService.java index 3bd5bc1..7c23be9 100644 --- a/src/main/java/net/educoder/ecsonar/services/QualityInspectService.java +++ b/src/main/java/net/educoder/ecsonar/services/QualityInspectService.java @@ -135,6 +135,7 @@ public class QualityInspectService { Metrics metrics = reportService.getMetrics(taskInfoDetail.getProjectName()); + resultData.setDiscern(!metrics.getBugs().equals("-")); resultData.setBug(new Quality(metrics.getBlock_bugs(), metrics.getMajor_bugs(), metrics.getMinor_bugs(), metrics.getCritical_bugs(), metrics.getBugs())); resultData.setVulnerability(new Quality(metrics.getBlock_violations(), metrics.getMajor_violations(), metrics.getMinor_violations(), metrics.getCritical_violations(), metrics.getViolations())); resultData.setCodeSmall(new Quality(metrics.getBlock_code_smells(), metrics.getMajor_code_smells(), metrics.getMinor_code_smells(), metrics.getCritical_code_smells(), metrics.getCode_smells()));