Angular-RU/angular-ru-sdk

View on GitHub

Showing 347 of 347 total issues

File table-builder.component.ts has 699 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { CdkDragStart } from '@angular/cdk/drag-drop';
import {
    AfterContentInit,
    AfterViewChecked,
    AfterViewInit,
Severity: Major
Found in libs/cdk/virtual-table/src/table-builder.component.ts - About 1 day to fix

    TableBuilderComponent has 78 functions (exceeds 20 allowed). Consider refactoring.
    Open

    @Component({
        selector: 'ngx-table-builder',
        templateUrl: './table-builder.component.html',
        styleUrls: ['./table-builder.component.scss'],
        changeDetection: ChangeDetectionStrategy.OnPush,
    Severity: Major
    Found in libs/cdk/virtual-table/src/table-builder.component.ts - About 1 day to fix

      Function filterAllWorker has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
      Open

      export function filterAllWorker<T>({ source, global, types, columns }: FilterableMessage<T>): T[] {
          const INTERVAL_ARRAY_SIZE: number = 2;
          const PLAIN_TYPES: Set<string> = new Set(['number', 'string', 'boolean']);
          const { value: globalOperand, type: globalFilterType }: FilterGlobalOptions = global;
          let result: T[] = source;
      Severity: Minor
      Found in libs/cdk/virtual-table/src/services/filterable/filter.worker.ts - About 1 day 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 exportExcelByWorkbook has 206 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public async exportExcelByWorkbook<T>(workbook: ExcelWorkbook<T>): Promise<void> {
              const preparedWorkbook: PreparedExcelWorkbook<T> = await this.prepareWorkbook(workbook);
      
              this.webWorker
                  // eslint-disable-next-line max-lines-per-function,sonarjs/cognitive-complexity
      Severity: Major
      Found in libs/cdk/excel/src/excel-builder.service.ts - About 1 day to fix

        Function sortWorker has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
        Open

        export function sortWorker<T>(message: SortableMessage<T>): T[] {
            // eslint-disable-next-line
            enum OrderType {
                DESC = 'desc',
                SKIP = 'skip'
        Severity: Minor
        Found in libs/cdk/virtual-table/src/services/sortable/sort.worker.ts - About 6 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

        AbstractTableBuilderApiDirective has 47 functions (exceeds 20 allowed). Consider refactoring.
        Open

        @Directive()
        export abstract class AbstractTableBuilderApiDirective<T>
            implements OnChanges, OnInit, AfterViewInit, AfterContentInit, AfterViewChecked, OnDestroy
        {
            public abstract readonly templateParser: TemplateParserService<T>;
        Severity: Minor
        Found in libs/cdk/virtual-table/src/abstract-table-builder-api.directive.ts - About 6 hrs to fix

          AbstractNgxsDataEntityCollectionsRepository has 45 functions (exceeds 20 allowed). Consider refactoring.
          Open

          @Injectable()
          export abstract class AbstractNgxsDataEntityCollectionsRepository<
                  V,
                  K extends number | string = EntityIdType,
                  C = Record<string, any>

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

                    this.trace
                        .group('A')
                        .pipe(
                            ({ trace }: LoggerService) => trace(this.traceIsWork),
                            ({ debug }: LoggerService) => debug(this.debugIsWork),
            Severity: Major
            Found in apps/logger-demo/src/app.component.ts and 1 other location - About 5 hrs to fix
            apps/logger-demo/src/app.component.ts on lines 92..101

            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 150.

            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 2 locations. Consider refactoring.
            Open

                    this.logger
                        .group('A')
                        .pipe(
                            ({ trace }: LoggerService) => trace(this.traceIsWork),
                            ({ debug }: LoggerService) => debug(this.debugIsWork),
            Severity: Major
            Found in apps/logger-demo/src/app.component.ts and 1 other location - About 5 hrs to fix
            apps/logger-demo/src/app.component.ts on lines 163..172

            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 150.

            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 2 locations. Consider refactoring.
            Open

            export function RequestParam(name: string): ParameterDecorator {
                return (target: any, methodName: string | symbol, parameterIndex: number): void => {
                    const key: string = name.trim();
            
                    if (!key) {
            Severity: Major
            Found in libs/cdk/http/decorators/src/request-param.decorator.ts and 1 other location - About 5 hrs to fix
            libs/cdk/http/decorators/src/path-variable.decorator.ts on lines 8..21

            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 149.

            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 2 locations. Consider refactoring.
            Open

            export function PathVariable(name: string): ParameterDecorator {
                return (target: any, methodName: string | symbol, parameterIndex: number): void => {
                    const key: string = name.trim();
            
                    if (!key) {
            Severity: Major
            Found in libs/cdk/http/decorators/src/path-variable.decorator.ts and 1 other location - About 5 hrs to fix
            libs/cdk/http/decorators/src/request-param.decorator.ts on lines 8..21

            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 149.

            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 roundOff has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
            Open

            export function roundOff(input: number | string, n: number = 0, mode = RoundingModes.HALF_EVEN): any {
                if (mode === RoundingModes.UNNECESSARY) {
                    throw new Error('UNNECESSARY Rounding Mode has not yet been implemented');
                }
            
            
            Severity: Minor
            Found in libs/cdk/big-decimal/src/js-big-decimal/round.ts - About 5 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

            File abstract-table-builder-api.directive.ts has 385 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /* eslint-disable @angular-eslint/no-input-rename */
            import { CdkDragSortEvent } from '@angular/cdk/drag-drop';
            import {
                AfterContentInit,
                AfterViewChecked,
            Severity: Minor
            Found in libs/cdk/virtual-table/src/abstract-table-builder-api.directive.ts - About 5 hrs to fix

              Identical blocks of code found in 3 locations. Consider refactoring.
              Open

              export class AppRoutingModule {}
              Severity: Major
              Found in apps/tooltip-demo/src/app-routing.module.ts and 2 other locations - About 5 hrs to fix
              apps/cdk-demo/src/app-routing.module.ts on lines 34..34
              apps/http-demo/src/app-routing.module.ts on lines 34..34

              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 135.

              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

              Identical blocks of code found in 3 locations. Consider refactoring.
              Open

              export class AppRoutingModule {}
              Severity: Major
              Found in apps/cdk-demo/src/app-routing.module.ts and 2 other locations - About 5 hrs to fix
              apps/http-demo/src/app-routing.module.ts on lines 34..34
              apps/tooltip-demo/src/app-routing.module.ts on lines 34..34

              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 135.

              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

              Identical blocks of code found in 3 locations. Consider refactoring.
              Open

              export class AppRoutingModule {}
              Severity: Major
              Found in apps/http-demo/src/app-routing.module.ts and 2 other locations - About 5 hrs to fix
              apps/cdk-demo/src/app-routing.module.ts on lines 34..34
              apps/tooltip-demo/src/app-routing.module.ts on lines 34..34

              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 135.

              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 2 locations. Consider refactoring.
              Open

              export function Payload(name: string): StateArgumentDecorator {
                  return (stateClass: Record<any, any>, methodName: string | symbol, parameterIndex: number): void => {
                      const key: string = name.trim();
              
                      if (!key) {
              Severity: Major
              Found in libs/ngxs/decorators/src/payload/payload.ts and 1 other location - About 4 hrs to fix
              libs/ngxs/decorators/src/named/named.ts on lines 5..17

              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 132.

              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 2 locations. Consider refactoring.
              Open

              export function Named(name: string): StateArgumentDecorator {
                  return (stateClass: Record<any, any>, methodName: string | symbol, parameterIndex: number): void => {
                      const key: string = name.trim();
              
                      if (!key) {
              Severity: Major
              Found in libs/ngxs/decorators/src/named/named.ts and 1 other location - About 4 hrs to fix
              libs/ngxs/decorators/src/payload/payload.ts on lines 5..17

              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 132.

              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

              export function Patch<T>(
                  path: string = '/',
                  emitOptions: EmitOptions = { emitFailure: true, emitSuccess: true }
              ): MethodDecorator {
                  return (target: any & DataHttpClient, _name: string | symbol, descriptor: Descriptor): Descriptor =>
              Severity: Major
              Found in libs/cdk/http/decorators/src/patch.decorator.ts and 4 other locations - About 4 hrs to fix
              libs/cdk/http/decorators/src/delete.decorator.ts on lines 7..13
              libs/cdk/http/decorators/src/get.decorator.ts on lines 7..13
              libs/cdk/http/decorators/src/post.decorator.ts on lines 7..13
              libs/cdk/http/decorators/src/put.decorator.ts on lines 7..13

              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 129.

              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

              export function Put<T>(
                  path: string = '/',
                  emitOptions: EmitOptions = { emitFailure: true, emitSuccess: true }
              ): MethodDecorator {
                  return (target: any & DataHttpClient, _name: string | symbol, descriptor: Descriptor): Descriptor =>
              Severity: Major
              Found in libs/cdk/http/decorators/src/put.decorator.ts and 4 other locations - About 4 hrs to fix
              libs/cdk/http/decorators/src/delete.decorator.ts on lines 7..13
              libs/cdk/http/decorators/src/get.decorator.ts on lines 7..13
              libs/cdk/http/decorators/src/patch.decorator.ts on lines 7..13
              libs/cdk/http/decorators/src/post.decorator.ts on lines 7..13

              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 129.

              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