Showing 48 of 227 total issues
Method buildMainMenu
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function buildMainMenu(NodeController $nodeController)
{
$this->buildGenericNode('mainMenu', $nodeController)
->saySound('pp/3')
->maxAttemptsForInput(3)
Method init
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function init()
{
$this->logger->info('Init');
$this->agi = $this->getAgi();
$this->asteriskLogger = $this->agi->getAsteriskLogger();
Method callClientMethods
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function callClientMethods($methods, $stopWhen = null)
{
$client = $this->getClient();
$logger = $client->getLogger();
$result = null;
Function validate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function validate()
{
foreach ($this->inputValidations as $name => $data) {
$validator = $data['callback'];
$result = $validator($this);
- 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 spool
has 30 lines of code (exceeds 25 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');
Method getCommonCallingCardValidations
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getCommonCallingCardValidations()
{
return array(
'cardExists' => Node::createValidatorInfo(
function(Node $node) {
Method processNodeResult
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function processNodeResult(Node $node)
{
$ret = false;
$name = $node->getName();
if (isset($this->nodeResults[$name])) {
Method sayInterruptable
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function sayInterruptable($what, array $arguments)
{
$client = $this->getClient();
$logger = $client->getLogger();
Function callClientMethods
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function callClientMethods($methods, $stopWhen = null)
{
$result = null;
foreach ($methods as $callInfo) {
foreach ($callInfo as $name => $arguments) {
- 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 buildConfirmTransferToCard
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function buildConfirmTransferToCard(
NodeController $nodeController, \Closure $onInit
) {
$this->buildGenericNode('confirmTransferToCard', $nodeController)
->cancelWith(Node::DTMF_STAR)
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,
Consider simplifying this complex logical expression. Open
if ($node->wasCancelled()
&& $this->result == self::NODE_RESULT_CANCEL
) {
return true;
} elseif ($node->isComplete()
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)
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"