librenms/librenms

View on GitHub
LibreNMS/Authentication/LegacyAuth.php

Summary

Maintainability
A
0 mins
Test Coverage

Missing class import via use statement (line '60', column '23').
Open

            throw new \RuntimeException($type . ' not found as auth_mechanism');

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

The property $_instance is not named in camelCase.
Open

class LegacyAuth
{
    protected static $_instance;
    private static $configToClassMap = [
        'mysql' => 'LibreNMS\Authentication\MysqlAuthorizer',

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

Property name "$_instance" should not be prefixed with an underscore to indicate visibility
Open

    protected static $_instance;

There are no issues that match your filters.

Category
Status