Skip to content

Commit e81fd6e

Browse files
fix: exclude uncomputed MI=0 rows from threshold filtering
The --above-threshold filter for maintainabilityIndex now requires MI > 0, consistent with the exceeds array logic that already guards against uncomputed rows from pre-migration databases. Impact: 1 functions changed, 4 affected Impact: 1 functions changed, 1 affected
1 parent 67318af commit e81fd6e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/complexity.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,9 @@ export function complexityData(customDbPath, opts = {}) {
712712
conditions.push(`fc.max_nesting >= ${thresholds.maxNesting.warn}`);
713713
}
714714
if (thresholds.maintainabilityIndex?.warn != null) {
715-
conditions.push(`fc.maintainability_index <= ${thresholds.maintainabilityIndex.warn}`);
715+
conditions.push(
716+
`fc.maintainability_index > 0 AND fc.maintainability_index <= ${thresholds.maintainabilityIndex.warn}`,
717+
);
716718
}
717719
if (conditions.length > 0) {
718720
having = `AND (${conditions.join(' OR ')})`;

0 commit comments

Comments
 (0)