Thruio/ActiveRecord

View on GitHub

Showing 46 of 50 total issues

Method exec has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function exec()
    {
        $primary_key_search = false;
        if (count($this->conditions) == 1) {
            /* @var $model ActiveRecord */
Severity: Minor
Found in src/Search.php - About 1 hr to fix

    Function processConditions has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function processConditions($thing)
        {
            $conditions = [];
            // CONDITIONS
            if (count($thing->getConditions()) > 0) {
    Severity: Minor
    Found in src/DatabaseLayer/Sql/GenericSql.php - About 1 hr 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 processConditions has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function processConditions($thing)
        {
            $conditions = [];
            // CONDITIONS
            if (count($thing->getConditions()) > 0) {
    Severity: Minor
    Found in src/DatabaseLayer/Sql/Postgres.php - About 1 hr 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 __calculateSaveDownRows has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        public function __calculateSaveDownRows()
        {
            if (!$this->_columns) {
                foreach (get_object_vars($this) as $potential_column => $discard) {
                    switch ($potential_column) {
    Severity: Minor
    Found in src/ActiveRecord.php - About 1 hr 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 exec has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        public function exec()
        {
            $primary_key_search = false;
            if (count($this->conditions) == 1) {
                /* @var $model ActiveRecord */
    Severity: Minor
    Found in src/Search.php - About 1 hr 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 processUpdate has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        public function processUpdate(DatabaseLayer\Update $thing)
        {
            // SELECTORS
            if (count($thing->getTables()) > 1) {
                throw new Exception("Active Record Cannot update into more than one table at a time!");
    Severity: Minor
    Found in src/DatabaseLayer/Sql/Postgres.php - About 1 hr 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 getClassSchema has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getClassSchema()
        {
            $current = get_class($this);
            $parents[] = $current;
            while ($current = get_parent_class($current)) {
    Severity: Minor
    Found in src/ActiveRecord.php - About 1 hr 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

    Method __parseClassSchemaProperty has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function __parseClassSchemaProperty($row)
        {
            $bits = explode(" ", $row);
            $name = trim($bits[1], "$");
            $type = $bits[2];
    Severity: Minor
    Found in src/ActiveRecord.php - About 1 hr to fix

      Method processInsert has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function processInsert(DatabaseLayer\Insert $thing)
          {
              // SELECTORS
              if (count($thing->getTables()) > 1) {
                  throw new Exception("Active Record Cannot insert into more than one table at a time!");
      Severity: Minor
      Found in src/DatabaseLayer/Sql/Sqlite.php - About 1 hr to fix

        Method getClassSchema has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getClassSchema()
            {
                $current = get_class($this);
                $parents[] = $current;
                while ($current = get_parent_class($current)) {
        Severity: Minor
        Found in src/ActiveRecord.php - About 1 hr to fix

          Method processInsert has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function processInsert(DatabaseLayer\Insert $thing)
              {
                  // SELECTORS
                  if (count($thing->getTables()) > 1) {
                      throw new Exception("Active Record Cannot insert into more than one table at a time!");
          Severity: Minor
          Found in src/DatabaseLayer/Sql/Postgres.php - About 1 hr to fix

            Method processUpdate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function processUpdate(DatabaseLayer\Update $thing)
                {
                    // SELECTORS
                    if (count($thing->getTables()) > 1) {
                        throw new Exception("Active Record Cannot update into more than one table at a time!");
            Severity: Minor
            Found in src/DatabaseLayer/Sql/Postgres.php - About 1 hr to fix

              Method execProcessResponse has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function execProcessResponse($response, $primary_key_search)
                  {
                      $results = array();
              
                      foreach ($response as $result) {
              Severity: Minor
              Found in src/Search.php - About 1 hr to fix

                Method getIndexes has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getIndexes($table)
                    {
                        if (isset($this->known_indexes[$table])) {
                            return $this->known_indexes[$table];
                        }
                Severity: Minor
                Found in src/DatabaseLayer/Sql/Postgres.php - About 1 hr to fix

                  Method processUpdate has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function processUpdate(DatabaseLayer\Update $thing)
                      {
                          // SELECTORS
                          if (count($thing->getTables()) > 1) {
                              throw new Exception("Active Record Cannot update into more than one table at a time!");
                  Severity: Minor
                  Found in src/DatabaseLayer/Sql/Sqlite.php - About 1 hr to fix

                    Function processInsert has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function processInsert(DatabaseLayer\Insert $thing)
                        {
                            // SELECTORS
                            if (count($thing->getTables()) > 1) {
                                throw new Exception("Active Record Cannot insert into more than one table at a time!");
                    Severity: Minor
                    Found in src/DatabaseLayer/Sql/Sqlite.php - About 55 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 __parseClassSchemaProperty has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private function __parseClassSchemaProperty($row)
                        {
                            $bits = explode(" ", $row);
                            $name = trim($bits[1], "$");
                            $type = $bits[2];
                    Severity: Minor
                    Found in src/ActiveRecord.php - About 55 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 processUpdate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function processUpdate(DatabaseLayer\Update $thing)
                        {
                            // SELECTORS
                            if (count($thing->getTables()) > 1) {
                                throw new Exception("Active Record Cannot update into more than one table at a time!");
                    Severity: Minor
                    Found in src/DatabaseLayer/Sql/Sqlite.php - About 55 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 execProcessResponse has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private function execProcessResponse($response, $primary_key_search)
                        {
                            $results = array();
                    
                            foreach ($response as $result) {
                    Severity: Minor
                    Found in src/Search.php - About 55 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 processInsert has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function processInsert(DatabaseLayer\Insert $thing)
                        {
                            // SELECTORS
                            if (count($thing->getTables()) > 1) {
                                throw new Exception("Active Record Cannot insert into more than one table at a time!");
                    Severity: Minor
                    Found in src/DatabaseLayer/Sql/Postgres.php - About 45 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