fix mutation badge #7
Annotations
1 error and 10 warnings
lint
Process completed with exit code 201.
|
infection:
src/Comments/Comment.php#L42
Escaped Mutant for Mutator "TrueValue":
@@ @@
if ($this->isWithinThreshold($count, $thresholds)) {
return 'green';
}
- $this->exceedThreshold = true;
+ $this->exceedThreshold = false;
return 'red';
}
/** @param array<string, float> $thresholds */
|
infection:
src/Comments/Comment.php#L47
Escaped Mutant for Mutator "ProtectedVisibility":
@@ @@
return 'red';
}
/** @param array<string, float> $thresholds */
- protected function isWithinThreshold(int $count, array $thresholds): bool
+ private function isWithinThreshold(int $count, array $thresholds): bool
{
$comparisonValue = $thresholds[static::NAME];
if (static::COMPARISON_TYPE === '>=') {
|
infection:
src/Comments/Comment.php#L52
Escaped Mutant for Mutator "GreaterThanOrEqualTo":
@@ @@
{
$comparisonValue = $thresholds[static::NAME];
if (static::COMPARISON_TYPE === '>=') {
- return $count >= $comparisonValue;
+ return $count > $comparisonValue;
}
return $count <= $comparisonValue;
}
|
infection:
src/Composer/CommentsDensityPlugin.php#L99
Escaped Mutant for Mutator "DecrementInteger":
@@ @@
return;
}
copy($source, $destination);
- chmod($destination, 0755);
+ chmod($destination, 492);
$ioHelper->write('Pre-commit hook installed.');
return;
}
|
infection:
src/Composer/CommentsDensityPlugin.php#L99
Escaped Mutant for Mutator "IncrementInteger":
@@ @@
return;
}
copy($source, $destination);
- chmod($destination, 0755);
+ chmod($destination, 494);
$ioHelper->write('Pre-commit hook installed.');
return;
}
|
infection:
src/Composer/CommentsDensityPlugin.php#L99
Escaped Mutant for Mutator "FunctionCallRemoval":
@@ @@
return;
}
copy($source, $destination);
- chmod($destination, 0755);
+
$ioHelper->write('Pre-commit hook installed.');
return;
}
|
infection:
src/Composer/CommentsDensityPlugin.php#L117
Escaped Mutant for Mutator "FunctionCallRemoval":
@@ @@
$shouldCreateConfig = $interface->askConfirmation('Do you want to create a default configuration file? [y/N] ');
if ($shouldCreateConfig) {
$interface->write('Creating default configuration file...');
- file_put_contents('comments_density.php', self::CONFIG);
+
$interface->write('Default configuration file created.');
return;
}
|
infection:
src/ConfigLoader.php#L71
Escaped Mutant for Mutator "Coalesce":
@@ @@
*/
private function getOutput(array $config): OutputDTO
{
- $type = $config['output']['type'] ?? 'console';
+ $type = 'console' ?? $config['output']['type'];
$file = $config['output']['file'] ?? 'output.html';
$file = $this->getProjectRoot() . DIRECTORY_SEPARATOR . $file;
return new OutputDTO($type, $file);
|
infection:
src/ConfigLoader.php#L73
Escaped Mutant for Mutator "ConcatOperandRemoval":
@@ @@
{
$type = $config['output']['type'] ?? 'console';
$file = $config['output']['file'] ?? 'output.html';
- $file = $this->getProjectRoot() . DIRECTORY_SEPARATOR . $file;
+ $file = DIRECTORY_SEPARATOR . $file;
return new OutputDTO($type, $file);
}
/**
|
infection:
src/ConfigLoader.php#L126
Escaped Mutant for Mutator "UnwrapArrayMap":
@@ @@
*/
private function getDirectories(array $config): array
{
- $directories = array_map(fn($dir) => $this->getProjectRoot() . '/' . $dir, $config['directories']);
+ $directories = $config['directories'];
foreach ($directories as $dir) {
if (!is_dir($dir)) {
throw new CommentsDensityException($dir . ' directory does not exist');
|