Make sensitivity accept floats for better precision #20
Annotations
11 warnings
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3, actions/cache@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
Run Infection:
src/AnomalyDetectionResult.php#L90
Escaped Mutant for Mutator "RoundingFamily":
--- Original
+++ New
@@ @@
$this->mean = $mean;
$this->latest = $latest;
$this->sensitivity = $sensitivity;
- $this->high = ceil($this->mean + $sensitivity * $this->std_dev);
+ $this->high = round($this->mean + $sensitivity * $this->std_dev);
$this->low = floor($this->mean - $sensitivity * $this->std_dev);
if ($this->latest >= $this->low && $this->latest <= $this->high) {
return;
|
Run Infection:
src/AnomalyDetectionResult.php#L91
Escaped Mutant for Mutator "RoundingFamily":
--- Original
+++ New
@@ @@
$this->latest = $latest;
$this->sensitivity = $sensitivity;
$this->high = ceil($this->mean + $sensitivity * $this->std_dev);
- $this->low = floor($this->mean - $sensitivity * $this->std_dev);
+ $this->low = round($this->mean - $sensitivity * $this->std_dev);
if ($this->latest >= $this->low && $this->latest <= $this->high) {
return;
}
|
Run Infection:
src/AnomalyDetectionResult.php#L93
Escaped Mutant for Mutator "GreaterThanOrEqualTo":
--- Original
+++ New
@@ @@
$this->sensitivity = $sensitivity;
$this->high = ceil($this->mean + $sensitivity * $this->std_dev);
$this->low = floor($this->mean - $sensitivity * $this->std_dev);
- if ($this->latest >= $this->low && $this->latest <= $this->high) {
+ if ($this->latest > $this->low && $this->latest <= $this->high) {
return;
}
if ($this->std_dev > 0.0) {
|
Run Infection:
src/AnomalyDetectionResult.php#L97
Escaped Mutant for Mutator "GreaterThan":
--- Original
+++ New
@@ @@
if ($this->latest >= $this->low && $this->latest <= $this->high) {
return;
}
- if ($this->std_dev > 0.0) {
+ if ($this->std_dev >= 0.0) {
$this->hops = abs($this->mean - $this->latest) / $this->std_dev;
}
if ($this->latest < $this->low) {
|
Run Infection:
src/AnomalyDetectionResult.php#L98
Escaped Mutant for Mutator "Division":
--- Original
+++ New
@@ @@
return;
}
if ($this->std_dev > 0.0) {
- $this->hops = abs($this->mean - $this->latest) / $this->std_dev;
+ $this->hops = abs($this->mean - $this->latest) * $this->std_dev;
}
if ($this->latest < $this->low) {
$this->direction = self::DIRECTION_DOWN;
|
Run Infection:
src/AnomalyDetectionResult.php#L101
Escaped Mutant for Mutator "LessThan":
--- Original
+++ New
@@ @@
if ($this->std_dev > 0.0) {
$this->hops = abs($this->mean - $this->latest) / $this->std_dev;
}
- if ($this->latest < $this->low) {
+ if ($this->latest <= $this->low) {
$this->direction = self::DIRECTION_DOWN;
} elseif ($this->latest > $this->high) {
$this->direction = self::DIRECTION_UP;
|
Run Infection:
src/AnomalyDetectionResult.php#L103
Escaped Mutant for Mutator "GreaterThan":
--- Original
+++ New
@@ @@
}
if ($this->latest < $this->low) {
$this->direction = self::DIRECTION_DOWN;
- } elseif ($this->latest > $this->high) {
+ } elseif ($this->latest >= $this->high) {
$this->direction = self::DIRECTION_UP;
}
}
|
Run Infection:
src/AnomalyDetectionResult.php#L121
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
*
* @param int $precision the number of decimal digits to round to
*/
- public function toArray(int $precision = 2) : array
+ public function toArray(int $precision = 1) : array
{
return array_map(fn($val) => is_float($val) ? round($val, $precision) : $val, get_object_vars($this));
}
|
Run Infection:
src/Helper/FrameBuilder.php#L61
Escaped Mutant for Mutator "PublicVisibility":
--- Original
+++ New
@@ @@
*
* @param int $time the frame's reference time
*/
- public function newFrame(int $time) : Frame
+ protected function newFrame(int $time) : Frame
{
return new Frame($time, $this->window_size);
}
|
Run Infection:
src/Helper/FrameBuilder.php#L76
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
*
* @throws InvalidArgumentException If the start time is in the future
*/
- public function generateFrames(int $start_time = 0, ?int $end_time = null) : iterable
+ public function generateFrames(int $start_time = -1, ?int $end_time = null) : iterable
{
if (null !== $end_time && $end_time < $start_time) {
throw new InvalidArgumentException("End time cannot be before start time (start: {$start_time}, end: {$end_time})");
|
Loading