LibreNMS/Alert/Transport/Pagerduty.php
Method deliverAlert
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function deliverAlert(array $alert_data): bool
{
$event_action = match ($alert_data['state']) {
AlertState::RECOVERED => 'resolve',
AlertState::ACKNOWLEDGED => 'acknowledge',
Method configTemplate
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function configTemplate(): array
{
return [
'config' => [
[
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 35 and the first side effect is on line 31. Open
Open
<?php
- Exclude checks
Possible parse error: class missing opening or closing brace Open
Open
class Pagerduty extends Transport
- Exclude checks
Possible parse error: class missing opening or closing brace Open
Open
class Pagerduty extends Transport
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
Open
protected string $name = 'PagerDuty';
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 12 Open
Open
default => 'trigger'
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
Open
if ($res->successful()) {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
Open
}
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 12 Open
Open
default => $this->config['custom-url'],
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
Open
public function deliverAlert(array $alert_data): bool
- Exclude checks
Closing brace indented incorrectly; expected 4 spaces, found 0 Open
Open
}
- Exclude checks
Space before opening parenthesis of function call prohibited Open
Open
$url = match ($this->config['region']) {
- Exclude checks
Space before opening parenthesis of function call prohibited Open
Open
$event_action = match ($alert_data['state']) {
- Exclude checks