Function getServiceMap
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
private function getServiceMap()
{
$result = [
'transport' => 'POST',
'envelope' => 'JSON-RPC-2.0',
- 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 validateCall
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
private function validateCall(\stdClass $call)
{
$result = null;
$error = null;
$data = 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
File BaseJsonRpcServer.php
has 316 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace RunTracy\Helpers\Console;
/**
Method validateCall
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function validateCall(\stdClass $call)
{
$result = null;
$error = null;
$data = null;
Function execute
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function execute()
{
$ret = [];
do {
// check for SMD Discovery request
- 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 getServiceMap
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getServiceMap()
{
$result = [
'transport' => 'POST',
'envelope' => 'JSON-RPC-2.0',
Method execute
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute()
{
$ret = [];
do {
// check for SMD Discovery request
Function getRequest
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function getRequest()
{
$error = null;
do {
- 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 getRequest
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getRequest()
{
$error = null;
do {
Method processCall
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function processCall(\stdClass $call)
{
$id = property_exists($call, 'id') ? $call->id : null;
$params = property_exists($call, 'params') ? $call->params : [];
$result = null;
Function processCall
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function processCall(\stdClass $call)
{
$id = property_exists($call, 'id') ? $call->id : null;
$params = property_exists($call, 'params') ? $call->params : [];
$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"