SumOfUs/Champaign

View on GitHub

Showing 338 of 338 total issues

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

ActionForm has 31 functions (exceeds 20 allowed). Consider refactoring.
Open

const ActionForm = Backbone.View.extend({
  el: 'form.action-form',
  HIDDEN_FIELDS: [
    'source',
    'akid',
Severity: Minor
Found in app/javascript/legacy/member-facing/backbone/action_form.js - About 3 hrs to fix

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

      public render() {
        if (this.customRenderer) {
          return this.customRenderer(this);
        }
        const props = omit(camelizeKeys(this.config), 'id', 'ref');
    Severity: Major
    Found in app/javascript/plugins/call_tool/index.tsx and 1 other location - About 3 hrs to fix
    app/javascript/plugins/email_tool/index.tsx on lines 76..89

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

    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

      public render() {
        if (this.customRenderer) {
          return this.customRenderer(this);
        }
    
    
    Severity: Major
    Found in app/javascript/plugins/email_tool/index.tsx and 1 other location - About 3 hrs to fix
    app/javascript/plugins/call_tool/index.tsx on lines 80..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 111.

    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

    Function getEventData has 90 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const getEventData = (eventName, ...data) => {
      switch (eventName) {
        case 'action:submitted_success':
          return ['action', 'submitted_success'];
        case '@@chmp:consent:change_country':
    Severity: Major
    Found in app/javascript/util/log_event.js - About 3 hrs to fix

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

                    <EmailEditor
                      errors={this.state.errors}
                      body={this.props.emailBody}
                      header={this.props.emailHeader}
                      footer={this.props.emailFooter}
      Severity: Major
      Found in app/javascript/plugins/email_pension/EmailPensionView.js and 1 other location - About 3 hrs to fix
      app/javascript/plugins/email_pension/EmailRepresentativeView.js on lines 211..219

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

      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

                    <EmailEditor
                      errors={this.state.errors}
                      body={this.props.emailBody}
                      header={this.props.emailHeader}
                      footer={this.props.emailFooter}
      app/javascript/plugins/email_pension/EmailPensionView.js on lines 275..283

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

      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

      Payment has 29 functions (exceeds 20 allowed). Consider refactoring.
      Open

      export class Payment extends Component {
        static title = (<FormattedMessage id="payment" defaultMessage="payment" />);
      
        constructor(props) {
          super(props);
      Severity: Minor
      Found in app/javascript/components/Payment/Payment.js - About 3 hrs to fix

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

          test(`numeric => <SweetInput type="tel" .../>`, () => {
            const wrapper = shallow(<FieldShape field={{...field, data_type: 'numeric'}} />);
            expect(wrapper.text()).toEqual('<SweetInput />');
            expect(wrapper.find('SweetInput').prop('type')).toEqual('tel');
          });
        Severity: Major
        Found in app/javascript/components/FieldShape/FieldShape.test.js and 3 other locations - About 3 hrs to fix
        app/javascript/components/FieldShape/FieldShape.test.js on lines 24..28
        app/javascript/components/FieldShape/FieldShape.test.js on lines 30..34
        app/javascript/components/FieldShape/FieldShape.test.js on lines 36..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 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 4 locations. Consider refactoring.
        Open

          test(`postal => <SweetInput type="text" .../>`, () => {
            const wrapper = shallow(<FieldShape field={{...field, data_type: 'postal'}} />);
            expect(wrapper.text()).toEqual('<SweetInput />');
            expect(wrapper.find('SweetInput').prop('type')).toEqual('text');
          });
        Severity: Major
        Found in app/javascript/components/FieldShape/FieldShape.test.js and 3 other locations - About 3 hrs to fix
        app/javascript/components/FieldShape/FieldShape.test.js on lines 30..34
        app/javascript/components/FieldShape/FieldShape.test.js on lines 36..40
        app/javascript/components/FieldShape/FieldShape.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 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 4 locations. Consider refactoring.
        Open

          test(`email => <SweetInput type="email" .../>`, () => {
            const wrapper = shallow(<FieldShape field={{...field, data_type: 'email'}} />);
            expect(wrapper.text()).toEqual('<SweetInput />');
            expect(wrapper.find('SweetInput').prop('type')).toEqual('email');
          });
        Severity: Major
        Found in app/javascript/components/FieldShape/FieldShape.test.js and 3 other locations - About 3 hrs to fix
        app/javascript/components/FieldShape/FieldShape.test.js on lines 24..28
        app/javascript/components/FieldShape/FieldShape.test.js on lines 36..40
        app/javascript/components/FieldShape/FieldShape.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 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 4 locations. Consider refactoring.
        Open

          test(`phone => <SweetInput type="tel" .../>`, () => {
            const wrapper = shallow(<FieldShape field={{...field, data_type: 'phone'}} />);
            expect(wrapper.text()).toEqual('<SweetInput />');
            expect(wrapper.find('SweetInput').prop('type')).toEqual('tel');
          });
        Severity: Major
        Found in app/javascript/components/FieldShape/FieldShape.test.js and 3 other locations - About 3 hrs to fix
        app/javascript/components/FieldShape/FieldShape.test.js on lines 24..28
        app/javascript/components/FieldShape/FieldShape.test.js on lines 30..34
        app/javascript/components/FieldShape/FieldShape.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 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

        Severity
        Category
        Status
        Source
        Language