Stryker

calculateHintCost.js - Stryker report

File / Directory
Mutation score
# Killed
# Survived
# Timeout
# No coverage
# Runtime errors
# Transpile errors
Total detected
Total undetected
Total mutants
calculateHintCost.js
100.00 %
100.00 10 0 0 0 0 0 10 0 10
Expand all
const calculateScore = require('./calculateScore')
const options = require('./options')

/* The hint costs depend on the kind of hint and the difficulty of the challenge they are for:
 paid text hint     = 10% of the challenge's score value
 paid url hint      = 20% of the challenge's score value
 free text/url hint = free (as in free beer)
 */
function calculateHintCost ({difficulty}, hintOption) 0{
  let costMultiplier = 0
  if (123hintOption === options.paidTextHints) 4{
    costMultiplier = 0.1
  } else if (567hintOption === options.paidHintUrls) 8{
    costMultiplier = 0.2
  }
  return 9costMultiplier * calculateScore(difficulty)
}
module.exports = calculateHintCost

# Mutator State Location Original Replacement
0 BlockStatement Killed 8 : 54 { ... ) } { }
1 RemoveConditionals Killed 10 : 6 === .
2 BinaryOperator Killed 10 : 6 === . !== .
3 RemoveConditionals Killed 10 : 6 === .
4 BlockStatement Killed 10 : 44 { ... } { }
5 RemoveConditionals Killed 12 : 13 === .
6 RemoveConditionals Killed 12 : 13 === .
7 BinaryOperator Killed 12 : 13 === . !== .
8 BlockStatement Killed 12 : 50 { ... } { }
9 BinaryOperator Killed 15 : 9 * ... ) / ... )