AppStateESS/InternshipInventory

View on GitHub
class/State.php

Summary

Maintainability
A
0 mins
Test Coverage

Missing class import via use statement (line '35', column '19').
Open

        $db = new \PHPWS_DB('intern_state');
Severity: Minor
Found in class/State.php by phpmd

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

Missing class import via use statement (line '54', column '19').
Open

        $db = new \PHPWS_DB('intern_state');
Severity: Minor
Found in class/State.php by phpmd

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

Missing class import via use statement (line '42', column '19').
Open

        $db = new \PHPWS_DB('intern_state');
Severity: Minor
Found in class/State.php by phpmd

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

Avoid using static access to class 'Intern\PHPWS_Core' in method 'getStates'.
Open

            PHPWS_Core::goBack();
Severity: Minor
Found in class/State.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\NQ' in method 'getAllowedStates'.
Open

            \NQ::simple('intern', \Intern\UI\NotifyUI::ERROR, 'The list of allowed US states for internship locations has not been configured. Please use the administrative options to <a href="index.php?module=intern&action=edit_states">add allowed states.</a>');
Severity: Minor
Found in class/State.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\phpws2\Database' in method 'getStates'.
Open

        $db = \phpws2\Database::newDB();
Severity: Minor
Found in class/State.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class 'Intern\PHPWS_Core' in method 'getAllowedStates'.
Open

            PHPWS_Core::goBack();
Severity: Minor
Found in class/State.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\NQ' in method 'getStates'.
Open

            \NQ::simple('intern', \Intern\UI\NotifyUI::ERROR, 'The list of allowed US states for internship locations has not been configured. Please use the administrative options to <a href="index.php?module=intern&action=edit_states">add allowed states.</a>');
Severity: Minor
Found in class/State.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\NQ' in method 'getAllowedStates'.
Open

            \NQ::close();
Severity: Minor
Found in class/State.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\NQ' in method 'getStates'.
Open

            \NQ::close();
Severity: Minor
Found in class/State.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Call to method addColumn from undeclared class \PHPWS_DB
Open

        $db->addColumn('abbr');
Severity: Critical
Found in class/State.php by phan

Call to method addOrder from undeclared class \PHPWS_DB
Open

        $db->addOrder('full_name ASC');
Severity: Critical
Found in class/State.php by phan

Call to method newDB from undeclared class \phpws2\Database
Open

        $db = \phpws2\Database::newDB();
Severity: Critical
Found in class/State.php by phan

Call to method addColumn from undeclared class \PHPWS_DB
Open

        $db->addColumn('full_name');
Severity: Critical
Found in class/State.php by phan

Call to method select from undeclared class \PHPWS_DB
Open

        $states = $db->select('col');
Severity: Critical
Found in class/State.php by phan

Call to method simple from undeclared class \NQ
Open

            \NQ::simple('intern', \Intern\UI\NotifyUI::ERROR, 'The list of allowed US states for internship locations has not been configured. Please use the administrative options to <a href="index.php?module=intern&action=edit_states">add allowed states.</a>');
Severity: Critical
Found in class/State.php by phan

Call to method __construct from undeclared class \PHPWS_DB
Open

        $db = new \PHPWS_DB('intern_state');
Severity: Critical
Found in class/State.php by phan

Call to method setIndexBy from undeclared class \PHPWS_DB
Open

        $db->setIndexBy('abbr');
Severity: Critical
Found in class/State.php by phan

Call to method goBack from undeclared class \Intern\PHPWS_Core
Open

            PHPWS_Core::goBack();
Severity: Critical
Found in class/State.php by phan

Call to method addWhere from undeclared class \PHPWS_DB
Open

        $db->addWhere('active', 1);
Severity: Critical
Found in class/State.php by phan

Call to method __construct from undeclared class \PHPWS_DB
Open

        $db = new \PHPWS_DB('intern_state');
Severity: Critical
Found in class/State.php by phan

Call to method goBack from undeclared class \Intern\PHPWS_Core
Open

            PHPWS_Core::goBack();
Severity: Critical
Found in class/State.php by phan

Call to method close from undeclared class \NQ
Open

            \NQ::close();
Severity: Critical
Found in class/State.php by phan

Call to method addWhere from undeclared class \PHPWS_DB
Open

        $db->addWhere('abbr', $abbr);
Severity: Critical
Found in class/State.php by phan

Call to method addWhere from undeclared class \PHPWS_DB
Open

        $db->addWhere('abbr', $this->abbr);
Severity: Critical
Found in class/State.php by phan

Call to method simple from undeclared class \NQ
Open

            \NQ::simple('intern', \Intern\UI\NotifyUI::ERROR, 'The list of allowed US states for internship locations has not been configured. Please use the administrative options to <a href="index.php?module=intern&action=edit_states">add allowed states.</a>');
Severity: Critical
Found in class/State.php by phan

Call to method saveObject from undeclared class \PHPWS_DB
Open

        return $db->saveObject($this);
Severity: Critical
Found in class/State.php by phan

Call to method close from undeclared class \NQ
Open

            \NQ::close();
Severity: Critical
Found in class/State.php by phan

Call to method loadObject from undeclared class \PHPWS_DB
Open

        $db->loadObject($this);
Severity: Critical
Found in class/State.php by phan

Call to method __construct from undeclared class \PHPWS_DB
Open

        $db = new \PHPWS_DB('intern_state');
Severity: Critical
Found in class/State.php by phan

Avoid variables with short names like $db. Configured minimum length is 3.
Open

        $db = \phpws2\Database::newDB();
Severity: Minor
Found in class/State.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

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

The property $full_name is not named in camelCase.
Open

class State {

    public $abbr;
    public $full_name;
    public $active;
Severity: Minor
Found in class/State.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

Avoid variables with short names like $db. Configured minimum length is 3.
Open

        $db = new \PHPWS_DB('intern_state');
Severity: Minor
Found in class/State.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

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

The property $UNITED_STATES is not named in camelCase.
Open

class State {

    public $abbr;
    public $full_name;
    public $active;
Severity: Minor
Found in class/State.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

Avoid variables with short names like $db. Configured minimum length is 3.
Open

        $db = new \PHPWS_DB('intern_state');
Severity: Minor
Found in class/State.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

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

Avoid variables with short names like $db. Configured minimum length is 3.
Open

        $db = new \PHPWS_DB('intern_state');
Severity: Minor
Found in class/State.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

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

There are no issues that match your filters.

Category
Status