swimlane/ngx-ui

View on GitHub

Showing 139 of 731 total issues

File date-time.component.spec.ts has 670 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { NO_ERRORS_SCHEMA } from '@angular/core';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';

import moment from 'moment-timezone';
import { MomentModule } from 'ngx-moment';

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

    import {
      Component,
      Input,
      Output,
      EventEmitter,

      InputComponent has 59 functions (exceeds 20 allowed). Consider refactoring.
      Open

      @Component({
        exportAs: 'ngxInput',
        selector: 'ngx-input',
        templateUrl: './input.component.html',
        styleUrls: ['./input.component.scss'],
      Severity: Major
      Found in projects/swimlane/ngx-ui/src/lib/components/input/input.component.ts - About 1 day to fix

        File json-editor.cy.ts has 504 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        describe('Json Editor', () => {
          before(() => {
            cy.visit('/json-editor');
            cy.get('.page-loader').should('not.exist', { timeout: 20000 });
          });
        Severity: Major
        Found in cypress/e2e/components/json-editor.cy.ts - About 1 day to fix

          CalendarComponent has 54 functions (exceeds 20 allowed). Consider refactoring.
          Open

          @Component({
            selector: 'ngx-calendar',
            exportAs: 'ngxCalendar',
            templateUrl: './calendar.component.html',
            styleUrls: ['./calendar.component.scss'],

            File commands.ts has 477 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import {
              fillValue,
              findInput,
              findLabel,
              getValue,
            Severity: Minor
            Found in projects/swimlane/ngx-ui-testing/src/commands.ts - About 7 hrs to fix

              File date-time.component.ts has 470 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import {
                Component,
                Input,
                Output,
                EventEmitter,

                File time-display.component.spec.ts has 462 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
                import { NO_ERRORS_SCHEMA } from '@angular/core';
                import { ClipboardModule } from '@angular/cdk/clipboard';
                
                import { NgxTimeDisplayComponent as TestComponent } from './time-display.component';

                  DateTimeComponent has 48 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  @Component({
                    exportAs: 'ngxDateTime',
                    selector: 'ngx-date-time',
                    templateUrl: './date-time.component.html',
                    styleUrls: ['./date-time.component.scss'],

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

                    import {
                      AfterViewInit,
                      OnDestroy,
                      Component,
                      ElementRef,
                    Severity: Minor
                    Found in projects/swimlane/ngx-ui/src/lib/components/input/input.component.ts - About 5 hrs to fix

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

                      import {
                        ChangeDetectionStrategy,
                        ChangeDetectorRef,
                        Component,
                        ContentChildren,

                        SelectComponent has 38 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        @Component({
                          exportAs: 'ngxSelect',
                          selector: 'ngx-select',
                          templateUrl: './select.component.html',
                          styleUrls: ['./select.component.scss'],

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

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

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

                            import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
                            import { NO_ERRORS_SCHEMA } from '@angular/core';
                            
                            import { MomentModule } from 'ngx-moment';
                            import moment from 'moment-timezone';

                              Function indexProperties has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                              Open

                                indexProperties(): void {
                                  const props = this.schemaBuilderMode ? this.schemaRef.properties : this.model;
                              
                                  for (const prop in props) {
                                    if (this.isIndexed(prop)) {

                              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

                              RadioButtonGroupComponent has 34 functions (exceeds 20 allowed). Consider refactoring.
                              Open

                              @Component({
                                exportAs: 'ngxRadiobuttonGroup',
                                selector: 'ngx-radiobutton-group',
                                providers: [RADIOGROUP_VALUE_ACCESSOR],
                                template: ' <ng-content></ng-content> ',

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

                                import { ComponentFixture, TestBed } from '@angular/core/testing';
                                import { NO_ERRORS_SCHEMA } from '@angular/core';
                                import { FormsModule } from '@angular/forms';
                                
                                import { KeyboardKeys } from '../../enums/keyboard-keys.enum';

                                  File select-dropdown.component.spec.ts has 327 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  import { ComponentFixture, TestBed, flush, fakeAsync } from '@angular/core/testing';
                                  import { NO_ERRORS_SCHEMA, ElementRef } from '@angular/core';
                                  import * as faker from 'faker/locale/en';
                                  
                                  import { KeyboardKeys } from '../../enums/keyboard-keys.enum';

                                    StepperComponent has 30 functions (exceeds 20 allowed). Consider refactoring.
                                    Open

                                    @Component({
                                      exportAs: 'ngxStepper',
                                      selector: 'ngx-stepper',
                                      templateUrl: './stepper.component.html',
                                      styleUrls: ['./stepper.component.scss'],

                                      Function addPackages has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export const addPackages = (options: Schema) => {
                                        return (tree: Tree, _context: SchematicContext) => {
                                          const ngCoreVersionTag = getPackageJsonDependency(tree, '@angular/core');
                                          // TODO: find appropriate angular version and then get the matching ngxUI
                                          const ngxUIVersion = getNgxUIVersion();
                                      Severity: Major
                                      Found in projects/swimlane/ngx-ui-schematics/src/ng-add/operations.ts - About 3 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language