Flip negated conditions to positive for readability (S7735)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-10 00:59:37 +08:00
co-authored by Claude Opus 4.6
parent 5a936cad97
commit 804d78837b
14 changed files with 102 additions and 102 deletions
+18 -18
View File
@@ -178,9 +178,9 @@ export const useConformanceStore = defineStore("conformanceStore", {
case "dummy": //sonar-qube
case "duration-list":
copy.value = copy.value.map((v) =>
v !== null
? abbreviateNumber(new Decimal(v.toFixed(2)))
: null,
v === null
? null
: abbreviateNumber(new Decimal(v.toFixed(2))),
);
copy.value = copy.value.map((v) => (v ?? "").trim()).join(", ");
break;
@@ -194,15 +194,15 @@ export const useConformanceStore = defineStore("conformanceStore", {
switch (copy.type) {
case "date":
copy.value =
copy.value !== null
? moment(copy.value).format("YYYY/MM/DD HH:mm:ss")
: null;
copy.value === null
? null
: moment(copy.value).format("YYYY/MM/DD HH:mm:ss");
break;
case "float":
copy.value =
copy.value !== null
? new Decimal(copy.value).toFixed(2)
: null;
copy.value === null
? null
: new Decimal(copy.value).toFixed(2);
break;
default:
break;
@@ -234,15 +234,15 @@ export const useConformanceStore = defineStore("conformanceStore", {
switch (copy.type) {
case "date":
copy.value =
copy.value !== null
? moment(copy.value).format("YYYY/MM/DD HH:mm:ss")
: null;
copy.value === null
? null
: moment(copy.value).format("YYYY/MM/DD HH:mm:ss");
break;
case "float":
copy.value =
copy.value !== null
? new Decimal(copy.value).toFixed(2)
: null;
copy.value === null
? null
: new Decimal(copy.value).toFixed(2);
break;
default:
break;
@@ -306,10 +306,10 @@ export const useConformanceStore = defineStore("conformanceStore", {
const api = getCheckApiBase(this);
try {
const response = await apiClient.get(api);
if (!getRouteFile) {
this.allConformanceTempReportData = response.data;
} else {
if (getRouteFile) {
this.allRouteFile = response.data.file;
} else {
this.allConformanceTempReportData = response.data;
}
} catch (error) {
apiError(error, "Failed to Get the Temporary Log Conformance Report.");