LibreNMS/OS/Shared/Fortinet.php
Method getHardwareName
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function getHardwareName()
{
$rewrite_fortinet_hardware = [
'.1.3.6.1.4.1.12356.112.100.1' => 'FortiADC Unknown',
'.1.3.6.1.4.1.12356.112.100.10' => 'FortiADC DEV',
The method getHardwareName() has 125 lines of code. Current threshold is set to 100. Avoid really long methods. Open
Open
protected function getHardwareName()
{
$rewrite_fortinet_hardware = [
'.1.3.6.1.4.1.12356.112.100.1' => 'FortiADC Unknown',
'.1.3.6.1.4.1.12356.112.100.10' => 'FortiADC DEV',
- Exclude checks
Avoid excessively long variable names like $rewrite_fortinet_hardware. Keep variable name length under 20. Open
Open
$rewrite_fortinet_hardware = [
- 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++ ) {
}
}
}