tests/UserAuthenticationTest.php
Method testLogin
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function testLogin()
{
$app = App::getInstance();
$app->init('dev');
Avoid using static access to class '\CodeJetter\core\App' in method 'testLogin'. Open
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 'testIsLoggedIn'. Open
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 12 and the first side effect is on line 10. Open
Open
<?php
- Exclude checks
Expected 0 spaces before opening brace; 4 found Open
Open
{
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
Open
class UserAuthenticationTest extends \PHPUnit_Framework_TestCase
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
Open
}
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
Open
}
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
Open
public function testIsLoggedIn()
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
Open
}
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
Open
foreach ($inputOutputs as $inputOutput) {
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
Open
public function testIsUserActive()
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
Open
}
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
Open
}
- Exclude checks
Line indented incorrectly; expected 4 spaces, found 8 Open
Open
public function testLogin()
- Exclude checks