php-yaoi/php-yaoi

View on GitHub

Showing 197 of 203 total issues

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 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 new static;
      Severity: Major
      Found in src/BaseClass.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 #' . (int)$var;
          Severity: Major
          Found in src/Debug.php - About 30 mins to fix

            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 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 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 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 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 toArray has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function toArray($skipNotSetProperties = false)
                {
                    $result = array();
                    if (null !== $this->fromProperties) {
                        foreach ($this->fromProperties as $property) {
            Severity: Minor
            Found in src/Mappable/Base.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

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

                public static function varBrief($var) {
                    if (is_object($var)) {
                        return get_class($var) . ' #'. spl_object_hash($var);
                    }
                    if (is_array($var)) {
            Severity: Minor
            Found in src/Debug.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 buildUnion has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function buildUnion(Quoter $quoter)
                {
                    if ($this->union && !$this->union->isEmpty()) {
                        if ($this->union->statement === ' ') {
                            return substr($this->union->build($quoter), 1);
            Severity: Minor
            Found in src/Sql/ComplexStatement.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