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]) {
- Read upRead up
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());
- Read upRead up
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 {
- Read upRead up
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,
Avoid deeply nested control flow statements. Open
for (const prefix of options.PREFIX) {
args.push('PREFIX', prefix);
}
Function transformArguments
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
host: RedisCommandArgument,
port: number,
key: RedisCommandArgument | Array<RedisCommandArgument>,
destinationDb: number,
timeout: number,
Function transformArguments
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
key: RedisCommandArgument,
coordinates: GeoCoordinates,
radius: number,
unit: GeoUnits,
destination: RedisCommandArgument,
Function transformArguments
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
key: RedisCommandArgument,
member: string,
radius: number,
unit: GeoUnits,
replyWith: Array<GeoReplyWith>,
Function queryParamToString
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function queryParamToString(param: QueryParam): string {
if (param === null) {
return 'null';
}
- Read upRead up
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);
}
Function pushGeoRadiusArguments
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
args: RedisCommandArguments,
key: RedisCommandArgument,
from: GeoSearchFrom,
radius: number,
unit: GeoUnits,
Function transformArguments
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
key: RedisCommandArgument,
group: RedisCommandArgument,
start: string,
end: string,
count: number,
Function transformArguments
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
key: RedisCommandArgument,
group: RedisCommandArgument,
consumer: RedisCommandArgument,
minIdleTime: number,
id: RedisCommandArgument | Array<RedisCommandArgument>,
Function transformArguments
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
key: RedisCommandArgument,
member: string,
radius: number,
unit: GeoUnits,
replyWith: Array<GeoReplyWith>,
Function transformArguments
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
key: RedisCommandArgument,
coordinates: GeoCoordinates,
radius: number,
unit: GeoUnits,
replyWith: Array<GeoReplyWith>,
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;
- Read upRead up
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,
Function transformArguments
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
key: RedisCommandArgument,
group: RedisCommandArgument,
consumer: RedisCommandArgument,
minIdleTime: number,
start: string,
Function transformArguments
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
key: RedisCommandArgument,
coordinates: GeoCoordinates,
radius: number,
unit: GeoUnits,
replyWith: Array<GeoReplyWith>,
Function transformArguments
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
destination: RedisCommandArgument,
source: RedisCommandArgument,
from: GeoSearchFrom,
by: GeoSearchBy,
options?: GeoSearchStoreOptions