Showing 227 of 227 total issues
File Node.php
has 572 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* A node, used to get input from the user, validate it, play prompt messages,
* etc.
*
Node
has 66 functions (exceeds 20 allowed). Consider refactoring. Open
class Node
{
/**
* Any of the available DTMF digits in a classic telephone.
* @var string
MockedClientImpl
has 64 functions (exceeds 20 allowed). Consider refactoring. Open
class MockedClientImpl extends AbstractClient
{
/**
* Mocked result strings.
* @var string[]
AbstractClient
has 62 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class AbstractClient implements IClient
{
/**
* PSR-3 logger.
* @var LoggerInterface
File AbstractClient.php
has 515 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* An abstract AGI client.
*
* PHP Version 5
File MockedClientImpl.php
has 470 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* An AGI client implementation useful for mocking and testing ivr apps.
*
* PHP Version 5
Method run
has 141 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run()
{
$this->log('Run');
$client = $this->getAgi();
$loggerFacade = $client->getAsteriskLogger();
ChannelVariablesFacade
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
class ChannelVariablesFacade implements IChannelVariables
{
/**
* Channel variables given by asterisk.
* @var string[]
Function run
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function run()
{
$this->inputAttemptsUsed = 0;
if ($this->executeBeforeRun !== null) {
$callback = $this->executeBeforeRun;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
CallFile
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
class CallFile
{
/**
* Parameters.
* @var string[]
File example.php
has 333 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* An example using nodes and node controller. This is a part of a calling card
* prepaid system. The nodes will let you enter a pin number, make a transfer
* between cards, dial a number, and listen to the help.
Function run
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
public function run()
{
$this->log('Run');
$client = $this->getAgi();
$loggerFacade = $client->getAsteriskLogger();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function doInput
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
protected function doInput()
{
/* @var $result IReadResult */
$this->resetInput();
$this->inputAttemptsUsed++;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
The class AbstractClient has 39 public methods. Consider refactoring AbstractClient to keep number of public methods under 10. Open
abstract class AbstractClient implements IClient
{
/**
* PSR-3 logger.
* @var LoggerInterface
- 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
The class AbstractClient has an overall complexity of 93 which is very high. The configured complexity threshold is 50. Open
abstract class AbstractClient implements IClient
{
/**
* PSR-3 logger.
* @var LoggerInterface
- Exclude checks
The class AbstractClient has 44 non-getter- and setter-methods. Consider refactoring AbstractClient to keep number of methods under 25. Open
abstract class AbstractClient implements IClient
{
/**
* PSR-3 logger.
* @var LoggerInterface
- Read upRead up
- Exclude checks
TooManyMethods
Since: 0.1
A class with too many 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'.
The default was changed from 10 to 25 in PHPMD 2.3.
Example
Source https://phpmd.org/rules/codesize.html#toomanymethods
The class Node has 37 public methods. Consider refactoring Node to keep number of public methods under 10. Open
class Node
{
/**
* Any of the available DTMF digits in a classic telephone.
* @var string
- 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
The class MockedNode has 11 public methods. Consider refactoring MockedNode to keep number of public methods under 10. Open
class MockedNode extends Node
{
/**
* The complete input digit chain for this node.
* @var string
- 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
The class MockedClientImpl has an overall complexity of 94 which is very high. The configured complexity threshold is 50. Open
class MockedClientImpl extends AbstractClient
{
/**
* Mocked result strings.
* @var string[]
- Exclude checks
The class MockedClientImpl has 52 non-getter- and setter-methods. Consider refactoring MockedClientImpl to keep number of methods under 25. Open
class MockedClientImpl extends AbstractClient
{
/**
* Mocked result strings.
* @var string[]
- Read upRead up
- Exclude checks
TooManyMethods
Since: 0.1
A class with too many 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'.
The default was changed from 10 to 25 in PHPMD 2.3.
Example