LibreNMS/Data/Source/FpingResponse.php
The method __construct has 10 parameters. Consider reducing the number of parameters to less than 10. Open
Open
private function __construct(
public readonly int $transmitted,
public readonly int $received,
public readonly int $loss,
public readonly float $min_latency,
- Exclude checks
The method __construct has a boolean flag argument $skipped, which is a certain sign of a Single Responsibility Principle violation. Open
Open
private bool $skipped = false)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line Open
Open
{
- Exclude checks
Scope keyword "static" must be followed by a single space Open
Open
public static function artificialUp(string $host = null): static
- Exclude checks
The closing parenthesis of a multi-line function declaration must be on a new line Open
Open
private bool $skipped = false)
- Exclude checks
Scope keyword "static" must be followed by a single space Open
Open
public static function artificialDown(string $host = null): static
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
Open
public readonly int $transmitted,
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
Open
public readonly int $duplicates,
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
Open
public int $exit_code,
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
Open
public readonly float $min_latency,
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
Open
private bool $skipped = false)
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
Open
public readonly ?string $host = null,
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
Open
public readonly float $avg_latency,
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
Open
public readonly int $received,
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
Open
public readonly int $loss,
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
Open
public readonly float $max_latency,
- Exclude checks