From 83615902108fe00529744b1dd1f9ac9378082844 Mon Sep 17 00:00:00 2001 From: youys <1272586223@qq.com> Date: Fri, 21 Jan 2022 18:38:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AD=97=E6=AE=B5=EF=BC=8C?= =?UTF-8?q?=E8=AF=B4=E6=98=8E=E8=AF=A5=E7=94=A8=E6=88=B7=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E8=A2=AB=E8=AF=86=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/api/QualityInspectResultData.java | 14 ++++++++++++++ .../ecsonar/services/QualityInspectService.java | 1 + 2 files changed, 15 insertions(+) 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()));