regevbr/json-expression-eval

View on GitHub

Showing 9 of 69 total issues

Function evaluateCompareOp has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

async function evaluateCompareOp<C extends Context, Ignore>(expressionValue: ExtendedCompareOp<any, any, any>,
expressionKey: string, contextValue: any,
context: C, validation: boolean)
Severity: Minor
Found in src/lib/evaluator.ts - About 35 mins to fix

    Avoid too many return statements within this function.
    Open

    return contextValue < ltValue;
    Severity: Major
    Found in src/lib/evaluator.ts - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

      return expressionValue.nin.map((value) => computeValue(context, validation, value, expressionKey))
      .indexOf(contextValue) < 0;
      Severity: Major
      Found in src/lib/evaluator.ts - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

        return contextValue >= gteValue;
        Severity: Major
        Found in src/lib/evaluator.ts - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

          return Boolean(contextValue.match(new RegExp(regexpiValue, `i`)));
          Severity: Major
          Found in src/lib/evaluator.ts - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

            return Boolean(contextValue.match(new RegExp(regexpValue)));
            Severity: Major
            Found in src/lib/evaluator.ts - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

              return contextValue <= lteValue;
              Severity: Major
              Found in src/lib/evaluator.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                return evaluateCompareOp<C, Ignore>(
                (expression as PropertyCompareOps<C, Ignore>)
                [expressionKey as any as keyof PropertyCompareOps<C, Ignore>] as
                unknown as ExtendedCompareOp<any, any, any>,
                expressionKey, contextValue, context, validation);
                Severity: Major
                Found in src/lib/evaluator.ts - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                  return contextValue > gtValue;
                  Severity: Major
                  Found in src/lib/evaluator.ts - About 30 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language