Trying to remove false positive on logical or. #860
mt-annotations.yaml
on: pull_request
Matrix: tests
Annotations Status
2s
Annotations
10 warnings
Mutation Testing Code Review Annotations 8.0:
src/Mutator/Boolean/LogicalOr.php#L92
Escaped Mutant for Mutator "LogicalOr":
--- Original
+++ New
@@ @@
}
$nodeLeft = $node->left;
$nodeRight = $node->right;
- if (!property_exists($nodeLeft, 'left') || !property_exists($nodeLeft, 'right') || !property_exists($nodeRight, 'left') || !property_exists($nodeRight, 'right')) {
+ if (!property_exists($nodeLeft, 'left') && !property_exists($nodeLeft, 'right') || !property_exists($nodeRight, 'left') || !property_exists($nodeRight, 'right')) {
return true;
}
$nodeLeftLeft = $nodeLeft->left;
|
Mutation Testing Code Review Annotations 8.0:
src/Mutator/Boolean/LogicalOr.php#L92
Escaped Mutant for Mutator "LogicalOr":
--- Original
+++ New
@@ @@
}
$nodeLeft = $node->left;
$nodeRight = $node->right;
- if (!property_exists($nodeLeft, 'left') || !property_exists($nodeLeft, 'right') || !property_exists($nodeRight, 'left') || !property_exists($nodeRight, 'right')) {
+ if ((!property_exists($nodeLeft, 'left') || !property_exists($nodeLeft, 'right')) && !property_exists($nodeRight, 'left') || !property_exists($nodeRight, 'right')) {
return true;
}
$nodeLeftLeft = $nodeLeft->left;
|
Mutation Testing Code Review Annotations 8.0:
src/Mutator/Boolean/LogicalOr.php#L92
Escaped Mutant for Mutator "LogicalOr":
--- Original
+++ New
@@ @@
}
$nodeLeft = $node->left;
$nodeRight = $node->right;
- if (!property_exists($nodeLeft, 'left') || !property_exists($nodeLeft, 'right') || !property_exists($nodeRight, 'left') || !property_exists($nodeRight, 'right')) {
+ if ((!property_exists($nodeLeft, 'left') || !property_exists($nodeLeft, 'right') || !property_exists($nodeRight, 'left')) && !property_exists($nodeRight, 'right')) {
return true;
}
$nodeLeftLeft = $nodeLeft->left;
|
Mutation Testing Code Review Annotations 8.0:
src/Mutator/Boolean/LogicalOr.php#L148
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
}
$greaterOp = [Node\Expr\BinaryOp\Greater::class, Node\Expr\BinaryOp\GreaterOrEqual::class];
$smallerOp = [Node\Expr\BinaryOp\Smaller::class, Node\Expr\BinaryOp\SmallerOrEqual::class];
- if (in_array($classNodeLeft, $greaterOp, true) && in_array($classNodeRight, $smallerOp, true) || in_array($classNodeLeft, $smallerOp, true) && in_array($classNodeRight, $greaterOp, true)) {
+ if (in_array($classNodeLeft, $greaterOp, true) || in_array($classNodeRight, $smallerOp, true) || in_array($classNodeLeft, $smallerOp, true) && in_array($classNodeRight, $greaterOp, true)) {
$varNameLeft = null;
$valueLeft = null;
$numberScalar = [Node\Scalar\LNumber::class, Node\Scalar\DNumber::class];
|
Mutation Testing Code Review Annotations 8.0:
src/Mutator/Boolean/LogicalOr.php#L151
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
}
$greaterOp = [Node\Expr\BinaryOp\Greater::class, Node\Expr\BinaryOp\GreaterOrEqual::class];
$smallerOp = [Node\Expr\BinaryOp\Smaller::class, Node\Expr\BinaryOp\SmallerOrEqual::class];
- if (in_array($classNodeLeft, $greaterOp, true) && in_array($classNodeRight, $smallerOp, true) || in_array($classNodeLeft, $smallerOp, true) && in_array($classNodeRight, $greaterOp, true)) {
+ if (in_array($classNodeLeft, $greaterOp, true) && in_array($classNodeRight, $smallerOp, true) || (in_array($classNodeLeft, $smallerOp, true) || in_array($classNodeRight, $greaterOp, true))) {
$varNameLeft = null;
$valueLeft = null;
$numberScalar = [Node\Scalar\LNumber::class, Node\Scalar\DNumber::class];
|
Mutation Testing Code Review Annotations 8.0:
src/Mutator/Boolean/LogicalOr.php#L163
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
$varNameLeft = null;
$valueLeft = null;
$numberScalar = [Node\Scalar\LNumber::class, Node\Scalar\DNumber::class];
- if ($nodeLeftLeft instanceof Node\Expr\Variable) {
+ if (true) {
$varNameLeft = $nodeLeftLeft->name;
} elseif (in_array(get_class($nodeLeftLeft), $numberScalar, true)) {
$valueLeft = $nodeLeftLeft->value;
|
Mutation Testing Code Review Annotations 8.0:
src/Mutator/Boolean/LogicalOr.php#L171
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
} else {
return true;
}
- if ($nodeLeftRight instanceof Node\Expr\Variable && $varNameLeft === null) {
+ if (true && $varNameLeft === null) {
$varNameLeft = $nodeLeftRight->name;
} elseif (in_array(get_class($nodeLeftRight), $numberScalar, true) && $valueLeft === null) {
$valueLeft = $nodeLeftRight->value;
|
Mutation Testing Code Review Annotations 8.0:
src/Mutator/Boolean/LogicalOr.php#L171
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
} else {
return true;
}
- if ($nodeLeftRight instanceof Node\Expr\Variable && $varNameLeft === null) {
+ if (false && $varNameLeft === null) {
$varNameLeft = $nodeLeftRight->name;
} elseif (in_array(get_class($nodeLeftRight), $numberScalar, true) && $valueLeft === null) {
$valueLeft = $nodeLeftRight->value;
|
Mutation Testing Code Review Annotations 8.0:
src/Mutator/Boolean/LogicalOr.php#L171
Escaped Mutant for Mutator "Identical":
--- Original
+++ New
@@ @@
} else {
return true;
}
- if ($nodeLeftRight instanceof Node\Expr\Variable && $varNameLeft === null) {
+ if ($nodeLeftRight instanceof Node\Expr\Variable && $varNameLeft !== null) {
$varNameLeft = $nodeLeftRight->name;
} elseif (in_array(get_class($nodeLeftRight), $numberScalar, true) && $valueLeft === null) {
$valueLeft = $nodeLeftRight->value;
|
Mutation Testing Code Review Annotations 8.0:
src/Mutator/Boolean/LogicalOr.php#L171
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
} else {
return true;
}
- if ($nodeLeftRight instanceof Node\Expr\Variable && $varNameLeft === null) {
+ if ($nodeLeftRight instanceof Node\Expr\Variable || $varNameLeft === null) {
$varNameLeft = $nodeLeftRight->name;
} elseif (in_array(get_class($nodeLeftRight), $numberScalar, true) && $valueLeft === null) {
$valueLeft = $nodeLeftRight->value;
|