Angular-RU/angular-ru-sdk

View on GitHub

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);
Severity: Minor
Found in libs/cdk/validators/src/long.validator.ts - 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

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> {
Severity: Minor
Found in libs/cdk/http/decorators/src/internal/ensure-query-params.ts - 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

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');
Severity: Minor
Found in libs/cdk/big-decimal/src/js-big-decimal/big-decimal.ts - 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

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) {
Severity: Minor
Found in libs/cdk/big-decimal/src/js-big-decimal/compare-to.ts - 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

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[] {
Severity: Minor
Found in libs/ngxs/storage/src/utils/ensure-providers.ts - 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

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();
Severity: Minor
Found in libs/cdk/big-decimal/src/js-big-decimal/big-decimal.ts - 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

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!;
Severity: Minor
Found in libs/cdk/object/src/utils.ts - 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