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
parent 5a936cad97
commit 804d78837b
14 changed files with 102 additions and 102 deletions

View File

@@ -1670,7 +1670,7 @@ function checkCycleTime() {
return disabled;
}
function checkStartAndEnd(start, end) {
return !isAlreadySubmit.value ? !(start && end) : start !== end;
return isAlreadySubmit.value ? start !== end : !(start && end);
}
// created() logic

View File

@@ -173,7 +173,7 @@ const data = computed(() => {
// Sort the Activity List
return [...filteredData.value].sort((x, y) => {
const diff = y.occurrences - x.occurrences;
return diff !== 0 ? diff : sortNumEngZhtwForFilter(x.label, y.label);
return diff === 0 ? sortNumEngZhtwForFilter(x.label, y.label) : diff;
});
});

View File

@@ -113,8 +113,8 @@ function isRule(e, index) {
const rule = isRuleData.value[index];
// First get the rule object
// To preserve data order, set the value to 0 and remove it during submitAll
if (!e) temporaryData.value[index] = 0;
else temporaryData.value[index] = rule;
if (e) temporaryData.value[index] = rule;
else temporaryData.value[index] = 0;
}
/**

View File

@@ -1008,14 +1008,14 @@ function getTraceData(isExclude) {
* @param {Array} postData - The submitted filter data.
*/
function updateRules(postData) {
if (!temporaryData.value?.length) {
temporaryData.value.push(...postData);
isRuleData.value = Array.from(temporaryData.value);
ruleData.value = isRuleData.value.map((e) => setRule(e));
} else {
if (temporaryData.value?.length) {
temporaryData.value.push(...postData);
isRuleData.value.push(...postData);
ruleData.value.push(...postData.map((e) => setRule(e)));
} else {
temporaryData.value.push(...postData);
isRuleData.value = Array.from(temporaryData.value);
ruleData.value = isRuleData.value.map((e) => setRule(e));
}
}