php-yaoi/php-yaoi

View on GitHub

Showing 203 of 203 total issues

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 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

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

Severity
Category
Status
Source
Language