Angular-RU/angular-ru-sdk

View on GitHub

Showing 112 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>

            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

              AmountFormatDirective has 35 functions (exceeds 20 allowed). Consider refactoring.
              Open

              @Directive({ selector: '[amountFormat]' })
              export class AmountFormatDirective implements OnInit, AfterViewInit, OnDestroy {
                  private readonly subscriptions: Subscription = new Subscription();
                  private previousLang: Nullable<string> = null;
                  private readonly maximumFractionDigits: number = 3;
              Severity: Minor
              Found in libs/cdk/directives/src/amount-format/amount-format.directive.ts - About 4 hrs to fix

                File ngxs-data-entity-collections.repository.ts has 336 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import { Injectable, isDevMode } from '@angular/core';
                import {
                    EmptyDictionary,
                    EntityCollections,
                    EntityComparator,

                  TooltipDirective has 32 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  @Directive({ selector: '[tooltip]' })
                  export class TooltipDirective implements OnDestroy {
                      private readonly delta: number = 2;
                      private readonly layoutMinDuration: number = 100;
                      private tooltipDomElement: Nullable<HTMLElement> = null;
                  Severity: Minor
                  Found in libs/cdk/tooltip/src/tooltip.directive.ts - About 4 hrs to fix

                    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

                        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
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language