Showing 227 of 227 total issues
Function spool
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function spool(CallFile $call, $schedule = null)
{
$filename = tempnam($this->tmpDir, 'PAGICallFile');
if ($filename === false) {
throw new CallSpoolException('Could generate temporary filename');
- 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
Method buildPinEntry
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$name, $sound, $nextNodeName,
NodeController $nodeController, $validators,
$onInit = null
Function open
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function open()
{
if (isset($this->options['stdin'])) {
$this->input = $this->options['stdin'];
} else {
- 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 run
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function run()
{
$result = parent::run();
foreach ($this->expectedSay as $semiHash => $times) {
$data = unserialize($semiHash);
- 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
Method onDial
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$success,
$peerName,
$peerNumber,
$answeredTime,
$dialStatus,
The class AbstractClient has a coupling between objects value of 20. Consider to reduce the number of dependencies under 13. Open
abstract class AbstractClient implements IClient
{
/**
* PSR-3 logger.
* @var LoggerInterface
- Read upRead up
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
Consider simplifying this complex logical expression. Open
if ($node->wasCancelled()
&& $this->result == self::NODE_RESULT_CANCEL
) {
return true;
} elseif ($node->isComplete()
Each class must be in a file by itself Open
class MyPagiApplication extends PAGIApplication
- Exclude checks
Method record
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function record($file, $format, $escapeDigits, $maxRecordTime = -1, $silence = false);
Method record
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function record($file, $format, $escapeDigits, $maxRecordTime = -1, $silence = false)
Method record
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function record($file, $format, $escapeDigits, $maxRecordTime = -1, $silence = false)
Expected 1 space after FUNCTION keyword; 0 found Open
function(Node $node) {
- Exclude checks
Multi-line function declarations must define one parameter per line Open
$name, $sound, $nextNodeName,
- Exclude checks
Multi-line function declarations must define one parameter per line Open
$name, $sound, $nextNodeName,
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
function(Node $node) {
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
function(Node $node) {
- Exclude checks
Multi-line function declarations must define one parameter per line Open
NodeController $nodeController, $validators,
- Exclude checks
Blank line found at start of control structure Open
} catch(\Exception $e) {
- Exclude checks
Expected 1 blank line at end of file; 2 found Open
}
- Exclude checks
Function appliesTo
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function appliesTo(Node $node)
{
if ($node->wasCancelled()
&& $this->result == self::NODE_RESULT_CANCEL
) {
- 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"