librenms/librenms

View on GitHub
includes/html/pages/addhost.inc.php

Summary

Maintainability
B
4 hrs
Test Coverage

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

<?php

use App\Actions\Device\ValidateDeviceAndCreate;
use LibreNMS\Config;
use LibreNMS\Enum\PortAssociationMode;
Severity: Minor
Found in includes/html/pages/addhost.inc.php - About 4 hrs to fix

    Line indented incorrectly; expected at least 24 spaces, found 22
    Open

                          echo "<option value=\"$algo\"" . ($enabled ?: ' disabled') . ">$algo</option>";

    Line indented incorrectly; expected 20 spaces, found 18
    Open

                      }

    Line indented incorrectly; expected 20 spaces, found 18
    Open

                      <?php

    Line indented incorrectly; expected 0 spaces, found 18
    Open

                      }//endif

    Line indented incorrectly; expected 20 spaces, found 18
    Open

                      ?>

    Line indented incorrectly; expected 16 spaces, found 14
    Open

                  <?php } ?>

    Line indented incorrectly; expected 20 spaces, found 18
    Open

                      foreach (\LibreNMS\SNMPCapabilities::cryptoAlgoritms() as $algo => $enabled) {

    Line indented incorrectly; expected 20 spaces, found 18
    Open

                      ?>

    Line indented incorrectly; expected at least 24 spaces, found 22
    Open

                          echo "<option value=\"$algo\"" . ($enabled ?: ' disabled') . ">$algo</option>";

    Line indented incorrectly; expected 4 spaces, found 22
    Open

                          }

    Line indented incorrectly; expected 20 spaces, found 18
    Open

                      foreach (\LibreNMS\SNMPCapabilities::authAlgorithms() as $algo => $enabled) {

    Line indented incorrectly; expected 20 spaces, found 18
    Open

                      }

    Line indented incorrectly; expected 16 spaces, found 14
    Open

                  <?php if (! \LibreNMS\SNMPCapabilities::supportsSHA2()) {?>

    Line indented incorrectly; expected 16 spaces, found 14
    Open

                  <?php } ?>

    Line indented incorrectly; expected 4 spaces, found 22
    Open

                          foreach (dbFetchRows('SELECT `id`,`group_name` FROM `poller_groups` ORDER BY `group_name`') as $group) {

    Line indented incorrectly; expected 20 spaces, found 18
    Open

                      <?php

    Line indented incorrectly; expected 16 spaces, found 14
    Open

                  <?php if (! \LibreNMS\SNMPCapabilities::supportsAES256()) {?>

    Closing brace indented incorrectly; expected 0 spaces, found 18
    Open

                      }//endif

    There are no issues that match your filters.

    Category
    Status