SumOfUs/Champaign

View on GitHub
app/javascript/components/Form/FormField.test.tsx

Summary

Maintainability
F
6 days
Test Coverage

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

  test(`data_type: checkbox => <FormField .../>`, () => {
    const cnf = { ...config, data_type: 'checkbox' };
    const wrapper = shallow(<FormField {...cnf} />);
    const input = wrapper.children();

Severity: Major
Found in app/javascript/components/Form/FormField.test.tsx and 11 other locations - About 3 hrs to fix
app/javascript/components/Form/FormField.test.tsx on lines 36..43
app/javascript/components/Form/FormField.test.tsx on lines 45..52
app/javascript/components/Form/FormField.test.tsx on lines 54..61
app/javascript/components/Form/FormField.test.tsx on lines 63..70
app/javascript/components/Form/FormField.test.tsx on lines 72..79
app/javascript/components/Form/FormField.test.tsx on lines 81..88
app/javascript/components/Form/FormField.test.tsx on lines 90..97
app/javascript/components/Form/FormField.test.tsx on lines 108..115
app/javascript/components/Form/FormField.test.tsx on lines 117..124
app/javascript/components/Form/FormField.test.tsx on lines 126..133
app/javascript/components/Form/FormField.test.tsx on lines 135..142

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

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

  test(`data_type: hidden => <FormField .../>`, () => {
    const cnf = { ...config, data_type: 'hidden' };
    const wrapper = shallow(<FormField {...cnf} />);
    const input = wrapper.children();

Severity: Major
Found in app/javascript/components/Form/FormField.test.tsx and 11 other locations - About 3 hrs to fix
app/javascript/components/Form/FormField.test.tsx on lines 36..43
app/javascript/components/Form/FormField.test.tsx on lines 45..52
app/javascript/components/Form/FormField.test.tsx on lines 54..61
app/javascript/components/Form/FormField.test.tsx on lines 63..70
app/javascript/components/Form/FormField.test.tsx on lines 81..88
app/javascript/components/Form/FormField.test.tsx on lines 90..97
app/javascript/components/Form/FormField.test.tsx on lines 99..106
app/javascript/components/Form/FormField.test.tsx on lines 108..115
app/javascript/components/Form/FormField.test.tsx on lines 117..124
app/javascript/components/Form/FormField.test.tsx on lines 126..133
app/javascript/components/Form/FormField.test.tsx on lines 135..142

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

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

  test(`data_type: choice => <FormField .../>`, () => {
    const cnf = { ...config, data_type: 'choice' };
    const wrapper = shallow(<FormField {...cnf} />);
    const input = wrapper.children();

Severity: Major
Found in app/javascript/components/Form/FormField.test.tsx and 11 other locations - About 3 hrs to fix
app/javascript/components/Form/FormField.test.tsx on lines 36..43
app/javascript/components/Form/FormField.test.tsx on lines 45..52
app/javascript/components/Form/FormField.test.tsx on lines 54..61
app/javascript/components/Form/FormField.test.tsx on lines 63..70
app/javascript/components/Form/FormField.test.tsx on lines 72..79
app/javascript/components/Form/FormField.test.tsx on lines 81..88
app/javascript/components/Form/FormField.test.tsx on lines 90..97
app/javascript/components/Form/FormField.test.tsx on lines 99..106
app/javascript/components/Form/FormField.test.tsx on lines 117..124
app/javascript/components/Form/FormField.test.tsx on lines 126..133
app/javascript/components/Form/FormField.test.tsx on lines 135..142

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

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

  test(`data_type: select => <FormField .../>`, () => {
    const cnf = { ...config, data_type: 'select' };
    const wrapper = shallow(<FormField {...cnf} />);
    const input = wrapper.children();

Severity: Major
Found in app/javascript/components/Form/FormField.test.tsx and 11 other locations - About 3 hrs to fix
app/javascript/components/Form/FormField.test.tsx on lines 36..43
app/javascript/components/Form/FormField.test.tsx on lines 45..52
app/javascript/components/Form/FormField.test.tsx on lines 54..61
app/javascript/components/Form/FormField.test.tsx on lines 63..70
app/javascript/components/Form/FormField.test.tsx on lines 72..79
app/javascript/components/Form/FormField.test.tsx on lines 81..88
app/javascript/components/Form/FormField.test.tsx on lines 90..97
app/javascript/components/Form/FormField.test.tsx on lines 99..106
app/javascript/components/Form/FormField.test.tsx on lines 108..115
app/javascript/components/Form/FormField.test.tsx on lines 117..124
app/javascript/components/Form/FormField.test.tsx on lines 126..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 112.

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

  test(`data_type: paragraph => <FormField .../>`, () => {
    const cnf = { ...config, data_type: 'paragraph' };
    const wrapper = shallow(<FormField {...cnf} />);
    const input = wrapper.children();

Severity: Major
Found in app/javascript/components/Form/FormField.test.tsx and 11 other locations - About 3 hrs to fix
app/javascript/components/Form/FormField.test.tsx on lines 36..43
app/javascript/components/Form/FormField.test.tsx on lines 45..52
app/javascript/components/Form/FormField.test.tsx on lines 54..61
app/javascript/components/Form/FormField.test.tsx on lines 63..70
app/javascript/components/Form/FormField.test.tsx on lines 72..79
app/javascript/components/Form/FormField.test.tsx on lines 81..88
app/javascript/components/Form/FormField.test.tsx on lines 99..106
app/javascript/components/Form/FormField.test.tsx on lines 108..115
app/javascript/components/Form/FormField.test.tsx on lines 117..124
app/javascript/components/Form/FormField.test.tsx on lines 126..133
app/javascript/components/Form/FormField.test.tsx on lines 135..142

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

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

  test(`data_type: numeric => <FormField .../>`, () => {
    const cnf = { ...config, data_type: 'numeric' };
    const wrapper = shallow(<FormField {...cnf} />);
    const input = wrapper.children();

Severity: Major
Found in app/javascript/components/Form/FormField.test.tsx and 11 other locations - About 3 hrs to fix
app/javascript/components/Form/FormField.test.tsx on lines 36..43
app/javascript/components/Form/FormField.test.tsx on lines 54..61
app/javascript/components/Form/FormField.test.tsx on lines 63..70
app/javascript/components/Form/FormField.test.tsx on lines 72..79
app/javascript/components/Form/FormField.test.tsx on lines 81..88
app/javascript/components/Form/FormField.test.tsx on lines 90..97
app/javascript/components/Form/FormField.test.tsx on lines 99..106
app/javascript/components/Form/FormField.test.tsx on lines 108..115
app/javascript/components/Form/FormField.test.tsx on lines 117..124
app/javascript/components/Form/FormField.test.tsx on lines 126..133
app/javascript/components/Form/FormField.test.tsx on lines 135..142

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

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

  test(`data_type: instruction => <FormField .../>`, () => {
    const cnf = { ...config, data_type: 'instruction' };
    const wrapper = shallow(<FormField {...cnf} />);
    const input = wrapper.children();

Severity: Major
Found in app/javascript/components/Form/FormField.test.tsx and 11 other locations - About 3 hrs to fix
app/javascript/components/Form/FormField.test.tsx on lines 36..43
app/javascript/components/Form/FormField.test.tsx on lines 45..52
app/javascript/components/Form/FormField.test.tsx on lines 54..61
app/javascript/components/Form/FormField.test.tsx on lines 63..70
app/javascript/components/Form/FormField.test.tsx on lines 72..79
app/javascript/components/Form/FormField.test.tsx on lines 90..97
app/javascript/components/Form/FormField.test.tsx on lines 99..106
app/javascript/components/Form/FormField.test.tsx on lines 108..115
app/javascript/components/Form/FormField.test.tsx on lines 117..124
app/javascript/components/Form/FormField.test.tsx on lines 126..133
app/javascript/components/Form/FormField.test.tsx on lines 135..142

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

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

  test(`data_type: country => <FormField .../>`, () => {
    const cnf = { ...config, data_type: 'country' };
    const wrapper = shallow(<FormField {...cnf} />);
    const input = wrapper.children();

Severity: Major
Found in app/javascript/components/Form/FormField.test.tsx and 11 other locations - About 3 hrs to fix
app/javascript/components/Form/FormField.test.tsx on lines 36..43
app/javascript/components/Form/FormField.test.tsx on lines 45..52
app/javascript/components/Form/FormField.test.tsx on lines 54..61
app/javascript/components/Form/FormField.test.tsx on lines 63..70
app/javascript/components/Form/FormField.test.tsx on lines 72..79
app/javascript/components/Form/FormField.test.tsx on lines 81..88
app/javascript/components/Form/FormField.test.tsx on lines 90..97
app/javascript/components/Form/FormField.test.tsx on lines 99..106
app/javascript/components/Form/FormField.test.tsx on lines 108..115
app/javascript/components/Form/FormField.test.tsx on lines 126..133
app/javascript/components/Form/FormField.test.tsx on lines 135..142

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

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

  test(`data_type: phone => <FormField .../>`, () => {
    const cnf = { ...config, data_type: 'phone' };
    const wrapper = shallow(<FormField {...cnf} />);
    const input = wrapper.children();

Severity: Major
Found in app/javascript/components/Form/FormField.test.tsx and 11 other locations - About 3 hrs to fix
app/javascript/components/Form/FormField.test.tsx on lines 36..43
app/javascript/components/Form/FormField.test.tsx on lines 45..52
app/javascript/components/Form/FormField.test.tsx on lines 63..70
app/javascript/components/Form/FormField.test.tsx on lines 72..79
app/javascript/components/Form/FormField.test.tsx on lines 81..88
app/javascript/components/Form/FormField.test.tsx on lines 90..97
app/javascript/components/Form/FormField.test.tsx on lines 99..106
app/javascript/components/Form/FormField.test.tsx on lines 108..115
app/javascript/components/Form/FormField.test.tsx on lines 117..124
app/javascript/components/Form/FormField.test.tsx on lines 126..133
app/javascript/components/Form/FormField.test.tsx on lines 135..142

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

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

  test(`data_type: email => <FormField .../>`, () => {
    const cnf = { ...config, data_type: 'email' };
    const wrapper = shallow(<FormField {...cnf} />);
    const input = wrapper.children();

Severity: Major
Found in app/javascript/components/Form/FormField.test.tsx and 11 other locations - About 3 hrs to fix
app/javascript/components/Form/FormField.test.tsx on lines 45..52
app/javascript/components/Form/FormField.test.tsx on lines 54..61
app/javascript/components/Form/FormField.test.tsx on lines 63..70
app/javascript/components/Form/FormField.test.tsx on lines 72..79
app/javascript/components/Form/FormField.test.tsx on lines 81..88
app/javascript/components/Form/FormField.test.tsx on lines 90..97
app/javascript/components/Form/FormField.test.tsx on lines 99..106
app/javascript/components/Form/FormField.test.tsx on lines 108..115
app/javascript/components/Form/FormField.test.tsx on lines 117..124
app/javascript/components/Form/FormField.test.tsx on lines 126..133
app/javascript/components/Form/FormField.test.tsx on lines 135..142

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

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

  test(`data_type: dropdown => <FormField .../>`, () => {
    const cnf = { ...config, data_type: 'dropdown' };
    const wrapper = shallow(<FormField {...cnf} />);
    const input = wrapper.children();

Severity: Major
Found in app/javascript/components/Form/FormField.test.tsx and 11 other locations - About 3 hrs to fix
app/javascript/components/Form/FormField.test.tsx on lines 36..43
app/javascript/components/Form/FormField.test.tsx on lines 45..52
app/javascript/components/Form/FormField.test.tsx on lines 54..61
app/javascript/components/Form/FormField.test.tsx on lines 63..70
app/javascript/components/Form/FormField.test.tsx on lines 72..79
app/javascript/components/Form/FormField.test.tsx on lines 81..88
app/javascript/components/Form/FormField.test.tsx on lines 90..97
app/javascript/components/Form/FormField.test.tsx on lines 99..106
app/javascript/components/Form/FormField.test.tsx on lines 108..115
app/javascript/components/Form/FormField.test.tsx on lines 117..124
app/javascript/components/Form/FormField.test.tsx on lines 135..142

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

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

  test(`data_type: postal => <FormField .../>`, () => {
    const cnf = { ...config, data_type: 'postal' };
    const wrapper = shallow(<FormField {...cnf} />);
    const input = wrapper.children();

Severity: Major
Found in app/javascript/components/Form/FormField.test.tsx and 11 other locations - About 3 hrs to fix
app/javascript/components/Form/FormField.test.tsx on lines 36..43
app/javascript/components/Form/FormField.test.tsx on lines 45..52
app/javascript/components/Form/FormField.test.tsx on lines 54..61
app/javascript/components/Form/FormField.test.tsx on lines 72..79
app/javascript/components/Form/FormField.test.tsx on lines 81..88
app/javascript/components/Form/FormField.test.tsx on lines 90..97
app/javascript/components/Form/FormField.test.tsx on lines 99..106
app/javascript/components/Form/FormField.test.tsx on lines 108..115
app/javascript/components/Form/FormField.test.tsx on lines 117..124
app/javascript/components/Form/FormField.test.tsx on lines 126..133
app/javascript/components/Form/FormField.test.tsx on lines 135..142

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

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

  fieldTypes.forEach(type => {
    test(`data_type: ${type} => <FormField .../>`, () => {
      const cnf = { ...config, data_type: type };
      const wrapper = render(<FormField {...cnf} />);
      expect(wrapper.find('span').text()).toMatch('Invalid data');
Severity: Major
Found in app/javascript/components/Form/FormField.test.tsx and 1 other location - About 3 hrs to fix
app/javascript/components/Form/FormField.test.tsx on lines 183..189

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

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

  fieldTypes.forEach(type => {
    test(`data_type: ${type} => <FormField .../>`, () => {
      const cnf = { ...config, data_type: type };
      const wrapper = render(<FormField {...cnf} />);
      expect(wrapper.find('span').text()).toMatch('');
Severity: Major
Found in app/javascript/components/Form/FormField.test.tsx and 1 other location - About 3 hrs to fix
app/javascript/components/Form/FormField.test.tsx on lines 172..178

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

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