Showing 347 of 347 total issues
Function isLong
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function isLong(value: Nullable<string | number>): boolean {
if (isNil(value) || value.toString().match(/[^\d\-]/g)) {
return false;
} else {
const decimal: BigDecimal = new BigDecimal(value);
- 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 ensureQueryParams
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function ensureQueryParams(
queryParams: Nullable<PlainObject>,
originalMethod: Fn,
args: any[]
): Nullable<PlainObject> {
- 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 prepareExponentiation
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function prepareExponentiation(mantisa: any, exponent: any, offset: number): string {
let num: string = '';
if (mantisa.length < exponent) {
num = mantisa + new Array(exponent - mantisa.length + 1).join('0');
- 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 compareNumberModules
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function compareNumberModules(inputA: string, inputB: string): CompareResult {
const a: string = pad(inputA, inputB)[0];
const b: string = pad(inputA, inputB)[1];
if (a.localeCompare(b) === 0) {
- 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 ensureProviders
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function ensureProviders(
meta: NgxsRepositoryMeta,
stateClassRef: Type<StateClass>,
options?: ProviderOptions
): PersistenceProvider[] {
- 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 prepareNum
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function prepareNum(inputNum?: string | number): any {
let num: string | number | undefined = inputNum;
if (checkValueIsFilled(inputNum)) {
num = inputNum.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 deepObjectReduce
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function deepObjectReduce<T>({ accumulator, key, targetValue, options }: ObjectReduceOptions<T>): T {
let value: T | string = targetValue;
if (isTrue(options.weekType)) {
const isComplexType: boolean = typeof targetValue === 'object' && targetValue !== 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"