librenms/librenms

View on GitHub
LibreNMS/Util/Color.php

Summary

Maintainability
A
2 hrs
Test Coverage

Method percentage has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function percentage($percentage, $component_perc_warn = null): array
    {
        $perc_warn = 75;

        if (isset($component_perc_warn)) {
Severity: Minor
Found in LibreNMS/Util/Color.php - About 1 hr to fix

    Avoid too many return statements within this method.
    Open

            return '#008000';
    Severity: Major
    Found in LibreNMS/Util/Color.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return [
                  'left' => '9abf5b',
                  'right' => 'bbd392',
                  'middle' => 'afcc7c',
              ];
      Severity: Major
      Found in LibreNMS/Util/Color.php - About 30 mins to fix

        There are no issues that match your filters.

        Category
        Status