update readme #26
Annotations
13 warnings
lint
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
composer
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
infection
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
infection:
src/AnalyzeComments/Analyzer/Visitors/CommentVisitor.php#L24
Escaped Mutant for Mutator "ArrayItemRemoval":
@@ @@
}
public function enterNode(Node $node): null
{
- $comments = array_unique(array_filter([$node->getDocComment(), ...$node->getComments()]));
+ $comments = array_unique(array_filter([...$node->getComments()]));
foreach ($comments as $comment) {
$commentType = $this->commentFactory->classifyComment($comment->getText());
if ($commentType === null) {
|
infection:
src/AnalyzeComments/Comments/Comment.php#L44
Escaped Mutant for Mutator "PublicVisibility":
@@ @@
$this->exceedThreshold = true;
return 'red';
}
- final public function getPattern(): string
+ final protected function getPattern(): string
{
return static::PATTERN;
}
|
infection:
src/AnalyzeComments/Comments/Comment.php#L65
Escaped Mutant for Mutator "ProtectedVisibility":
@@ @@
return static::NAME;
}
/** @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/AnalyzeComments/Comments/Comment.php#L70
Escaped Mutant for Mutator "GreaterThanOrEqualTo":
@@ @@
{
$comparisonValue = $thresholds[static::NAME];
if (static::COMPARISON_TYPE === '>=') {
- return $count >= $comparisonValue;
+ return $count > $comparisonValue;
}
return $count <= $comparisonValue;
}
}
|
infection:
src/AnalyzeComments/Comments/CommentTypeFactory.php#L42
Escaped Mutant for Mutator "Identical":
@@ @@
public function getCommentType(string $name): ?CommentTypeInterface
{
foreach ($this->commentTypes as $commentType) {
- if ($commentType->getName() === $name) {
+ if ($commentType->getName() !== $name) {
return $commentType;
}
}
|
infection:
src/AnalyzeComments/Comments/CommentTypeFactory.php#L57
Escaped Mutant for Mutator "LogicalOrAllSubExprNegation":
@@ @@
if (!$commentType->matchesPattern($comment)) {
continue;
}
- if ($this->allowedTypes === [] || in_array($commentType->getName(), $this->allowedTypes, true)) {
+ if (!($this->allowedTypes === []) || !in_array($commentType->getName(), $this->allowedTypes, true)) {
return $commentType;
}
}
|
infection:
src/AnalyzeComments/Comments/CommentTypeFactory.php#L57
Escaped Mutant for Mutator "LogicalOrSingleSubExprNegation":
@@ @@
if (!$commentType->matchesPattern($comment)) {
continue;
}
- if ($this->allowedTypes === [] || in_array($commentType->getName(), $this->allowedTypes, true)) {
+ if ($this->allowedTypes === [] || !in_array($commentType->getName(), $this->allowedTypes, true)) {
return $commentType;
}
}
|
infection:
src/AnalyzeComments/Config/DTO/Config.php#L36
Escaped Mutant for Mutator "TrueValue":
@@ @@
/** Directories to be ignored during scanning */
public array $exclude = [],
/** Filter collected comments against the baseline stored in baseline.php */
- public bool $useBaseline = true,
+ public bool $useBaseline = false,
public string $cacheDir = 'var/cache/comments-density',
/** Disable certain types; set to empty array for full statistics */
public array $disable = [],
|
infection:
src/AnalyzeComments/Config/DTO/Config.php#L42
Escaped Mutant for Mutator "Coalesce":
@@ @@
public array $plugins = []
)
{
- $this->output = $output ?? ConsoleOutputDTO::create();
+ $this->output = ConsoleOutputDTO::create() ?? $output;
}
/**
* @return non-empty-string[]
|
infection:
src/AnalyzeComments/Config/DTO/Config.php#L50
Escaped Mutant for Mutator "ArrayItemRemoval":
@@ @@
*/
public function getAllowedTypes(): array
{
- $types = [DocBlockComment::NAME, RegularComment::NAME, LicenseComment::NAME, TodoComment::NAME, FixMeComment::NAME, MissingDocBlock::NAME];
+ $types = [RegularComment::NAME, LicenseComment::NAME, TodoComment::NAME, FixMeComment::NAME, MissingDocBlock::NAME];
return array_diff($types, $this->disable);
}
}
|