brokencube/automatorm

View on GitHub

Showing 113 of 452 total issues

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

    final public static function factory($where, $classOrTablename = null, $schema = null, array $options = [], $singleResult = false)
Severity: Minor
Found in src/Orm/Model.php - About 35 mins to fix

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

        public static function format($key, $value, $seen = [], $collectionCount = 0, $exceptionThrown = false)
    Severity: Minor
    Found in src/Orm/Dump.php - About 35 mins to fix

      Function execute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function execute()
          {
              $pdo = $this->connection->connect();
              
              // We are only allowed to execute each Query object once!
      Severity: Minor
      Found in src/Database/Query.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 duplicate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function duplicate($cloneExternalProps = false, Model $newParent = null)
          {
              $clone = clone $this;
              $clone->new = true;
              $clone->delete = false;
      Severity: Minor
      Found in src/Orm/Data.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 __set has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function __set($var, $value)
          {
              // Cannot change data if it is locked (i.e. it is attached to a Model object)
              if ($this->locked) {
                  throw new Exception\Model('MODEL_DATA:SET_WHEN_LOCKED', array($var, $value));
      Severity: Minor
      Found in src/Orm/Data.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 guessContext has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function guessContext($classOrTable)
          {
              // Return 'cached' result
              if (isset(static::$contextCache[$classOrTable])) {
                  return static::$contextCache[$classOrTable];
      Severity: Minor
      Found in src/Orm/Schema.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 addOnClauses has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function addOnClauses($clauses)
          {
              foreach ($clauses as $key => $value) {
                  if ($value instanceof QueryBuilder) {
                      $value = new InnerQuery($value);
      Severity: Minor
      Found in src/Database/QueryBuilder/Where.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 addClauses has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function addClauses($clauses)
          {
              foreach ($clauses as $key => $value) {
                  if ($value instanceof QueryBuilder) {
                      $value = new InnerQuery($value);
      Severity: Minor
      Found in src/Database/QueryBuilder/Where.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 makeMessage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          private function makeMessage($code, $data)
          {
              switch ($code) {
                  case 'NO_GENERATED_SCHEMA':
                      return 'NO_GENERATED_SCHEMA: Could not find a schema definition for namespace: ' . $data;
      Severity: Minor
      Found in src/Exception/Model.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 ["DELETE FROM $table{$where}{$limit}", $this->data];
      Severity: Major
      Found in src/Database/QueryBuilder.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return 'ERROR_DURING_MASS_ASSIGNMENT: During ->assignData(), the following exception occurred: ' . $e->makeMessage($e->code, $e->data);
        Severity: Major
        Found in src/Exception/Model.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return new static($list);
          Severity: Major
          Found in src/Orm/Collection.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return static::groupJoinM2M($collection, $var, $where, $onlyCount);
            Severity: Major
            Found in src/Orm/Data.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return $this->joinM2M($var, $where);
              Severity: Major
              Found in src/Orm/Data.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return $value1 <= $value2;
                Severity: Major
                Found in src/OperatorParser.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  return 'NO_SUCH_SERVICE: Tried to access service "{$data}", but it has not yet been definied';
                  Severity: Major
                  Found in src/Exception/Model.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                            return false;
                    Severity: Major
                    Found in src/Orm/Data.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                      return 'MODEL_DATA:UNEXPECTED_COLUMN_NAME: Property "'.$column.'" does not exist in the schema for this object ('.$model['table_name'].'). Please check the $model for this object, or look at $obj->var_dump()';
                      Severity: Major
                      Found in src/Exception/Model.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return $this->joinM21($var);
                        Severity: Major
                        Found in src/Orm/Data.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                          return 'MODEL_DATA:INCORRECT_MODEL_FOR_RELATIONSHIP: Property "'.$column.'" expected a Model relating to table "'.$expectedTable.'" but a Model for "'.$suppliedTable.'" was given instead.';
                          Severity: Major
                          Found in src/Exception/Model.php - About 30 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language