Method testAuthorizeSend
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testAuthorizeSend()
{
// Test without metadata parameters on request
$this->assertFalse(
ApplicationsAuthManager::factory()->authorizeSend(
Method testAuthorizeOpen
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testAuthorizeOpen()
{
// Test without specifying `authorizeOpen` explicitly
$this->assertTrue(ApplicationsAuthManager::factory()->authorizeOpen($this->createIoConnection()));
Method testConstruct
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testConstruct()
{
$ioConnection = $this->createIoConnection();
$webSocketRequest = WebSocketRequest::factory('Hello World !');
Missing class import via use statement (line '287', column '40'). Open
$ioConnection->WebSocket = new \stdClass();
- Read upRead up
- 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 '\Gomoob\WebSocket\Request\WebSocketRequest' in method 'testConstruct'. Open
$webSocketRequest = WebSocketRequest::factory('Hello World !');
- 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 '\Gomoob\WebSocket\Request\WebSocketRequest' in method 'testAuthorizeSend'. Open
WebSocketRequest::factory('Hello !')
- 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 unused local variables such as '$webSocketRequest'. Open
$webSocketRequest = WebSocketRequest::factory('Hello World !');
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$ioConnection'. Open
$ioConnection = $this->createIoConnection();
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$authManager'. Open
$authManager = new ApplicationsAuthManager();
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}