Refactoring the baseline handling. #70
ci.yaml
on: push
Coding Standard & Static Analysis
2m 39s
Matrix: Unittests
Annotations
11 warnings
Unittests (8.2)
Codecov: Failed to properly create commit: The process '/home/runner/work/_actions/codecov/codecov-action/v4/dist/codecov' failed with exit code 1
|
Coding Standard & Static Analysis:
src/Business/AbstractMetricCollector.php#L54
Escaped Mutant for Mutator "ArrayItemRemoval":
@@ @@
*/
protected function findSourceFiles(string $path, array $exclude = []): iterable
{
- return $this->directoryScanner->scan([$path], ['^(?!.*\.php$).+'] + $exclude);
+ return $this->directoryScanner->scan([$path], [] + $exclude);
// Exclude non-PHP files
}
protected function traverseAbstractSyntaxTree(string $code): void
|
Coding Standard & Static Analysis:
src/Business/Cognitive/CognitiveMetrics.php#L65
Escaped Mutant for Mutator "MethodCallRemoval":
@@ @@
*/
public function __construct(array $metrics)
{
- $this->assertArrayKeyIsPresent($metrics, 'class');
+
$this->assertArrayKeyIsPresent($metrics, 'method');
$this->method = $metrics['method'];
$this->class = $metrics['class'];
|
Coding Standard & Static Analysis:
src/Business/Cognitive/CognitiveMetrics.php#L66
Escaped Mutant for Mutator "MethodCallRemoval":
@@ @@
public function __construct(array $metrics)
{
$this->assertArrayKeyIsPresent($metrics, 'class');
- $this->assertArrayKeyIsPresent($metrics, 'method');
+
$this->method = $metrics['method'];
$this->class = $metrics['class'];
$this->setRequiredMetricProperties($metrics);
|
Coding Standard & Static Analysis:
src/Business/Cognitive/CognitiveMetrics.php#L71
Escaped Mutant for Mutator "MethodCallRemoval":
@@ @@
$this->method = $metrics['method'];
$this->class = $metrics['class'];
$this->setRequiredMetricProperties($metrics);
- $this->setOptionalMetricProperties($metrics);
+
}
/**
* @param array<string, mixed> $metrics
|
Coding Standard & Static Analysis:
src/Business/Cognitive/CognitiveMetrics.php#L81
Escaped Mutant for Mutator "MethodCallRemoval":
@@ @@
private function setRequiredMetricProperties(array $metrics): void
{
foreach ($this->metrics as $metricName) {
- $this->assertArrayKeyIsPresent($metrics, $metricName);
+
$this->{$metricName} = $metrics[$metricName];
}
}
|
Coding Standard & Static Analysis:
src/Business/Cognitive/CognitiveMetrics.php#L92
Escaped Mutant for Mutator "Foreach_":
@@ @@
*/
private function setOptionalMetricProperties(array $metrics): void
{
- foreach ($this->metrics as $metricName) {
+ foreach ([] as $metricName) {
$property = $metricName . 'Weight';
if (array_key_exists($property, $metrics)) {
$this->{$property} = $metrics[$property];
|
Coding Standard & Static Analysis:
src/Business/Cognitive/CognitiveMetrics.php#L93
Escaped Mutant for Mutator "Concat":
@@ @@
private function setOptionalMetricProperties(array $metrics): void
{
foreach ($this->metrics as $metricName) {
- $property = $metricName . 'Weight';
+ $property = 'Weight' . $metricName;
if (array_key_exists($property, $metrics)) {
$this->{$property} = $metrics[$property];
}
|
Coding Standard & Static Analysis:
src/Business/Cognitive/CognitiveMetrics.php#L93
Escaped Mutant for Mutator "ConcatOperandRemoval":
@@ @@
private function setOptionalMetricProperties(array $metrics): void
{
foreach ($this->metrics as $metricName) {
- $property = $metricName . 'Weight';
+ $property = 'Weight';
if (array_key_exists($property, $metrics)) {
$this->{$property} = $metrics[$property];
}
|
Coding Standard & Static Analysis:
src/Business/Cognitive/CognitiveMetrics.php#L93
Escaped Mutant for Mutator "ConcatOperandRemoval":
@@ @@
private function setOptionalMetricProperties(array $metrics): void
{
foreach ($this->metrics as $metricName) {
- $property = $metricName . 'Weight';
+ $property = $metricName;
if (array_key_exists($property, $metrics)) {
$this->{$property} = $metrics[$property];
}
|
Coding Standard & Static Analysis:
src/Business/Cognitive/CognitiveMetrics.php#L121
Escaped Mutant for Mutator "MethodCallRemoval":
@@ @@
*/
public function calculateDeltas(self $other): void
{
- $this->assertSame($other);
+
$this->lineCountWeightDelta = new Delta($other->getLineCountWeight(), $this->lineCountWeight);
$this->argCountWeightDelta = new Delta($other->getArgCountWeight(), $this->argCountWeight);
$this->returnCountWeightDelta = new Delta($other->getReturnCountWeight(), $this->returnCountWeight);
|