public function isSatisfedBy(MutationInterface $mutation, $index)
{
$filename = $mutation->getSourceFile();
//
// Avoid to make same mutations
if (!isset($this->alreadyMuted[$filename])) {
$this->alreadyMuted[$filename] = array();
}
foreach ($mutation->getMutedTokensIndexes() as $index) {
if (isset($this->alreadyMuted[$filename][$index])) {
return false;
}
$this->alreadyMuted[$filename][$index] = 1;
}
//
// keep only complex files
if (!isset($this->notes[$filename])) {
$bugs = $this->halstead->calculate($filename)->getBugs();
$this->notes[$filename] = $bugs;
}
return $this->notes[$filename] > $this->limit;
}