librenms/librenms

View on GitHub
LibreNMS/OS/Ironware.php

Summary

Maintainability
F
4 days
Test Coverage

Method rewriteHardware has 605 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function rewriteHardware()
    {
        $rewrite_ironware_hardware = [
            'snFIWGSwitch' => 'Stackable FastIron workgroup',
            'snFIBBSwitch' => 'Stackable FastIron backbone',
Severity: Major
Found in LibreNMS/OS/Ironware.php - About 3 days to fix

    File Ironware.php has 620 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * Ironware.php
     *
     * Brocade Ironware OS
    Severity: Major
    Found in LibreNMS/OS/Ironware.php - About 1 day to fix

      The method rewriteHardware() has 610 lines of code. Current threshold is set to 100. Avoid really long methods.
      Open

          private function rewriteHardware()
          {
              $rewrite_ironware_hardware = [
                  'snFIWGSwitch' => 'Stackable FastIron workgroup',
                  'snFIBBSwitch' => 'Stackable FastIron backbone',
      Severity: Minor
      Found in LibreNMS/OS/Ironware.php by phpmd

      Avoid excessively long variable names like $rewrite_ironware_hardware. Keep variable name length under 20.
      Open

              $rewrite_ironware_hardware = [
      Severity: Minor
      Found in LibreNMS/OS/Ironware.php by phpmd

      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++ ) {
              }
          }
      }

      Source https://phpmd.org/rules/naming.html#longvariable

      There are no issues that match your filters.

      Category
      Status