File ValidatorTest.php
has 929 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace CodeJetter\tests;
use CodeJetter\core\App;
Method testValidatePassword
has 176 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testValidatePassword()
{
$app = App::getInstance();
$app->init('dev');
Method testValidateURL
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testValidateURL()
{
$app = App::getInstance();
$app->init('dev');
Method testValidateMoney
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testValidateMoney()
{
$app = App::getInstance();
$app->init('dev');
The class ValidatorTest has 13 public methods. Consider refactoring ValidatorTest to keep number of public methods under 10. Open
class ValidatorTest extends \PHPUnit_Framework_TestCase
{
public function testValidateEmail()
{
$app = App::getInstance();
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
Method testValidateUsername
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testValidateUsername()
{
$app = App::getInstance();
$app->init('dev');
Method testValidateSize
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testValidateSize()
{
$app = App::getInstance();
$app->init('dev');
Method testValidateRequired
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testValidateRequired()
{
$app = App::getInstance();
$app->init('dev');
Method testValidateId
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testValidateId()
{
$app = App::getInstance();
$app->init('dev');
Method testValidateEmail
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testValidateEmail()
{
$app = App::getInstance();
$app->init('dev');
Method testValidateWhiteList
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testValidateWhiteList()
{
$app = App::getInstance();
$app->init('dev');
Method testValidateNumber
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testValidateNumber()
{
$app = App::getInstance();
$app->init('dev');
Method testIsAllRequired
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testIsAllRequired()
{
$app = App::getInstance();
$app->init('dev');
Method testGetFilteredInputs
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testGetFilteredInputs()
{
$dummyInput1 = new Input('name');
$dummyInput2 = new Input('email');
The method testValidatePassword() has 188 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function testValidatePassword()
{
$app = App::getInstance();
$app->init('dev');
- Exclude checks
Avoid using static access to class '\CodeJetter\core\App' in method 'testValidateURL'. Open
$app = App::getInstance();
- Read upRead up
- 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 '\CodeJetter\core\App' in method 'testValidateMoney'. Open
$app = App::getInstance();
- Read upRead up
- 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 '\CodeJetter\core\App' in method 'testValidateId'. Open
$app = App::getInstance();
- Read upRead up
- 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 '\CodeJetter\core\App' in method 'testIsAllRequired'. Open
$app = App::getInstance();
- Read upRead up
- 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 '\CodeJetter\core\App' in method 'testValidateUsername'. Open
$app = App::getInstance();
- Read upRead up
- 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 '\CodeJetter\core\App' in method 'testValidatePassword'. Open
$app = App::getInstance();
- Read upRead up
- 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 '\CodeJetter\core\App' in method 'testValidateEmail'. Open
$app = App::getInstance();
- Read upRead up
- 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 '\CodeJetter\core\App' in method 'testGetErrors'. Open
$app = App::getInstance();
- Read upRead up
- 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 '\CodeJetter\core\App' in method 'testValidateSize'. Open
$app = App::getInstance();
- Read upRead up
- 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 '\CodeJetter\core\App' in method 'testValidateRequired'. Open
$app = App::getInstance();
- Read upRead up
- 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 '\CodeJetter\core\App' in method 'testValidateWhiteList'. Open
$app = App::getInstance();
- Read upRead up
- 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 '\CodeJetter\core\App' in method 'testValidateNumber'. Open
$app = App::getInstance();
- Read upRead up
- 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
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 13 and the first side effect is on line 11. Open
<?php
- Exclude checks