Add division by zero guards in traceList computed and conformance rate
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -165,6 +165,7 @@ const traceList = computed(() => {
|
||||
const sum = props.listTraces
|
||||
.map((trace) => trace.count)
|
||||
.reduce((acc, cur) => acc + cur, 0);
|
||||
if (sum === 0) return [];
|
||||
|
||||
return props.listTraces
|
||||
.map((trace) => {
|
||||
@@ -274,7 +275,7 @@ watch(infinite404, (newValue) => {
|
||||
* @returns {string} The formatted percentage string.
|
||||
*/
|
||||
function getPercentLabel(val) {
|
||||
if ((val * 100).toFixed(1) >= 100) return 100;
|
||||
if (Number((val * 100).toFixed(1)) >= 100) return 100;
|
||||
else return parseFloat((val * 100).toFixed(1));
|
||||
}
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user