Showing 249 of 257 total issues

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

    private function getFacetCategory($facetCategories, $type)
    {
        if (! isset($type)) {
            return null;
        }
Severity: Minor
Found in app/resto/core/dbfunctions/FacetsFunctions.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 appendSkos has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function appendSkos($hashtags)
    {
        for ($i = 0, $ii = count($hashtags); $i < $ii; $i++) {
            /*
             * If resto-addon-sosa add-on exists, check for searchTerm last character:
Severity: Minor
Found in app/resto/core/RestoQueryAnalyzer.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 array(
            'isValid' => true
        );
Severity: Major
Found in app/resto/core/utils/RestoGeometryUtil.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                    return '>';
    Severity: Major
    Found in app/resto/core/utils/Lexer.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return self::T_COMMA;
      Severity: Major
      Found in app/resto/core/utils/Lexer.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return '<=';
        Severity: Major
        Found in app/resto/core/utils/Lexer.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return self::T_LTE;
          Severity: Major
          Found in app/resto/core/utils/Lexer.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return self::T_CLOSE_PARENTHESIS;
            Severity: Major
            Found in app/resto/core/utils/Lexer.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              return $rights[$action] ?? false;
              Severity: Major
              Found in app/resto/core/RestoUser.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return 'intersects';
                Severity: Major
                Found in app/resto/core/utils/Lexer.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                          return $type;
                  Severity: Major
                  Found in app/resto/core/utils/Lexer.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                    return self::T_EQ;
                    Severity: Major
                    Found in app/resto/core/utils/Lexer.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                      return self::T_CLOSE_BLOCK;
                      Severity: Major
                      Found in app/resto/core/utils/Lexer.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                return $childs;
                        Severity: Major
                        Found in app/resto/core/addons/STACCatalog.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                          return self::T_LT;
                          Severity: Major
                          Found in app/resto/core/utils/Lexer.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                    return RestoLogUtil::success('Catalog deleted', (new FacetsFunctions($this->context->dbDriver))->removeFacet($facetId));
                            Severity: Major
                            Found in app/resto/core/addons/STACCatalog.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                              return 'in';
                              Severity: Major
                              Found in app/resto/core/utils/Lexer.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                                return self::T_STRING;
                                Severity: Major
                                Found in app/resto/core/utils/Lexer.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                                  return self::T_GTE;
                                  Severity: Major
                                  Found in app/resto/core/utils/Lexer.php - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                    return 'ni';
                                    Severity: Major
                                    Found in app/resto/core/utils/Lexer.php - About 30 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language