phonetworks/pho-framework

View on GitHub

Showing 34 of 38 total issues

Function pack has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

    public static function pack(Framework\ParticleInterface $particle): AbstractLoader
    {
        $obj = new OutgoingEdgeLoader($particle->getRegisteredOutgoingEdges());
        foreach ($obj->cargo->classes as $class) {
            $class = str_replace("ObjectOut", "ObjOut", $class); // for backwards-compatibility.
Severity: Minor
Found in src/Pho/Framework/Loaders/OutgoingEdgeLoader.php - About 7 hrs 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 pack has 94 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function pack(Framework\ParticleInterface $particle): AbstractLoader
    {
        $obj = new OutgoingEdgeLoader($particle->getRegisteredOutgoingEdges());
        foreach ($obj->cargo->classes as $class) {
            $class = str_replace("ObjectOut", "ObjOut", $class); // for backwards-compatibility.
Severity: Major
Found in src/Pho/Framework/Loaders/OutgoingEdgeLoader.php - About 3 hrs to fix

    Function probe has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

        public function probe(): void
        {
            if(!isset($this->settings["constraints"])) 
                return;
            $constraints = $this->settings["constraints"];
    Severity: Minor
    Found in src/Pho/Framework/FieldHelper.php - About 2 hrs 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 probe has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function probe(): void
        {
            if(!isset($this->settings["constraints"])) 
                return;
            $constraints = $this->settings["constraints"];
    Severity: Major
    Found in src/Pho/Framework/FieldHelper.php - About 2 hrs to fix

      Function header has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          protected static function header(EntityInterface $entity): array
          {
              error_log("calculating headers: ");
              error_log(get_class($entity));
              $first_hex = 11;
      Severity: Minor
      Found in src/Pho/Framework/ID.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 pack has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function pack(ParticleInterface $particle): AbstractLoader 
          {
              $obj = new IncomingEdgeLoader($particle->getRegisteredIncomingEdges());
              foreach($obj->cargo->classes as $class) {
                  $class = str_replace("ObjectOut", "ObjOut", $class); // for backwards-compatibility.
      Severity: Minor
      Found in src/Pho/Framework/Loaders/IncomingEdgeLoader.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 handle has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function handle(
              ParticleInterface $particle,
              array $pack,
              string $name, 
              array $args // no use -yet-
      Severity: Minor
      Found in src/Pho/Framework/Handlers/Get.php - About 1 hr to fix

        Function in has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            public function in(ContextInterface $context): bool
            {
                /*
                // would speed up, but not good for testing.
                if($context instanceof Space)
        Severity: Minor
        Found in src/Pho/Framework/Graph.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 pack has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function pack(ParticleInterface $particle): AbstractLoader 
            {
                $obj = new IncomingEdgeLoader($particle->getRegisteredIncomingEdges());
                foreach($obj->cargo->classes as $class) {
                    $class = str_replace("ObjectOut", "ObjOut", $class); // for backwards-compatibility.
        Severity: Minor
        Found in src/Pho/Framework/Loaders/IncomingEdgeLoader.php - About 1 hr to fix

          Method fill has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function fill(array $args): AbstractEdge
              {
                  if( count($this->fields)<=0 ) {
                      return $this;
                  }
          Severity: Minor
          Found in src/Pho/Framework/AbstractEdge.php - About 1 hr to fix

            Method switch has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function switch(string $name, array $args) /*:  \Pho\Lib\Graph\EntityInterface*/
                {
                    $method = function(string $key) {
                        return $this->adapters[$key] . "::handle";
                    };
            Severity: Minor
            Found in src/Pho/Framework/Handlers/Gateway.php - About 1 hr to fix

              Method header has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected static function header(EntityInterface $entity): array
                  {
                      error_log("calculating headers: ");
                      error_log(get_class($entity));
                      $first_hex = 11;
              Severity: Minor
              Found in src/Pho/Framework/ID.php - About 1 hr to fix

                Function handle has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function handle(
                        ParticleInterface $particle,
                        array $pack,
                        string $name, 
                        array $args // no use -yet-
                Severity: Minor
                Found in src/Pho/Framework/Handlers/Get.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 setup has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function setup(string $type = "all"): AbstractEdge
                    {
                        $fields = function(): AbstractEdge
                        {
                            $this->fields = Loaders\FieldsLoader::fetchArray($this);
                Severity: Minor
                Found in src/Pho/Framework/AbstractEdge.php - About 1 hr to fix

                  Function switch has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function switch(string $name, array $args) /*:  \Pho\Lib\Graph\EntityInterface*/
                      {
                          $method = function(string $key) {
                              return $this->adapters[$key] . "::handle";
                          };
                  Severity: Minor
                  Found in src/Pho/Framework/Handlers/Gateway.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

                  Method getEdgeItself has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          ParticleInterface $particle, 
                          array $pack,
                          string $name,
                          Direction $direction,
                          bool $singular = false
                  Severity: Minor
                  Found in src/Pho/Framework/Handlers/Get.php - About 35 mins to fix

                    Method saveField has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            ParticleInterface $particle, 
                            string $field_name, 
                            /*mixed*/ $field_value, 
                            bool $defer_persist, 
                            FieldHelper $helper): void
                    Severity: Minor
                    Found in src/Pho/Framework/Handlers/Set.php - About 35 mins to fix

                      Method checkEdgeNode has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              ParticleInterface $particle, 
                              array $pack,
                              string $name,
                              ID $id,
                              Direction $direction 
                      Severity: Minor
                      Found in src/Pho/Framework/Handlers/Has.php - About 35 mins to fix

                        Method checkEdgeItself has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                ParticleInterface $particle, 
                                array $pack,
                                string $name,
                                ID $id,
                                Direction $direction 
                        Severity: Minor
                        Found in src/Pho/Framework/Handlers/Has.php - About 35 mins to fix

                          Method getEdgeNodes has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  ParticleInterface $particle, 
                                  array $pack,
                                  string $name,
                                  Direction $direction,
                                  bool $singular = false 
                          Severity: Minor
                          Found in src/Pho/Framework/Handlers/Get.php - About 35 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language