LibreNMS/OS/Ironware.php
Method rewriteHardware
has 605 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function rewriteHardware()
{
$rewrite_ironware_hardware = [
'snFIWGSwitch' => 'Stackable FastIron workgroup',
'snFIBBSwitch' => 'Stackable FastIron backbone',
File Ironware.php
has 620 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* Ironware.php
*
* Brocade Ironware OS
The method rewriteHardware() has 610 lines of code. Current threshold is set to 100. Avoid really long methods. Open
Open
private function rewriteHardware()
{
$rewrite_ironware_hardware = [
'snFIWGSwitch' => 'Stackable FastIron workgroup',
'snFIBBSwitch' => 'Stackable FastIron backbone',
- Exclude checks
Avoid excessively long variable names like $rewrite_ironware_hardware. Keep variable name length under 20. Open
Open
$rewrite_ironware_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++ ) {
}
}
}