Showing 12 of 32 total issues
Radio
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class Radio{
protected $host = null;
protected $pin = null;
protected $sid = null;
Function systemStatus
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function systemStatus($path = NULL){
$basedir = dirname(__FILE__)."/Nodes/";
$NodesFactory = new NodesFactory();
$all_nodes = $NodesFactory->getAllNodes();
foreach($all_nodes as $file){
- 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 autoloader
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function autoloader($class)
{
$filename = $class . '.php';
Function doRequest
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function doRequest($method, $node = null, $attributes = array(), $delimiter = "")
{
if ($node !== null) {
if(!is_object($node)){
$NodesFactory = new NodesFactory();
- 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 parseElement
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function parseElement($element,$result){
$parser = new DecodeC8Array();
$elem_array = (array) $element;
if(isset($elem_array['@attributes'])){
if(isset($elem_array['@attributes']['key'])){
- 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 doRequest
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function doRequest($method, $Node = null, $attributes = array(), $delimiter = "")
{
Function parseResult
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function parseResult($result)
{
foreach ($result->children() as $child) {
$method = explode('_', $child->getname());
if(!is_array($method)){
- 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 autoloader
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function autoloader($class)
{
$filename = $class . '.php';
- 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 getAllNodes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getAllNodes(){
$all_nodes = array();
$basedir = dirname(__FILE__);
$files = scandir($basedir);
- 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 doRequest
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function doRequest($method, $Node = null, $attributes = array(), $delimiter = "")
{
- 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 doScan
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function doScan($type){
$result = array();
$buffer = '';
$tmp = '';
$headers = "M-SEARCH * HTTP/1.1\r\nHost:239.255.255.250:1900\r\nST:".$type."\r\nMan:\"ssdp:discover\"\r\nMX:3\r\n\r\n";
- 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 decode
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function decode($buffer){
$array = explode("\r\n", $buffer);
$return = array();
foreach($array as $value){
if($value != ""){
- 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"