swimlane/ngx-ui

View on GitHub

Showing 731 of 731 total issues

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

  describe('top', () => {
    it('should flip placement top', () => {
      spyOnProperty(window, 'innerHeight').and.returnValue(0);
      expect(
        shouldFlip(
projects/swimlane/ngx-ui/src/lib/utils/position/should-flip/should-flip.util.spec.ts on lines 6..31
projects/swimlane/ngx-ui/src/lib/utils/position/should-flip/should-flip.util.spec.ts on lines 33..58
projects/swimlane/ngx-ui/src/lib/utils/position/should-flip/should-flip.util.spec.ts on lines 87..112

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

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

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';

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

              cy.get('@jsonEditorFlat').within(() => {
                cy.get('.add-button')
                  .last()
                  .within(() => {
                    cy.get('ngx-dropdown').as('addPropDropdown').scrollIntoView().should('be.visible');
      Severity: Major
      Found in cypress/e2e/components/json-editor.cy.ts and 1 other location - About 6 hrs to fix
      cypress/e2e/components/json-editor.cy.ts on lines 508..517

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

      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

              cy.get('@jsonEditorFlat').within(() => {
                cy.get('.add-button')
                  .first()
                  .within(() => {
                    cy.get('ngx-dropdown').as('addPropDropdown').scrollIntoView().should('be.visible');
      Severity: Major
      Found in cypress/e2e/components/json-editor.cy.ts and 1 other location - About 6 hrs to fix
      cypress/e2e/components/json-editor.cy.ts on lines 477..486

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

      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

      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'],

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

            it('should have Default button', () => {
              cy.get('@SUT').within(() => {
                cy.clock();
                cy.get('ngx-button').contains('Default').parent('ngx-button').should('exist').as('CUT');
        
        
        Severity: Major
        Found in cypress/e2e/forms/buttons.cy.js and 1 other location - About 6 hrs to fix
        cypress/e2e/forms/buttons.cy.js on lines 118..128

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

        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

            it('should have Primary button', () => {
              cy.get('@SUT').within(() => {
                cy.clock();
                cy.get('ngx-button').contains('Primary').parent('ngx-button').should('exist').as('CUT');
        
        
        Severity: Major
        Found in cypress/e2e/forms/buttons.cy.js and 1 other location - About 6 hrs to fix
        cypress/e2e/forms/buttons.cy.js on lines 106..116

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

        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

          verticalBarTransition: trigger('stepperBarVerticalTransition', [
            state(
              StepperBarAnimationStates.Stay,
              style({
                transition: '500ms cubic-bezier(0.35, 0, 0.25, 1)',
        projects/swimlane/ngx-ui/src/lib/components/stepper/stepper.animation.ts on lines 24..46

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

        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

          horizontalBarTransition: trigger('stepperBarHorizontalTransition', [
            state(
              StepperBarAnimationStates.Stay,
              style({
                transition: '500ms cubic-bezier(0.35, 0, 0.25, 1)',
        projects/swimlane/ngx-ui/src/lib/components/stepper/stepper.animation.ts on lines 48..70

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

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

                cy.get('.ngx-select-dropdown-options li li').within(() => {
                  cy.root().first().should('have.class', 'active'); // active
                  cy.root().last().should('not.have.class', 'active'); // not active
        
                  cy.realPress('ArrowDown').realPress('ArrowDown');
        Severity: Major
        Found in cypress/e2e/forms/selects.cy.ts and 1 other location - About 6 hrs to fix
        cypress/e2e/forms/selects.cy.ts on lines 348..355

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

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

                cy.get('.ngx-select-dropdown-options li li').within(() => {
                  cy.root().first().should('have.class', 'active'); // active
                  cy.root().last().should('not.have.class', 'active'); // not active
        
                  cy.realPress('ArrowDown').realPress('ArrowDown');
        Severity: Major
        Found in cypress/e2e/forms/selects.cy.ts and 1 other location - About 6 hrs to fix
        cypress/e2e/forms/selects.cy.ts on lines 98..105

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

        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

          describe('onMouseEnter', () => {
            let spy: jasmine.Spy;
        
            beforeEach(() => {
              spy = spyOn(component.pause, 'emit');
        projects/swimlane/ngx-ui/src/lib/components/notification/notification.component.spec.ts on lines 67..85

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

        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

          describe('onMouseLeave', () => {
            let spy: jasmine.Spy;
        
            beforeEach(() => {
              spy = spyOn(component.resume, 'emit');
        projects/swimlane/ngx-ui/src/lib/components/notification/notification.component.spec.ts on lines 47..65

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

        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

        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

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

              if (type === 'start') {
                if (this.range.startDate) {
                  const hourClone = this.range.startDate.getHours();
                  if (newVal === 'AM' && this.startAmPmVal === 'PM') {
                    this.range.startDate.setHours(hourClone - 12);
          projects/swimlane/ngx-ui/src/lib/components/calendar/calendar.component.ts on lines 416..426

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

          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

              } else {
                if (this.range.endDate) {
                  const hourClone = this.range.endDate.getHours();
                  if (newVal === 'AM' && this.endAmPmVal === 'PM') {
                    this.range.endDate.setHours(hourClone - 12);
          projects/swimlane/ngx-ui/src/lib/components/calendar/calendar.component.ts on lines 406..416

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

          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

              it('sets value with click', () => {
                cy.get('@CUT').ngxGetValue().should('equal', false);
                cy.get('@CUT').find('input').should('have.attr', 'aria-checked', 'false');
          
                cy.get('@CUT').click();
          Severity: Major
          Found in cypress/e2e/forms/radio.cy.ts and 1 other location - About 5 hrs to fix
          cypress/e2e/forms/radio.cy.ts on lines 34..42

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

          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

              it('sets value with check', () => {
                cy.get('@CUT').ngxGetValue().should('equal', false);
                cy.get('@CUT').find('input').should('have.attr', 'aria-checked', 'false');
          
                cy.get('@CUT').check();
          Severity: Major
          Found in cypress/e2e/forms/radio.cy.ts and 1 other location - About 5 hrs to fix
          cypress/e2e/forms/radio.cy.ts on lines 24..32

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

          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

              it('should add hide listeners to component if exists without tooltipCloseOnMouseLeave', done => {
                const spy = spyOn(directive, 'addHideListeners').and.callThrough();
                spyOn(service, 'create').and.returnValue({
                  instance: {
                    element: {
          projects/swimlane/ngx-ui/src/lib/components/tooltip/tooltip.directive.spec.ts on lines 168..185

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

          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