Showing 48 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
Function callClientMethods
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
protected function callClientMethods($methods, $stopWhen = null)
{
$client = $this->getClient();
$logger = $client->getLogger();
$result = null;
- 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
CDRFacade
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class CDRFacade implements ICDR
{
/**
* AGI Client, needed to access cdr data.
* @var IClient
Function processNodeResult
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function processNodeResult(Node $node)
{
$ret = false;
$name = $node->getName();
if (isset($this->nodeResults[$name])) {
- 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 run
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run()
{
$this->inputAttemptsUsed = 0;
if ($this->executeBeforeRun !== null) {
$callback = $this->executeBeforeRun;
Function unserialize
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function unserialize($text)
{
$lines = explode("\n", $text);
foreach ($lines as $line) {
$data = explode(':', $line);
- 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 doInput
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function doInput()
{
/* @var $result IReadResult */
$this->resetInput();
$this->inputAttemptsUsed++;
Function sayInterruptable
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function sayInterruptable($what, array $arguments)
{
$client = $this->getClient();
$logger = $client->getLogger();
- 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"