swimlane/ngx-ui

View on GitHub

Showing 731 of 731 total issues

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

    it('should allow modifying the property title', () => {
      cy.get('ngx-property-config').as('propertyConfig');
      cy.get('@propertyConfig').within(() => {
        cy.get('div.header>span').should('have.text', 'Property Configuration');
        cy.get('ngx-input').first().should('exist').ngxFill('obj_1');
Severity: Major
Found in cypress/e2e/components/json-editor.cy.ts and 1 other location - About 1 day to fix
cypress/e2e/components/json-editor.cy.ts on lines 521..534

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

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('onContextmenu', () => {
      it('should not toggle by default', () => {
        debugElement.triggerEventHandler('contextmenu', { preventDefault: () => undefined });
        expect(spy).not.toHaveBeenCalled();
      });
projects/swimlane/ngx-ui/src/lib/components/dropdown/dropdown-toggle.directive.spec.ts on lines 55..73

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

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('onDblClick', () => {
      it('should not toggle by default', () => {
        debugElement.triggerEventHandler('dblclick', { preventDefault: () => undefined });
        expect(spy).not.toHaveBeenCalled();
      });
projects/swimlane/ngx-ui/src/lib/components/dropdown/dropdown-toggle.directive.spec.ts on lines 75..93

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

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

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

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

          it("should update hours, set 12 PM doesn't change day", () => {
            expect(component.dialogModel).toBeTruthy();
            expect(moment.isMoment(component.dialogModel)).toBeTruthy();
      
            component.hourChanged(12);
      projects/swimlane/ngx-ui/src/lib/components/date-time/date-time.component.spec.ts on lines 463..476

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

      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 update hours', () => {
            expect(component.dialogModel).toBeTruthy();
            expect(moment.isMoment(component.dialogModel)).toBeTruthy();
      
            component.hourChanged(11);
      projects/swimlane/ngx-ui/src/lib/components/date-time/date-time.component.spec.ts on lines 548..561

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

      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

        onClick(msg: string, targetId?: string, successProbability = 0.5) {
          this.onBtnClick(msg);
      
          const buttonPromise = new Promise((resolve, reject) => {
            setTimeout(() => {
      Severity: Major
      Found in src/app/forms/buttons-page/buttons-page.component.ts and 1 other location - About 7 hrs to fix
      src/app/components/button-group-page/button-group-page.component.ts on lines 16..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 189.

      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

        onClick(msg: string, targetId?: string, successProbability = 0.5) {
          this.onBtnClick(msg);
      
          const buttonPromise = new Promise((resolve, reject) => {
            setTimeout(() => {
      src/app/forms/buttons-page/buttons-page.component.ts on lines 32..58

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

      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

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

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

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

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

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

        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 class ChildDrawerComponent {
          @Output() dismiss = new EventEmitter();
        
          @ViewChild('childDrawer', { static: true }) grandChildDrawer: TemplateRef<unknown>;
        
        
        src/app/dialogs/dialog-large-format-page/components/parent-drawer.component.ts on lines 102..119

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

        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 class ParentDrawerComponent {
          @Output() dismiss = new EventEmitter();
        
          @ViewChild('childDrawer', { static: true }) childDrawer: TemplateRef<unknown>;
        
        
        src/app/dialogs/dialog-large-format-page/components/child-drawer.component.ts on lines 181..198

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

        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('.ngx-select-dropdown-options li li').within(() => {
                  cy.root().first().should('not.have.class', 'active'); // not active
                  cy.root().last().should('have.class', 'active'); // active
        
                  cy.realPress('ArrowUp');
        Severity: Major
        Found in cypress/e2e/forms/selects.cy.ts and 1 other location - About 7 hrs to fix
        cypress/e2e/forms/selects.cy.ts on lines 120..130

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

        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

        Cypress.Commands.add('getByLabel', (label: string, options: Partial<Cypress.Loggable & Cypress.Withinable>) => {
          options = {
            log: true,
            withinSubject: cy['state']('withinSubject'),
            ...options
        Severity: Major
        Found in projects/swimlane/ngx-ui-testing/src/commands.ts and 1 other location - About 7 hrs to fix
        projects/swimlane/ngx-ui-testing/src/commands.ts on lines 71..96

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

        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

        Cypress.Commands.add('getByPlaceholder', (text: string, options: Partial<Cypress.Loggable & Cypress.Withinable>) => {
          options = {
            log: true,
            withinSubject: cy['state']('withinSubject'),
            ...options
        Severity: Major
        Found in projects/swimlane/ngx-ui-testing/src/commands.ts and 1 other location - About 7 hrs to fix
        projects/swimlane/ngx-ui-testing/src/commands.ts on lines 41..66

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

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

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

            describe('left', () => {
              it('should flip placement left', () => {
                spyOnProperty(window, 'innerWidth').and.returnValue(0);
                expect(
                  shouldFlip(
          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 60..85
          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

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

            describe('right', () => {
              it('should flip placement right', () => {
                spyOnProperty(window, 'innerWidth').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 60..85
          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

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

            describe('bottom', () => {
              it('should flip placement bottom', () => {
                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 60..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 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

          Severity
          Category
          Status
          Source
          Language