flammy/fsapi

View on GitHub

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;
Severity: Minor
Found in src/Radio.php - About 2 hrs to fix

    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){
    Severity: Minor
    Found in src/Radio.php - About 1 hr to fix

    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';
        
        
    Severity: Minor
    Found in src/autoload.php - About 1 hr to fix

      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();
      Severity: Minor
      Found in src/FSAPI.php - About 1 hr to fix

      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'])){
      Severity: Minor
      Found in src/Parsers/DecodeList.php - About 1 hr to fix

      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 = "")
          {
      
      
      
      
      Severity: Minor
      Found in src/Request/Request.php - About 1 hr to fix

        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)){
        Severity: Minor
        Found in src/Parsers/ParserFactory.php - About 55 mins to fix

        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';
            
            
        Severity: Minor
        Found in src/autoload.php - About 45 mins to fix

        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);
                
        Severity: Minor
        Found in src/Nodes/NodesFactory.php - About 45 mins to fix

        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 = "")
            {
        
        
        
        
        Severity: Minor
        Found in src/Request/Request.php - About 25 mins to fix

        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";
        Severity: Minor
        Found in src/SSDP/Scanner.php - About 25 mins to fix

        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 != ""){
        Severity: Minor
        Found in src/SSDP/Scanner.php - About 25 mins to fix

        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

        Severity
        Category
        Status
        Source
        Language