swimlane/ngx-ui

View on GitHub

Showing 139 of 731 total issues

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

@Directive({
  selector: '[ngx-tooltip]',
  exportAs: 'ngxTooltip'
})
export class TooltipDirective implements OnDestroy {

    Function value has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

      @Input()
      set value(val: Date | string) {
        if (typeof val === 'string') {
          val = val.trim();
        }

    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

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

    @Component({
      exportAs: 'ngxSelectDropdown',
      selector: 'ngx-select-dropdown',
      templateUrl: './select-dropdown.component.html',
      host: {

      File object-node.component.ts has 289 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import {
        Input,
        EventEmitter,
        Output,
        OnInit,

        File app.component.ts has 287 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { Component, ViewEncapsulation } from '@angular/core';
        import { Event, NavigationEnd, NavigationStart, Router } from '@angular/router';
        import { DrawerService, LoadingService } from '@swimlane/ngx-ui';
        import * as Prism from 'prismjs';
        import 'prismjs/plugins/custom-class/prism-custom-class';
        Severity: Minor
        Found in src/app/app.component.ts - About 2 hrs to fix

          File inputs.cy.ts has 278 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          describe('Inputs', () => {
            before(() => {
              cy.visit('/inputs');
              cy.injectAxe();
              cy.get('.page-loader').should('not.exist', { timeout: 20000 });
          Severity: Minor
          Found in cypress/e2e/forms/inputs.cy.ts - About 2 hrs to fix

            File functions.ts has 274 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            // eslint-disable-next-line @typescript-eslint/triple-slash-reference
            /// <reference path='./commands.d.ts'/>
            
            export const enum NGX {
              CODEMIRROR = 'ngx-codemirror',
            Severity: Minor
            Found in projects/swimlane/ngx-ui-testing/src/functions.ts - About 2 hrs to fix

              File input.component.spec.ts has 270 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
              import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
              import { FormsModule, FormControl } from '@angular/forms';
              import { By } from '@angular/platform-browser';
              import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

                ButtonToggleGroupComponent has 22 functions (exceeds 20 allowed). Consider refactoring.
                Open

                @Component({
                  selector: 'ngx-button-toggle-group',
                  templateUrl: './button-toggle-group.component.html',
                  styleUrls: ['./button-toggle-group.component.scss'],
                  providers: [BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR],

                  SliderComponent has 22 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  @Component({
                    selector: 'ngx-slider',
                    exportAs: 'ngxSlider',
                    templateUrl: './slider.component.html',
                    encapsulation: ViewEncapsulation.None,

                    Function inferType has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function inferType(value: any, overrides?: any, allowedTypes?: string[]): any {
                      if (overrides) {
                        for (const typeName in overrides) {
                          if (allowedTypes !== undefined && !allowedTypes.includes(typeName)) {
                            continue;

                    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 select-dropdown.component.ts has 260 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import { coerceNumberProperty } from '@angular/cdk/coercion';
                    import {
                      AfterViewInit,
                      ChangeDetectionStrategy,
                      ChangeDetectorRef,

                      Function onDayDown has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        onDayDown(event: KeyboardEvent) {
                          // console.log(event.code);
                      
                          let stop = false;
                      
                      

                        DropdownComponent has 21 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        @Component({
                          exportAs: 'ngxDropdown',
                          selector: 'ngx-dropdown',
                          template: '<ng-content></ng-content>',
                          styleUrls: ['./dropdown.component.scss'],

                          SelectInputComponent has 21 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          @Component({
                            exportAs: 'ngxSelectInput',
                            selector: 'ngx-select-input',
                            templateUrl: './select-input.component.html',
                            host: {

                            CodeEditorComponent has 21 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            @Component({
                              exportAs: 'ngxCodemirror',
                              selector: 'ngx-codemirror',
                              providers: [CODEMIRROR_VALUE_ACCESSOR],
                              host: { class: 'ngx-codemirror' },

                              Function compileCss has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                new Promise((resolve, reject) => {
                                  console.log('Compiling index.css...');
                                  fs.readFile('dist/swimlane/ngx-ui/lib/styles/index.scss', (err, data) => {
                                    if (err) {
                                      return reject(err);
                              Severity: Major
                              Found in scripts/prep-global-styles.js - About 2 hrs to fix

                                Function defaultDisplayFormat has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                                Open

                                export function defaultDisplayFormat(
                                  displayMode: DATE_DISPLAY_TYPES,
                                  inputType: DateTimeType,
                                  precision: unitOfTime.StartOf
                                ) {

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

                                  onDayDown(event: KeyboardEvent) {
                                    // console.log(event.code);
                                
                                    let stop = false;
                                
                                

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

                                  createSubscriptions(component: ComponentRef<DrawerComponent>, isRoot = true, parentContainer?) {
                                    if (isRoot) {
                                      this.overlayService.show({
                                        triggerComponent: component,
                                        zIndex: this.zIndex
                                Severity: Minor
                                Found in projects/swimlane/ngx-ui/src/lib/components/drawer/drawer.service.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

                                Severity
                                Category
                                Status
                                Source
                                Language