binary-com/binary-next-gen

View on GitHub
src/upgrade/__tests__/upgradeToMaltainvestCard-test.js

Summary

Maintainability
F
3 days
Test Coverage

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

  it('First name should have error when input is not valid', () => {
    const wrapper = mountWithIntl(<UpgradeToMaltainvestCard {...PROPS} />);
    const firstName = wrapper.find('#first_name').hostNodes();
    firstName.instance().value = 'abcd#$';
    wrapper.update();
Severity: Major
Found in src/upgrade/__tests__/upgradeToMaltainvestCard-test.js and 5 other locations - About 4 hrs to fix
src/settings/__tests__/settingsUserInformation-test.js on lines 49..58
src/settings/__tests__/settingsUserInformation-test.js on lines 82..91
src/settings/__tests__/settingsUserInformation-test.js on lines 104..113
src/settings/__tests__/settingsUserInformation-test.js on lines 126..135
src/upgrade/__tests__/upgradeToRealCard-test.js on lines 73..82

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

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

  it('First name should be valid when input is valid', () => {
    const wrapper = mountWithIntl(<UpgradeToMaltainvestCard {...PROPS} />);
    const firstName = wrapper.find('#first_name').hostNodes();
    firstName.instance().value = 'abcdefg';
    wrapper.update();
Severity: Major
Found in src/upgrade/__tests__/upgradeToMaltainvestCard-test.js and 5 other locations - About 4 hrs to fix
src/settings/__tests__/settingsUserInformation-test.js on lines 38..47
src/settings/__tests__/settingsUserInformation-test.js on lines 71..80
src/settings/__tests__/settingsUserInformation-test.js on lines 93..102
src/settings/__tests__/settingsUserInformation-test.js on lines 115..124
src/upgrade/__tests__/upgradeToRealCard-test.js on lines 62..71

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

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

  const PROPS = {
    residenceList: [{
      phone_idd: '260',
      text: 'Zambia',
      value: 'zm'
Severity: Major
Found in src/upgrade/__tests__/upgradeToMaltainvestCard-test.js and 1 other location - About 4 hrs to fix
src/upgrade/__tests__/upgradeToRealCard-test.js on lines 6..40

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

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

  it('phone should be empty in form when country is not passed in props', () => {
    const wrapper = mountWithIntl(<UpgradeToMaltainvestCard {...PROPS} />);
    wrapper.setProps({ first_name: 'abc' });
    const phoneObj = wrapper.find('#phone').hostNodes();
    const phone = phoneObj.instance().value;
Severity: Major
Found in src/upgrade/__tests__/upgradeToMaltainvestCard-test.js and 2 other locations - About 3 hrs to fix
src/settings/__tests__/settingsUserInformation-test.js on lines 147..154
src/upgrade/__tests__/upgradeToRealCard-test.js on lines 94..101

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

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

  it('phone should be phone_idd for the country code in residenceList', () => {
    const country_code = 'zm';
    const wrapper = mountWithIntl(<UpgradeToMaltainvestCard {...PROPS} />);
    wrapper.setProps({ country_code });
    const formData = wrapper.state('formData');
Severity: Major
Found in src/upgrade/__tests__/upgradeToMaltainvestCard-test.js and 2 other locations - About 3 hrs to fix
src/settings/__tests__/settingsUserInformation-test.js on lines 137..145
src/upgrade/__tests__/upgradeToRealCard-test.js on lines 84..92

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

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('Secret Question should be hidden when loginid has not VRTC', () => {
    const wrapper = mountWithIntl(<UpgradeToMaltainvestCard {...PROPS} />);
    wrapper.setProps({ loginid: 'MLT12345' });
    const secretQuestion = wrapper.find('#secret_question').hostNodes();

Severity: Major
Found in src/upgrade/__tests__/upgradeToMaltainvestCard-test.js and 1 other location - About 2 hrs to fix
src/upgrade/__tests__/upgradeToMaltainvestCard-test.js on lines 96..102

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('Secret Question should be visible when loginid has VRTC', () => {
    const wrapper = mountWithIntl(<UpgradeToMaltainvestCard {...PROPS} />);
    wrapper.setProps({ loginid: 'VRTC12345' });
    const secretQuestion = wrapper.find('#secret_question').hostNodes();

Severity: Major
Found in src/upgrade/__tests__/upgradeToMaltainvestCard-test.js and 1 other location - About 2 hrs to fix
src/upgrade/__tests__/upgradeToMaltainvestCard-test.js on lines 104..110

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

  it('First Name should exist', () => {
    const wrapper = mountWithIntl(<UpgradeToMaltainvestCard {...PROPS} />);
    const firstName = wrapper.find('#first_name').hostNodes();

    expect(firstName.length).toEqual(1);
Severity: Major
Found in src/upgrade/__tests__/upgradeToMaltainvestCard-test.js and 3 other locations - About 1 hr to fix
src/upgrade/__tests__/upgradeToMaltainvestCard-test.js on lines 48..53
src/upgrade/__tests__/upgradeToRealCard-test.js on lines 48..53
src/upgrade/__tests__/upgradeToRealCard-test.js on lines 55..60

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

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('First Name should exist', () => {
    const wrapper = mountWithIntl(<UpgradeToMaltainvestCard {...PROPS} />);
    const firstName = wrapper.find('#first_name').hostNodes();

    expect(firstName.length).toEqual(1);
Severity: Major
Found in src/upgrade/__tests__/upgradeToMaltainvestCard-test.js and 3 other locations - About 1 hr to fix
src/upgrade/__tests__/upgradeToMaltainvestCard-test.js on lines 55..60
src/upgrade/__tests__/upgradeToRealCard-test.js on lines 48..53
src/upgrade/__tests__/upgradeToRealCard-test.js on lines 55..60

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

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

  it('Component should be rendered', () => {
    const wrapper = mountWithIntl(<UpgradeToMaltainvestCard {...PROPS} />);

    expect(wrapper.type()).toBeDefined();
  });
Severity: Major
Found in src/upgrade/__tests__/upgradeToMaltainvestCard-test.js and 2 other locations - About 55 mins to fix
src/set-currency/__tests__/setCurrencyCard-test.js on lines 10..14
src/upgrade/__tests__/upgradeToRealCard-test.js on lines 42..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 54.

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