php-yaoi/php-yaoi

View on GitHub

Showing 203 of 203 total issues

Avoid too many return statements within this method.
Open

            return null;
Severity: Major
Found in src/Storage/Driver/PhpVar.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                    return new static($args[0], $args[1], $args[2], $args[3], $args[4]);
    Severity: Major
    Found in src/BaseClass.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return false;
      Severity: Major
      Found in src/Storage/Driver/PhpVar.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return '"' . $var . '"';
        Severity: Major
        Found in src/Debug.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return $resource;
          Severity: Major
          Found in src/Service.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return 'Resource #' . (int)$var;
            Severity: Major
            Found in src/Debug.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return new $serviceClassName($identifier);
              Severity: Major
              Found in src/Service.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        return new static;
                Severity: Major
                Found in src/BaseClass.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                      return $resource;
                  Severity: Major
                  Found in src/Service.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return $identifier;
                    Severity: Major
                    Found in src/Service.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return $var;
                      Severity: Major
                      Found in src/Debug.php - About 30 mins to fix

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

                            public function getColumnFlagsByString($typeString) {
                                $phpType = Column::AUTO_TYPE;
                        
                                switch (true) {
                                    case 'integer' === substr($typeString, 0, 7):
                        Severity: Minor
                        Found in src/Database/Pgsql/SchemaReader.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 addContent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function addContent($message)
                            {
                                if ($message instanceof SubContent) {
                                   $this->addContent($message->content);
                                }
                        Severity: Minor
                        Found in src/Io/Response/ArrayResponse.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 toArray has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function toArray($skipNotSetProperties = false)
                            {
                                $result = (array)$this;
                                if ($skipNotSetProperties) {
                                    foreach ($result as $key => $value) {
                        Severity: Minor
                        Found in src/Io/Request/Server.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 connect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            protected function connect()
                            {
                                $host = $this->dsn->hostname;
                                if ($this->dsn->persistent) {
                                    if (is_null($host)) {
                        Severity: Minor
                        Found in src/Database/Driver/Mysqli.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 fillValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function fillValue(&$source = null)
                            {
                                if (null === $source) {
                                    $source = &$_REQUEST;
                                }
                        Severity: Minor
                        Found in src/View/HTML/Input.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 connect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private function connect()
                            {
                                $host = $this->dsn->hostname;
                        
                                // "host=sheep port=5432 dbname=mary user=lamb password=foo"
                        Severity: Minor
                        Found in src/Database/Driver/Pgsql.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 render has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function render()
                            {
                                $console = Console::getInstance();
                                $value = $this->text->value;
                        
                        
                        Severity: Minor
                        Found in src/Cli/View/Text.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 connect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private function connect()
                            {
                                $host = $this->dsn->hostname;
                        
                                // "host=sheep port=5432 dbname=mary user=lamb password=foo"
                        Severity: Minor
                        Found in src/Database/Driver/PdoPgsql.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 set has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function set($key, $value, $ttl)
                            {
                                if (is_array($value) || is_object($value)) {
                                    throw new Exception('Complex data types not supported by this storage, consider serialization',
                                        Exception::SCALAR_REQUIRED);
                        Severity: Minor
                        Found in src/Storage/Driver/DatabaseProxy.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