swimlane/ngx-ui

View on GitHub
cypress/e2e/forms/inputs.cy.ts

Summary

Maintainability
D
3 days
Test Coverage

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

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

          cy.get('@CUT')
            .find('.ngx-input-underline .underline-fill')
            .should(el => {
              expect(el).to.have.attr('style');
              expect(Cypress.$(el).attr('style')).to.match(/.*width:\s*0%.*/);
    Severity: Major
    Found in cypress/e2e/forms/inputs.cy.ts and 1 other location - About 2 hrs to fix
    cypress/e2e/forms/inputs.cy.ts on lines 117..122

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

    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('@CUT')
            .find('.ngx-input-underline .underline-fill')
            .should(el => {
              expect(el).to.have.attr('style');
              expect(Cypress.$(el).attr('style')).to.match(/.*width:\s*0%.*/);
    Severity: Major
    Found in cypress/e2e/forms/inputs.cy.ts and 1 other location - About 2 hrs to fix
    cypress/e2e/forms/inputs.cy.ts on lines 154..159

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

    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('@CUT')
            .find('.ngx-input-underline .underline-fill')
            .should(el => {
              expect(el).to.have.attr('style');
              expect(Cypress.$(el).attr('style')).to.match(/.*width:\s*100%.*/);
    Severity: Major
    Found in cypress/e2e/forms/inputs.cy.ts and 1 other location - About 2 hrs to fix
    cypress/e2e/forms/inputs.cy.ts on lines 165..170

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

    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('@CUT')
            .find('.ngx-input-underline .underline-fill')
            .should(el => {
              expect(el).to.have.attr('style');
              expect(Cypress.$(el).attr('style')).to.match(/.*width:\s*100%.*/);
    Severity: Major
    Found in cypress/e2e/forms/inputs.cy.ts and 1 other location - About 2 hrs to fix
    cypress/e2e/forms/inputs.cy.ts on lines 128..133

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

    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 show visibility icon when unlocked', () => {
          cy.get('@CUT').find('.ngx-lock').should('not.exist');
          cy.get('@CUT').find('.ngx-eye').should('exist');
        });
    Severity: Major
    Found in cypress/e2e/forms/inputs.cy.ts and 1 other location - About 1 hr to fix
    cypress/e2e/forms/inputs.cy.ts on lines 359..362

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

    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 show lock icon when locked', () => {
          cy.get('@CUT').find('.ngx-lock').should('exist');
          cy.get('@CUT').find('.ngx-eye').should('not.exist');
        });
    Severity: Major
    Found in cypress/e2e/forms/inputs.cy.ts and 1 other location - About 1 hr to fix
    cypress/e2e/forms/inputs.cy.ts on lines 370..373

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

    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

        it('enters text', () => {
          const text = ' hello world';
    
          cy.get('@CUT').ngxFill(text);
    
    
    Severity: Major
    Found in cypress/e2e/forms/inputs.cy.ts and 3 other locations - About 1 hr to fix
    cypress/e2e/forms/inputs.cy.ts on lines 276..281
    cypress/e2e/forms/inputs.cy.ts on lines 301..306
    cypress/e2e/forms/inputs.cy.ts on lines 308..313

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

    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

        it('should allow input', () => {
          const text = '>vQ9~4W$%ag!ACe$';
    
          cy.get('@CUT').ngxFill(text);
          cy.get('@CUT').ngxGetValue().should('equal', text);
    Severity: Major
    Found in cypress/e2e/forms/inputs.cy.ts and 3 other locations - About 1 hr to fix
    cypress/e2e/forms/inputs.cy.ts on lines 108..114
    cypress/e2e/forms/inputs.cy.ts on lines 301..306
    cypress/e2e/forms/inputs.cy.ts on lines 308..313

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

    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

        it('should allow input', () => {
          const text = '42';
    
          cy.get('@CUT').ngxFill(text);
          cy.get('@CUT').ngxGetValue().should('equal', text);
    Severity: Major
    Found in cypress/e2e/forms/inputs.cy.ts and 3 other locations - About 1 hr to fix
    cypress/e2e/forms/inputs.cy.ts on lines 108..114
    cypress/e2e/forms/inputs.cy.ts on lines 276..281
    cypress/e2e/forms/inputs.cy.ts on lines 308..313

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

    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

        it('should allow exponential notation input', () => {
          const text = '4.1e-2';
    
          cy.get('@CUT').ngxFill(text);
          cy.get('@CUT').ngxGetValue().should('equal', text);
    Severity: Major
    Found in cypress/e2e/forms/inputs.cy.ts and 3 other locations - About 1 hr to fix
    cypress/e2e/forms/inputs.cy.ts on lines 108..114
    cypress/e2e/forms/inputs.cy.ts on lines 276..281
    cypress/e2e/forms/inputs.cy.ts on lines 301..306

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

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

      before(() => {
        cy.visit('/inputs');
        cy.injectAxe();
        cy.get('.page-loader').should('not.exist', { timeout: 20000 });
      });
    Severity: Major
    Found in cypress/e2e/forms/inputs.cy.ts and 7 other locations - About 1 hr to fix
    cypress/e2e/components/calendar.cy.ts on lines 10..14
    cypress/e2e/components/sections.cy.ts on lines 2..6
    cypress/e2e/components/tabs.cy.ts on lines 2..6
    cypress/e2e/forms/checkbox.cy.ts on lines 2..6
    cypress/e2e/forms/date-inputs.cy.ts on lines 7..11
    cypress/e2e/forms/radio.cy.ts on lines 2..6
    cypress/e2e/forms/selects.cy.ts on lines 2..6

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

    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

    There are no issues that match your filters.

    Category
    Status