NodeRedis/node-redis

View on GitHub

Showing 81 of 753 total issues

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

export function transformReply(rawReply: Array<any>): XInfoStreamReply {
    const parsedReply: Partial<XInfoStreamReply> = {};

    for (let i = 0; i < rawReply.length; i+= 2) {
        switch (rawReply[i]) {
Severity: Minor
Found in packages/client/lib/commands/XINFO_STREAM.ts - 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 transformArguments has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export function transformArguments(index: string, query: string, options?: SpellCheckOptions): Array<string> {
    const args = ['FT.SPELLCHECK', index, query];

    if (options?.DISTANCE) {
        args.push('DISTANCE', options.DISTANCE.toString());
Severity: Minor
Found in packages/search/lib/commands/SPELLCHECK.ts - 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 transformArguments has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export function transformArguments(
    key: RedisCommandArgument,
    value: RedisCommandArgument | number,
    options?: SetOptions
): RedisCommandArguments {
Severity: Minor
Found in packages/client/lib/commands/SET.ts - 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 pushGeoRadiusStoreArguments has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    args: RedisCommandArguments,
    key: RedisCommandArgument,
    from: GeoSearchFrom,
    radius: number,
    unit: GeoUnits,
Severity: Major
Found in packages/client/lib/commands/generic-transformers.ts - About 50 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        for (const prefix of options.PREFIX) {
                            args.push('PREFIX', prefix);
                        }
    Severity: Major
    Found in packages/client/lib/commands/CLIENT_TRACKING.ts - About 45 mins to fix

      Function transformArguments has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          host: RedisCommandArgument,
          port: number,
          key: RedisCommandArgument | Array<RedisCommandArgument>,
          destinationDb: number,
          timeout: number,
      Severity: Minor
      Found in packages/client/lib/commands/MIGRATE.ts - About 45 mins to fix

        Function transformArguments has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            key: RedisCommandArgument,
            coordinates: GeoCoordinates,
            radius: number,
            unit: GeoUnits,
            destination: RedisCommandArgument,
        Severity: Minor
        Found in packages/client/lib/commands/GEORADIUSSTORE.ts - About 45 mins to fix

          Function transformArguments has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              key: RedisCommandArgument,
              member: string,
              radius: number,
              unit: GeoUnits,
              replyWith: Array<GeoReplyWith>,
          Severity: Minor
          Found in packages/client/lib/commands/GEORADIUSBYMEMBER_WITH.ts - About 45 mins to fix

            Function queryParamToString has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            function queryParamToString(param: QueryParam): string {
                if (param === null) {
                    return 'null';
                }
            
            
            Severity: Minor
            Found in packages/graph/lib/commands/index.ts - 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

            Avoid deeply nested control flow statements.
            Open

                                    for (const reducer of step.REDUCE) {
                                        pushGroupByReducer(args, reducer);
                                    }
            Severity: Major
            Found in packages/search/lib/commands/AGGREGATE.ts - About 45 mins to fix

              Function pushGeoRadiusArguments has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  args: RedisCommandArguments,
                  key: RedisCommandArgument,
                  from: GeoSearchFrom,
                  radius: number,
                  unit: GeoUnits,
              Severity: Minor
              Found in packages/client/lib/commands/generic-transformers.ts - About 45 mins to fix

                Function transformArguments has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    key: RedisCommandArgument,
                    group: RedisCommandArgument,
                    start: string,
                    end: string,
                    count: number,
                Severity: Minor
                Found in packages/client/lib/commands/XPENDING_RANGE.ts - About 45 mins to fix

                  Function transformArguments has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      key: RedisCommandArgument,
                      group: RedisCommandArgument,
                      consumer: RedisCommandArgument,
                      minIdleTime: number,
                      id: RedisCommandArgument | Array<RedisCommandArgument>,
                  Severity: Minor
                  Found in packages/client/lib/commands/XCLAIM.ts - About 45 mins to fix

                    Function transformArguments has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        key: RedisCommandArgument,
                        member: string,
                        radius: number,
                        unit: GeoUnits,
                        replyWith: Array<GeoReplyWith>,
                    Severity: Minor
                    Found in packages/client/lib/commands/GEORADIUSBYMEMBER_RO_WITH.ts - About 45 mins to fix

                      Function transformArguments has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          key: RedisCommandArgument,
                          coordinates: GeoCoordinates,
                          radius: number,
                          unit: GeoUnits,
                          replyWith: Array<GeoReplyWith>,
                      Severity: Minor
                      Found in packages/client/lib/commands/GEORADIUS_WITH.ts - About 45 mins to fix

                        Function parseBulkString has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private parseBulkString(chunk: Buffer): string | Buffer | null | undefined {
                                if (this.bulkStringRemainingLength === undefined) {
                                    const length = this.parseInteger(chunk);
                                    if (length === undefined) return;
                                    if (length === -1) return null;
                        Severity: Minor
                        Found in packages/client/lib/client/RESP2/decoder.ts - 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 transformArguments has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            key: RedisCommandArgument,
                            member: string,
                            radius: number,
                            unit: GeoUnits,
                            destination: RedisCommandArgument,
                        Severity: Minor
                        Found in packages/client/lib/commands/GEORADIUSBYMEMBERSTORE.ts - About 45 mins to fix

                          Function transformArguments has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              key: RedisCommandArgument,
                              group: RedisCommandArgument,
                              consumer: RedisCommandArgument,
                              minIdleTime: number,
                              start: string,
                          Severity: Minor
                          Found in packages/client/lib/commands/XAUTOCLAIM.ts - About 45 mins to fix

                            Function transformArguments has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                key: RedisCommandArgument,
                                coordinates: GeoCoordinates,
                                radius: number,
                                unit: GeoUnits,
                                replyWith: Array<GeoReplyWith>,
                            Severity: Minor
                            Found in packages/client/lib/commands/GEORADIUS_RO_WITH.ts - About 45 mins to fix

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

                                  destination: RedisCommandArgument,
                                  source: RedisCommandArgument,
                                  from: GeoSearchFrom,
                                  by: GeoSearchBy,
                                  options?: GeoSearchStoreOptions
                              Severity: Minor
                              Found in packages/client/lib/commands/GEOSEARCHSTORE.ts - About 35 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language