hnhdigital-os/laravel-model-filter

View on GitHub

Showing 63 of 194 total issues

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

    public function scopeModelJoin($query, $relationships, $operator = '=', $type = 'left', $where = false)
Severity: Minor
Found in src/Traits/ModelTrait.php - About 35 mins to fix

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

        protected static function showSearchAppliedFilters(&$tbody, &$search_request, $result, $model, $column_span = 1)
    Severity: Minor
    Found in src/Traits/ControllerTrait.php - About 35 mins to fix

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

          protected static function getSearchAppliedFilters($controller_name, $distinct_session = '', $use_session = false)
          {
      
              // Filter provided.
              if (is_array($use_session)) {
      Severity: Minor
      Found in src/Traits/ControllerTrait.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 compose has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function compose(View $view)
          {
              $view_data = $view->getData();
      
              if ($view_data['template']) {
      Severity: Minor
      Found in src/Composers/SearchFilterList.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 true;
      Severity: Major
      Found in src/Traits/ModelTrait.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                                return true;
        Severity: Major
        Found in src/Traits/ModelTrait.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                                  return true;
          Severity: Major
          Found in src/Traits/ModelTrait.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                                    return true;
            Severity: Major
            Found in src/Traits/ModelTrait.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                                      return true;
              Severity: Major
              Found in src/Traits/ModelTrait.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                        return true;
                Severity: Major
                Found in src/Traits/ModelTrait.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                          return true;
                  Severity: Major
                  Found in src/Traits/ModelTrait.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                            return true;
                    Severity: Major
                    Found in src/Traits/ModelTrait.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                              return true;
                      Severity: Major
                      Found in src/Traits/ModelTrait.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                                return true;
                        Severity: Major
                        Found in src/Traits/ModelTrait.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                                  return true;
                          Severity: Major
                          Found in src/Traits/ModelTrait.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                                    return true;
                            Severity: Major
                            Found in src/Traits/ModelTrait.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                                      return true;
                              Severity: Major
                              Found in src/Traits/ModelTrait.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                                        return true;
                                Severity: Major
                                Found in src/Traits/ModelTrait.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                                          return true;
                                  Severity: Major
                                  Found in src/Traits/ModelTrait.php - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                            return true;
                                    Severity: Major
                                    Found in src/Traits/ModelTrait.php - About 30 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language