Stryker

grades.js - Stryker report

File / Directory
Mutation score
# Killed
# Survived
# Timeout
# No coverage
# Runtime errors
# Transpile errors
Total detected
Total undetected
Total mutants
grades.js
55.00 %
55.00 11 9 0 0 0 0 11 9 20
Expand all
const gradeRules = 0[
  1{ cutoff: 90, grade: 2'A'},
  3{ cutoff: 80, grade: 4'B'},
  5{ cutoff: 70, grade: 6'C'},
  7{ cutoff: 60, grade: 8'D'},
  9{ cutoff: 0, grade: 10'F'},
];

function calculateGrade(score) 11{
  for (const rule of gradeRules) 12{
    if (13141516score >= rule.cutoff) 17{
      return rule.grade;
    }
  }
  return 18'Unknown';
}

module.exports = 19{ calculateGrade };
# Mutator State Location Original Replacement
0 ArrayLiteral Killed 0 : 19 [ {...'}, ] []
1 ObjectLiteral Killed 1 : 2 { ... ' '} {}
2 StringLiteral Killed 1 : 23 ' ' ""
3 ObjectLiteral Survived 2 : 2 { ... ' '} {}
4 StringLiteral Survived 2 : 23 ' ' ""
5 ObjectLiteral Survived 3 : 2 { ... ' '} {}
6 StringLiteral Survived 3 : 23 ' ' ""
7 ObjectLiteral Survived 4 : 2 { ... ' '} {}
8 StringLiteral Survived 4 : 23 ' ' ""
9 ObjectLiteral Survived 5 : 2 { ... ' '} {}
10 StringLiteral Survived 5 : 22 ' ' ""
11 Block Killed 8 : 31 { ... '; } {}
12 Block Killed 9 : 33 { ...} } {}
13 IfStatement Killed 10 : 8 >= .
14 IfStatement Killed 10 : 8 >= .
15 BinaryExpression Survived 10 : 8 >= . > .
16 BinaryExpression Killed 10 : 8 >= . < .
17 Block Killed 10 : 30 { ... } {}
18 StringLiteral Killed 14 : 9 ' ' ""
19 ObjectLiteral Killed 17 : 17 { ... } {}