Missing class import via use statement (line '35', column '19'). Open
$db = new \PHPWS_DB('intern_state');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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();
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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>');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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();
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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();
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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>');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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();
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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();
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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');
- Create a ticketCreate a ticket
- Exclude checks
Call to method addOrder
from undeclared class \PHPWS_DB
Open
$db->addOrder('full_name ASC');
- Create a ticketCreate a ticket
- Exclude checks
Call to method newDB
from undeclared class \phpws2\Database
Open
$db = \phpws2\Database::newDB();
- Create a ticketCreate a ticket
- Exclude checks
Call to method addColumn
from undeclared class \PHPWS_DB
Open
$db->addColumn('full_name');
- Create a ticketCreate a ticket
- Exclude checks
Call to method select
from undeclared class \PHPWS_DB
Open
$states = $db->select('col');
- Create a ticketCreate a ticket
- Exclude checks
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>');
- Create a ticketCreate a ticket
- Exclude checks
Call to method __construct
from undeclared class \PHPWS_DB
Open
$db = new \PHPWS_DB('intern_state');
- Create a ticketCreate a ticket
- Exclude checks
Call to method setIndexBy
from undeclared class \PHPWS_DB
Open
$db->setIndexBy('abbr');
- Create a ticketCreate a ticket
- Exclude checks
Call to method goBack
from undeclared class \Intern\PHPWS_Core
Open
PHPWS_Core::goBack();
- Create a ticketCreate a ticket
- Exclude checks
Call to method addWhere
from undeclared class \PHPWS_DB
Open
$db->addWhere('active', 1);
- Create a ticketCreate a ticket
- Exclude checks
Call to method __construct
from undeclared class \PHPWS_DB
Open
$db = new \PHPWS_DB('intern_state');
- Create a ticketCreate a ticket
- Exclude checks
Call to method goBack
from undeclared class \Intern\PHPWS_Core
Open
PHPWS_Core::goBack();
- Create a ticketCreate a ticket
- Exclude checks
Call to method close
from undeclared class \NQ
Open
\NQ::close();
- Create a ticketCreate a ticket
- Exclude checks
Call to method addWhere
from undeclared class \PHPWS_DB
Open
$db->addWhere('abbr', $abbr);
- Create a ticketCreate a ticket
- Exclude checks
Call to method addWhere
from undeclared class \PHPWS_DB
Open
$db->addWhere('abbr', $this->abbr);
- Create a ticketCreate a ticket
- Exclude checks
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>');
- Create a ticketCreate a ticket
- Exclude checks
Call to method saveObject
from undeclared class \PHPWS_DB
Open
return $db->saveObject($this);
- Create a ticketCreate a ticket
- Exclude checks
Call to method close
from undeclared class \NQ
Open
\NQ::close();
- Create a ticketCreate a ticket
- Exclude checks
Call to method loadObject
from undeclared class \PHPWS_DB
Open
$db->loadObject($this);
- Create a ticketCreate a ticket
- Exclude checks
Call to method __construct
from undeclared class \PHPWS_DB
Open
$db = new \PHPWS_DB('intern_state');
- Create a ticketCreate a ticket
- Exclude checks
Avoid variables with short names like $db. Configured minimum length is 3. Open
$db = \phpws2\Database::newDB();
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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');
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
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;
}
}
}