Skip to content

Integrate sidz/phpstan-rules to avoid magic numbers in our code base #903

Integrate sidz/phpstan-rules to avoid magic numbers in our code base

Integrate sidz/phpstan-rules to avoid magic numbers in our code base #903

Triggered via pull request May 15, 2023 08:41
Status Success
Total duration 4m 5s
Artifacts

mt-annotations.yaml

on: pull_request
Matrix: tests
Annotations Status
1s
Annotations Status
Fit to window
Zoom out
Zoom in

Annotations

10 warnings
Mutation Testing Code Review Annotations 8.1: src/Event/Subscriber/MutationTestingConsoleLoggerSubscriber.php#L237
Escaped Mutant for Mutator "GreaterThanOrEqualTo": --- Original +++ New @@ @@ } private function getPercentageTag(float $percentage) : string { - if ($percentage >= 0 && $percentage < self::LOW_QUALITY_THRESHOLD) { + if ($percentage > 0 && $percentage < self::LOW_QUALITY_THRESHOLD) { return 'low'; } if ($percentage >= self::LOW_QUALITY_THRESHOLD && $percentage < self::MEDIUM_QUALITY_THRESHOLD) {
Mutation Testing Code Review Annotations 8.1: src/Event/Subscriber/MutationTestingConsoleLoggerSubscriber.php#L237
Escaped Mutant for Mutator "GreaterThanOrEqualToNegotiation": --- Original +++ New @@ @@ } private function getPercentageTag(float $percentage) : string { - if ($percentage >= 0 && $percentage < self::LOW_QUALITY_THRESHOLD) { + if ($percentage < 0 && $percentage < self::LOW_QUALITY_THRESHOLD) { return 'low'; } if ($percentage >= self::LOW_QUALITY_THRESHOLD && $percentage < self::MEDIUM_QUALITY_THRESHOLD) {
Mutation Testing Code Review Annotations 8.1: src/Event/Subscriber/MutationTestingConsoleLoggerSubscriber.php#L237
Escaped Mutant for Mutator "LessThan": --- Original +++ New @@ @@ } private function getPercentageTag(float $percentage) : string { - if ($percentage >= 0 && $percentage < self::LOW_QUALITY_THRESHOLD) { + if ($percentage >= 0 && $percentage <= self::LOW_QUALITY_THRESHOLD) { return 'low'; } if ($percentage >= self::LOW_QUALITY_THRESHOLD && $percentage < self::MEDIUM_QUALITY_THRESHOLD) {
Mutation Testing Code Review Annotations 8.1: src/Event/Subscriber/MutationTestingConsoleLoggerSubscriber.php#L237
Escaped Mutant for Mutator "LessThanNegotiation": --- Original +++ New @@ @@ } private function getPercentageTag(float $percentage) : string { - if ($percentage >= 0 && $percentage < self::LOW_QUALITY_THRESHOLD) { + if ($percentage >= 0 && $percentage >= self::LOW_QUALITY_THRESHOLD) { return 'low'; } if ($percentage >= self::LOW_QUALITY_THRESHOLD && $percentage < self::MEDIUM_QUALITY_THRESHOLD) {
Mutation Testing Code Review Annotations 8.1: src/Event/Subscriber/MutationTestingConsoleLoggerSubscriber.php#L237
Escaped Mutant for Mutator "LogicalAnd": --- Original +++ New @@ @@ } private function getPercentageTag(float $percentage) : string { - if ($percentage >= 0 && $percentage < self::LOW_QUALITY_THRESHOLD) { + if ($percentage >= 0 || $percentage < self::LOW_QUALITY_THRESHOLD) { return 'low'; } if ($percentage >= self::LOW_QUALITY_THRESHOLD && $percentage < self::MEDIUM_QUALITY_THRESHOLD) {
Mutation Testing Code Review Annotations 8.1: src/Event/Subscriber/MutationTestingConsoleLoggerSubscriber.php#L237
Escaped Mutant for Mutator "LogicalAndAllSubExprNegation": --- Original +++ New @@ @@ } private function getPercentageTag(float $percentage) : string { - if ($percentage >= 0 && $percentage < self::LOW_QUALITY_THRESHOLD) { + if (!($percentage >= 0) && !($percentage < self::LOW_QUALITY_THRESHOLD)) { return 'low'; } if ($percentage >= self::LOW_QUALITY_THRESHOLD && $percentage < self::MEDIUM_QUALITY_THRESHOLD) {
Mutation Testing Code Review Annotations 8.1: src/Event/Subscriber/MutationTestingConsoleLoggerSubscriber.php#L237
Escaped Mutant for Mutator "LogicalAndNegation": --- Original +++ New @@ @@ } private function getPercentageTag(float $percentage) : string { - if ($percentage >= 0 && $percentage < self::LOW_QUALITY_THRESHOLD) { + if (!($percentage >= 0 && $percentage < self::LOW_QUALITY_THRESHOLD)) { return 'low'; } if ($percentage >= self::LOW_QUALITY_THRESHOLD && $percentage < self::MEDIUM_QUALITY_THRESHOLD) {
Mutation Testing Code Review Annotations 8.1: src/Mutant/MutantExecutionResultFactory.php#L106
Escaped Mutant for Mutator "GreaterThan": --- Original +++ New @@ @@ return DetectionStatus::TIMED_OUT; } $process = $mutantProcess->getProcess(); - if ($process->getExitCode() > self::PROCESS_MIN_ERROR_CODE) { + if ($process->getExitCode() >= self::PROCESS_MIN_ERROR_CODE) { // See \Symfony\Component\Process\Process::$exitCodes return DetectionStatus::ERROR; }
Mutation Testing Code Review Annotations 8.1: src/Process/Runner/ParallelProcessRunner.php#L177
Escaped Mutant for Mutator "Minus": --- Original +++ New @@ @@ $start = microtime(true); $bucket[] = $input->current(); $input->next(); - return (int) (microtime(true) - $start) * self::NANO_SECONDS_IN_MILLI_SECOND; + return (int) (microtime(true) + $start) * self::NANO_SECONDS_IN_MILLI_SECOND; // ns to ms } /**
Mutation Testing Code Review Annotations 8.1: src/Resource/Memory/MemoryFormatter.php#L74
Escaped Mutant for Mutator "GreaterThan": --- Original +++ New @@ @@ public function toHumanReadableString(float $bytes) : string { Assert::greaterThanEq($bytes, 0.0, 'Expected a positive or null amount of bytes. Got: %s'); - $power = $bytes > 0 ? (int) round(log($bytes, self::BYTES_IN_KB - 1)) : 0; + $power = $bytes >= 0 ? (int) round(log($bytes, self::BYTES_IN_KB - 1)) : 0; return sprintf('%s%s', number_format($bytes / self::BYTES_IN_KB ** $power, self::DECIMALS_TO_SHOW, '.', ','), self::UNITS[$power]); } }