librenms/librenms

View on GitHub
includes/polling/ports.inc.php

Summary

Maintainability
D
1 day
Test Coverage

File ports.inc.php has 716 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

use LibreNMS\Config;
use LibreNMS\Enum\PortAssociationMode;
use LibreNMS\RRD\RrdDefinition;
Severity: Major
Found in includes/polling/ports.inc.php - About 1 day to fix

    Consider simplifying this complex logical expression.
    Open

                    if ($port_tune == 'true' ||
                        ($device_tune == 'true' && $port_tune != 'false') ||
                        (Config::get('rrdtool_tune') == 'true' && $port_tune != 'false' && $device_tune != 'false')) {
                        if ($oid == 'ifSpeed') {
                            $tune_port = true;
    Severity: Major
    Found in includes/polling/ports.inc.php - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

              if (! empty($port['skipped'])) {
                  // We don't care about statistics for skipped selective polling ports
                  d_echo("$port_id skipped because selective polling ports is set.");
              } elseif ($port['ifType'] != 'vdsl' && $port['ifType'] != 'adsl' && $port['ifOperStatus'] == 'down' && $port['ifOperStatus_prev'] == 'down' && $this_port['ifOperStatus'] == 'down' && ($this_port['ifLastChange'] ?? null) == $port['ifLastChange']) {
                  // We don't care about statistics for down ports on which states did not change since last polling
      Severity: Major
      Found in includes/polling/ports.inc.php - About 40 mins to fix

        FIXME found
        Open

            // FIXME we probably shouldn't be doing this from the VTP MIB, right?
        Severity: Minor
        Found in includes/polling/ports.inc.php by fixme

        FIXME found
        Open

                // FIXME use $q_bridge_mib[$this_port['ifIndex']] to see if it is a trunk (>1 array count)
        Severity: Minor
        Found in includes/polling/ports.inc.php by fixme

        There are no issues that match your filters.

        Category
        Status