jpcercal/resource-query-language

View on GitHub

Showing 14 of 16 total issues

Function __construct has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($field, $rawValue)
    {
        if (!is_string($field)) {
            throw new InvalidExprException('The value of "field" must be a string data type.');
        }
Severity: Minor
Found in src/Expr/InExpr.php - About 2 hrs 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 __construct has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function __construct($field, $rawValue)
    {
        if (!is_string($field)) {
            throw new InvalidExprException('The value of "field" must be a string data type.');
        }
Severity: Minor
Found in src/Expr/InExpr.php - About 1 hr to fix

    Function parse has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        public function parse()
        {
            $builder = new ExprBuilder();
    
            $items = $this->getData();
    Severity: Minor
    Found in src/Parser/ArrayParser.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 process has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function process(ExprBuilder $builder, $field, $expression, $value)
        {
            if (!Expr::isValidExpression($expression)) {
                throw new ParserException(sprintf(
                    'The expression "%s" is not allowed or not exists.',
    Severity: Minor
    Found in src/Parser/AbstractParser.php - About 1 hr to fix

      Function __construct has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function __construct($expressions)
          {
              if (!is_string($expressions) && !is_array($expressions)) {
                  throw new InvalidExprException('The value of "expressions" must not be a string or an array data type.');
              }
      Severity: Minor
      Found in src/Expr/OrExpr.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 parse has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function parse()
          {
              $builder = new ExprBuilder();
      
              $queryString = $this->getData()->getUri()->getQuery();
      Severity: Minor
      Found in src/Parser/RequestParser.php - About 1 hr to fix

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

            public function __construct($expressions)
            {
                if (!is_string($expressions) && !is_array($expressions)) {
                    throw new InvalidExprException('The value of "expressions" must not be a string or an array data type.');
                }
        Severity: Minor
        Found in src/Expr/OrExpr.php - About 1 hr to fix

          Method __construct has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function __construct($currentPageNumber, $maxResultsPerPage)
              {
                  if (!is_int($currentPageNumber) && !is_numeric($currentPageNumber)) {
                      throw new InvalidExprException('The value of "currentPageNumber" must be an int data type.');
                  }
          Severity: Minor
          Found in src/Expr/PaginateExpr.php - About 1 hr to fix

            Method parse has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function parse()
                {
                    $builder = new ExprBuilder();
            
                    $items = $this->getData();
            Severity: Minor
            Found in src/Parser/ArrayParser.php - About 1 hr to fix

              Function parse has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function parse()
                  {
                      $builder = new ExprBuilder();
              
                      $queryString = $this->getData()->getUri()->getQuery();
              Severity: Minor
              Found in src/Parser/RequestParser.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 __construct has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function __construct($currentPageNumber, $maxResultsPerPage)
                  {
                      if (!is_int($currentPageNumber) && !is_numeric($currentPageNumber)) {
                          throw new InvalidExprException('The value of "currentPageNumber" must be an int data type.');
                      }
              Severity: Minor
              Found in src/Expr/PaginateExpr.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 parse has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function parse()
                  {
                      $builder = new ExprBuilder();
              
                      $items = explode($this->getSeparator(), $this->getData());
              Severity: Minor
              Found in src/Parser/StringParser.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

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

                  public function process(ExprQueue $queue)
                  {
                      foreach ($queue as $expr) {
                          if ($expr instanceof BetweenExpr) {
                              $this->processBetweenExpr($expr);
              Severity: Minor
              Found in src/Processor/DoctrineOrmProcessor.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 __construct has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function __construct($field, $from, $to)
                  {
                      if (!is_string($field)) {
                          throw new InvalidExprException('The value of "field" must be a string data type.');
                      }
              Severity: Minor
              Found in src/Expr/BetweenExpr.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