LibreNMS/Alert/Transport/Discord.php
Method deliverAlert
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function deliverAlert(array $alert_data): bool
{
$added_fields = $this->parseUserOptions($this->config['options']);
$discord_title = '#' . $alert_data['uid'] . ' ' . $alert_data['title'];
Method configTemplate
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function configTemplate(): array
{
return [
'config' => [
[
Avoid excessively long variable names like $embedFieldTranslations. Keep variable name length under 20. Open
Open
private array $embedFieldTranslations = [
'name' => 'Rule Name',
];
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}