phonetworks/pho-framework

View on GitHub

Showing 34 of 38 total issues

Function fill has a Cognitive Complexity of 7 (exceeds 5 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 35 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 findFormativeClass has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected static function findFormativeClass(
        string $name, 
        array $args, 
        array $pack
        ): string
Severity: Minor
Found in src/Pho/Framework/Handlers/Form.php - About 35 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

Avoid too many return statements within this method.
Open

            return $notification();
Severity: Major
Found in src/Pho/Framework/AbstractEdge.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                return Utils::pickSingular(static::getEdgeItself($particle, $pack, $name, Direction::out(), true));
    Severity: Major
    Found in src/Pho/Framework/Handlers/Get.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return static::getEdgeItself($particle, $pack, $name, Direction::in());
      Severity: Major
      Found in src/Pho/Framework/Handlers/Get.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return $$type();
        Severity: Major
        Found in src/Pho/Framework/AbstractEdge.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return $this->value;
          Severity: Major
          Found in src/Pho/Framework/FieldHelper.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return Utils::pickSingular(static::getEdgeItself($particle, $pack, $name, Direction::in(), true));
            Severity: Major
            Found in src/Pho/Framework/Handlers/Get.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return static::getEdgeItself($particle, $pack, $name, Direction::out());
              Severity: Major
              Found in src/Pho/Framework/Handlers/Get.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return static::getField($particle, $pack["fields"], $name, $args);
                Severity: Major
                Found in src/Pho/Framework/Handlers/Get.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return Utils::pickSingular(static::getEdgeNodes($particle, $pack, $name, Direction::in(), true));
                  Severity: Major
                  Found in src/Pho/Framework/Handlers/Get.php - About 30 mins to fix

                    Function __call has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function __call(string $method, array $args)//: mixed
                        {
                            $field_setter = function(string $field, array $args): void
                            {
                                $value = $args[0];
                    Severity: Minor
                    Found in src/Pho/Framework/AbstractEdge.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 handle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function handle(
                            ParticleInterface $particle,
                            array $pack,
                            string $name, 
                            array $args
                    Severity: Minor
                    Found in src/Pho/Framework/Handlers/Has.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 process has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function process() /*: mixed*/
                        {
                            if(!isset($this->settings["directives"]))
                                return $this->value;
                            $directives = $this->settings["directives"];
                    Severity: Minor
                    Found in src/Pho/Framework/FieldHelper.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