Angular-RU/angular-ru-sdk

View on GitHub

Showing 347 of 347 total issues

Similar blocks of code found in 5 locations. Consider refactoring.
Open

    public get<T = any, R = T>(path: string, options: Partial<DataClientRequestOptions> = {}): Observable<R> {
        return this.request<T, R>(this.createRequestOptions({ method: RequestType.GET, path, options }));
    }
Severity: Major
Found in libs/cdk/http/src/services/abstract-http.client.ts and 4 other locations - About 3 hrs to fix
libs/cdk/http/src/services/abstract-http.client.ts on lines 47..49
libs/cdk/http/src/services/abstract-http.client.ts on lines 51..53
libs/cdk/http/src/services/abstract-http.client.ts on lines 55..57
libs/cdk/http/src/services/abstract-http.client.ts on lines 59..61

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 102.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

    public put<T = any, R = T>(path: string, options: Partial<DataClientRequestOptions> = {}): Observable<R> {
        return this.request<T, R>(this.createRequestOptions({ method: RequestType.PUT, path, options }));
    }
Severity: Major
Found in libs/cdk/http/src/services/abstract-http.client.ts and 4 other locations - About 3 hrs to fix
libs/cdk/http/src/services/abstract-http.client.ts on lines 43..45
libs/cdk/http/src/services/abstract-http.client.ts on lines 47..49
libs/cdk/http/src/services/abstract-http.client.ts on lines 55..57
libs/cdk/http/src/services/abstract-http.client.ts on lines 59..61

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 102.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function sortWorker has 82 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function sortWorker<T>(message: SortableMessage<T>): T[] {
    // eslint-disable-next-line
    enum OrderType {
        DESC = 'desc',
        SKIP = 'skip'
Severity: Major
Found in libs/cdk/virtual-table/src/services/sortable/sort.worker.ts - About 3 hrs to fix

    Function isSatisfying has 79 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function isSatisfying(
            valuesSet: Nullable<PlainValue>[],
            operand: PlainValue,
            filterType: TableFilterType | string
        ): boolean {
    Severity: Major
    Found in libs/cdk/virtual-table/src/services/filterable/filter.worker.ts - About 3 hrs to fix

      Similar blocks of code found in 8 locations. Consider refactoring.
      Open

          public ngOnInit(): void {
              const rowNumber: number = 50;
              const colsNumber: number = 15;
      
              MocksGenerator.generator(rowNumber, colsNumber).then((data: PlainObject[]): void => {
      apps/virtual-table-demo/src/samples/sample-eleven/sample-eleven.component.ts on lines 71..79
      apps/virtual-table-demo/src/samples/sample-fifteen/sample-fifteen.component.ts on lines 18..26
      apps/virtual-table-demo/src/samples/sample-five/sample-five.component.ts on lines 19..27
      apps/virtual-table-demo/src/samples/sample-fourteen/sample-fourteen.component.ts on lines 48..56
      apps/virtual-table-demo/src/samples/sample-seven/sample-seven.component.ts on lines 17..25
      apps/virtual-table-demo/src/samples/sample-six/sample-six.component.ts on lines 21..29
      apps/virtual-table-demo/src/samples/sample-third/sample-third.component.ts on lines 19..27

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 97.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 8 locations. Consider refactoring.
      Open

          public ngOnInit(): void {
              const rowsNumber: number = 10000;
              const cols: number = 30;
      
              MocksGenerator.generator(rowsNumber, cols).then((data: PlainObject[]): void => {
      apps/virtual-table-demo/src/samples/sample-eleven/sample-eleven.component.ts on lines 71..79
      apps/virtual-table-demo/src/samples/sample-fifteen/sample-fifteen.component.ts on lines 18..26
      apps/virtual-table-demo/src/samples/sample-five/sample-five.component.ts on lines 19..27
      apps/virtual-table-demo/src/samples/sample-fourteen/sample-fourteen.component.ts on lines 48..56
      apps/virtual-table-demo/src/samples/sample-six/sample-six.component.ts on lines 21..29
      apps/virtual-table-demo/src/samples/sample-third/sample-third.component.ts on lines 19..27
      apps/virtual-table-demo/src/samples/sample-twelve/sample-twelve.component.ts on lines 48..56

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 97.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 8 locations. Consider refactoring.
      Open

          public ngOnInit(): void {
              const rows: number = 10000;
              const cols: number = 59;
      
              MocksGenerator.generator(rows, cols).then((data: PlainObject[]): void => {
      apps/virtual-table-demo/src/samples/sample-eleven/sample-eleven.component.ts on lines 71..79
      apps/virtual-table-demo/src/samples/sample-fifteen/sample-fifteen.component.ts on lines 18..26
      apps/virtual-table-demo/src/samples/sample-five/sample-five.component.ts on lines 19..27
      apps/virtual-table-demo/src/samples/sample-seven/sample-seven.component.ts on lines 17..25
      apps/virtual-table-demo/src/samples/sample-six/sample-six.component.ts on lines 21..29
      apps/virtual-table-demo/src/samples/sample-third/sample-third.component.ts on lines 19..27
      apps/virtual-table-demo/src/samples/sample-twelve/sample-twelve.component.ts on lines 48..56

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 97.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 8 locations. Consider refactoring.
      Open

          public ngOnInit(): void {
              const rowNumber: number = 1000;
              const colsNumber: number = 59;
      
              MocksGenerator.generator(rowNumber, colsNumber).then((data: PlainObject[]): void => {
      apps/virtual-table-demo/src/samples/sample-eleven/sample-eleven.component.ts on lines 71..79
      apps/virtual-table-demo/src/samples/sample-fifteen/sample-fifteen.component.ts on lines 18..26
      apps/virtual-table-demo/src/samples/sample-five/sample-five.component.ts on lines 19..27
      apps/virtual-table-demo/src/samples/sample-fourteen/sample-fourteen.component.ts on lines 48..56
      apps/virtual-table-demo/src/samples/sample-seven/sample-seven.component.ts on lines 17..25
      apps/virtual-table-demo/src/samples/sample-six/sample-six.component.ts on lines 21..29
      apps/virtual-table-demo/src/samples/sample-twelve/sample-twelve.component.ts on lines 48..56

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 97.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 8 locations. Consider refactoring.
      Open

          public ngOnInit(): void {
              const rows: number = 10000;
              const cols: number = 59;
      
              MocksGenerator.generator(rows, cols).then((data: PlainObject[]): void => {
      apps/virtual-table-demo/src/samples/sample-eleven/sample-eleven.component.ts on lines 71..79
      apps/virtual-table-demo/src/samples/sample-five/sample-five.component.ts on lines 19..27
      apps/virtual-table-demo/src/samples/sample-fourteen/sample-fourteen.component.ts on lines 48..56
      apps/virtual-table-demo/src/samples/sample-seven/sample-seven.component.ts on lines 17..25
      apps/virtual-table-demo/src/samples/sample-six/sample-six.component.ts on lines 21..29
      apps/virtual-table-demo/src/samples/sample-third/sample-third.component.ts on lines 19..27
      apps/virtual-table-demo/src/samples/sample-twelve/sample-twelve.component.ts on lines 48..56

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 97.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 8 locations. Consider refactoring.
      Open

          public ngOnInit(): void {
              const rows: number = 1000;
              const cols: number = 40;
      
              MocksGenerator.generator(rows, cols).then((data: PlainObject[]): void => {
      apps/virtual-table-demo/src/samples/sample-eleven/sample-eleven.component.ts on lines 71..79
      apps/virtual-table-demo/src/samples/sample-fifteen/sample-fifteen.component.ts on lines 18..26
      apps/virtual-table-demo/src/samples/sample-fourteen/sample-fourteen.component.ts on lines 48..56
      apps/virtual-table-demo/src/samples/sample-seven/sample-seven.component.ts on lines 17..25
      apps/virtual-table-demo/src/samples/sample-six/sample-six.component.ts on lines 21..29
      apps/virtual-table-demo/src/samples/sample-third/sample-third.component.ts on lines 19..27
      apps/virtual-table-demo/src/samples/sample-twelve/sample-twelve.component.ts on lines 48..56

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 97.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 8 locations. Consider refactoring.
      Open

          public ngOnInit(): void {
              const rows: number = 10000;
              const cols: number = 50;
      
              MocksGenerator.generator(rows, cols).then((data: PlainObject[]): void => {
      apps/virtual-table-demo/src/samples/sample-eleven/sample-eleven.component.ts on lines 71..79
      apps/virtual-table-demo/src/samples/sample-fifteen/sample-fifteen.component.ts on lines 18..26
      apps/virtual-table-demo/src/samples/sample-five/sample-five.component.ts on lines 19..27
      apps/virtual-table-demo/src/samples/sample-fourteen/sample-fourteen.component.ts on lines 48..56
      apps/virtual-table-demo/src/samples/sample-seven/sample-seven.component.ts on lines 17..25
      apps/virtual-table-demo/src/samples/sample-third/sample-third.component.ts on lines 19..27
      apps/virtual-table-demo/src/samples/sample-twelve/sample-twelve.component.ts on lines 48..56

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 97.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 8 locations. Consider refactoring.
      Open

          public ngOnInit(): void {
              const rows: number = 50;
              const cols: number = 15;
      
              MocksGenerator.generator(rows, cols).then((data: PlainObject[]): void => {
      apps/virtual-table-demo/src/samples/sample-fifteen/sample-fifteen.component.ts on lines 18..26
      apps/virtual-table-demo/src/samples/sample-five/sample-five.component.ts on lines 19..27
      apps/virtual-table-demo/src/samples/sample-fourteen/sample-fourteen.component.ts on lines 48..56
      apps/virtual-table-demo/src/samples/sample-seven/sample-seven.component.ts on lines 17..25
      apps/virtual-table-demo/src/samples/sample-six/sample-six.component.ts on lines 21..29
      apps/virtual-table-demo/src/samples/sample-third/sample-third.component.ts on lines 19..27
      apps/virtual-table-demo/src/samples/sample-twelve/sample-twelve.component.ts on lines 48..56

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 97.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function createTsJestConfig has 75 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function createTsJestConfig(options: JestConfigOptions): Config.InitialOptions {
          const rootDir: string = options.jestConfig?.rootDir ?? path.resolve('.');
          const resolvedRootDir: string = path.isAbsolute(rootDir) ? rootDir : path.resolve(rootDir);
          const packageJsonPath: string = path.resolve(rootDir, 'package.json');
          let displayName: string | Config.DisplayName | null | undefined;
      Severity: Major
      Found in libs/jest/src/utils/create-ts-jest-config.ts - About 3 hrs to fix

        LoggerService has 26 functions (exceeds 20 allowed). Consider refactoring.
        Open

        @BoundClass
        @Injectable()
        export class LoggerService {
            private readonly DEFAULT_DEPTH: number = 2;
        
        
        Severity: Minor
        Found in libs/cdk/logger/src/logger.service.ts - About 3 hrs to fix

          File tooltip.directive.ts has 291 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* eslint-disable @angular-eslint/no-input-rename */
          import {
              Directive,
              ElementRef,
              EmbeddedViewRef,
          Severity: Minor
          Found in libs/cdk/tooltip/src/tooltip.directive.ts - About 3 hrs to fix

            Function compileColumnMetadata has 74 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public compileColumnMetadata(column: NgxColumnComponent<T>): void {
                    const {
                        key,
                        th,
                        td,

              Function divide has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
              Open

              export function divide(
                  inputDividend: number | string,
                  inputDivisor: number | string,
                  inputPrecision: number = DEFAULT_PRECISSION
              ): string {
              Severity: Minor
              Found in libs/cdk/big-decimal/src/js-big-decimal/divide.ts - About 2 hrs 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

              BigDecimal has 25 functions (exceeds 20 allowed). Consider refactoring.
              Open

              export class BigDecimal {
                  private readonly value: string;
              
                  constructor(num: number | string = '0') {
                      this.value = BigDecimal.validate(num);
              Severity: Minor
              Found in libs/cdk/big-decimal/src/js-big-decimal/big-decimal.ts - About 2 hrs to fix

                AutoHeightDirective has 24 functions (exceeds 20 allowed). Consider refactoring.
                Open

                @Directive({ selector: '[autoHeight]' })
                export class AutoHeightDirective<T> implements OnInit, OnChanges, OnDestroy {
                    private _destroy$: Subject<boolean> = new Subject<boolean>();
                    private readonly minHeight: number = 0;
                    private useOnlyAutoViewPort: boolean = false;
                Severity: Minor
                Found in libs/cdk/virtual-table/src/directives/auto-height.directive.ts - About 2 hrs to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      private toViewValue(modelValue: ModelValue): ViewValue {
                          let value: any = modelValue;
                  
                          for (const operator of this.controlValueOperators) {
                              value = isFunctionLike(operator.toViewValue) ? operator.toViewValue(value) : value;
                  Severity: Major
                  Found in libs/cdk/forms/src/control-value-interceptor.ts and 1 other location - About 2 hrs to fix
                  libs/cdk/forms/src/control-value-interceptor.ts on lines 45..53

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 87.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Severity
                  Category
                  Status
                  Source
                  Language