e1-bsd/omni-common-ui

View on GitHub

Showing 222 of 222 total issues

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

describe('#isSuccess()', () => {
  test('returns true if action.type ends with _SUCCESS', () => {
    const callAction = ApiAction.create(buildAction({ type: 'CALL_SUCCESS' }));
    expect(ApiAction.isStarted(callAction)).toBe(false);
    expect(ApiAction.isSuccess(callAction)).toBe(true);
Severity: Major
Found in src/containers/ApiCalls/ApiAction.spec.js and 1 other location - About 4 hrs to fix
src/containers/ApiCalls/ApiAction.spec.js on lines 110..117

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

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

    test('renders the error page if a failed ApiCall.State is received as erroredApi and its code is not 500', () => {
      props = buildProps({ status: 400 });
      const wrapper = mount(<ErrorPageHandler {...props}><div id="inner" /></ErrorPageHandler>);
      expect(wrapper.find(ErrorPage)).toHaveLength(1);
      expect(wrapper.find('#inner')).toHaveLength(0);
Severity: Major
Found in src/containers/ErrorPageHandler/spec.jsx and 2 other locations - About 3 hrs to fix
src/containers/ErrorPageHandler/spec.jsx on lines 79..84
src/containers/ErrorPageHandler/spec.jsx on lines 108..113

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

    test('renders the error page if a failed ApiCall.State is received as erroredApi and its code is 500', () => {
      props = buildProps({ status: 500 });
      const wrapper = mount(<ErrorPageHandler {...props}><div id="inner" /></ErrorPageHandler>);
      expect(wrapper.find(ErrorPage)).toHaveLength(1);
      expect(wrapper.find('#inner')).toHaveLength(0);
Severity: Major
Found in src/containers/ErrorPageHandler/spec.jsx and 2 other locations - About 3 hrs to fix
src/containers/ErrorPageHandler/spec.jsx on lines 108..113
src/containers/ErrorPageHandler/spec.jsx on lines 115..120

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

    test('renders the error page if a failed ApiCall.State is received as erroredApi and its code is 500', () => {
      props = buildProps({ status: 500 });
      const wrapper = mount(<ErrorPageHandler {...props}><div id="inner" /></ErrorPageHandler>);
      expect(wrapper.find(ErrorPage)).toHaveLength(1);
      expect(wrapper.find('#inner')).toHaveLength(0);
Severity: Major
Found in src/containers/ErrorPageHandler/spec.jsx and 2 other locations - About 3 hrs to fix
src/containers/ErrorPageHandler/spec.jsx on lines 79..84
src/containers/ErrorPageHandler/spec.jsx on lines 115..120

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

  test('gets rid of "." items', () => {
    expect(normalizeUrl('/test/./path')).toBe('/test/path');
    expect(normalizeUrl('/test/path/.')).toBe('/test/path');
    expect(normalizeUrl('/./test/path')).toBe('/test/path');
    expect(normalizeUrl('./test/path')).toBe('test/path');
Severity: Major
Found in src/domain/createBuildRoute/spec.js and 1 other location - About 3 hrs to fix
src/domain/createBuildRoute/spec.js on lines 150..156

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

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

  test('removes duplicated slashes', () => {
    expect(normalizeUrl('/test//path')).toBe('/test/path');
    expect(normalizeUrl('/test///path')).toBe('/test/path');
    expect(normalizeUrl('/test_///path')).toBe('/test_/path');
    expect(normalizeUrl('/test9///path')).toBe('/test9/path');
Severity: Major
Found in src/domain/createBuildRoute/spec.js and 1 other location - About 3 hrs to fix
src/domain/createBuildRoute/spec.js on lines 168..174

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

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

  test('the progress is 100 if fraction is greater than 1', () => {
    const wrapper = shallow(<ProgressBar value={200} max={100} />);
    const progress = wrapper.find(`.${styles.ProgressBar_progress}`);
    expect(progress.props().style.width).toBe('100%');
  });
Severity: Major
Found in src/components/ProgressBar/spec.jsx and 1 other location - About 3 hrs to fix
src/components/ProgressBar/spec.jsx on lines 34..38

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

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

  test('calculates the progress percentage out of "progress" and "total"', () => {
    const wrapper = shallow(<ProgressBar value={45} max={45} />);
    const progress = wrapper.find(`.${styles.ProgressBar_progress}`);
    expect(progress.props().style.width).toBe('100%');
  });
Severity: Major
Found in src/components/ProgressBar/spec.jsx and 1 other location - About 3 hrs to fix
src/components/ProgressBar/spec.jsx on lines 52..56

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

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

  test('the progress is 0 if no "progress" is provided', () => {
    const wrapper = shallow(<ProgressBar max={45} />);
    const progress = wrapper.find(`.${styles.ProgressBar_progress}`);
    expect(progress.props().style.width).toBe('0%');
  });
Severity: Major
Found in src/components/ProgressBar/spec.jsx and 2 other locations - About 3 hrs to fix
src/components/ProgressBar/spec.jsx on lines 8..12
src/components/ProgressBar/spec.jsx on lines 26..30

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

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

  test('the progress is 100 if "progress" is more than 100', () => {
    const wrapper = shallow(<ProgressBar value={145} />);
    const progress = wrapper.find(`.${styles.ProgressBar_progress}`);
    expect(progress.props().style.width).toBe('100%');
  });
Severity: Major
Found in src/components/ProgressBar/spec.jsx and 2 other locations - About 3 hrs to fix
src/components/ProgressBar/spec.jsx on lines 8..12
src/components/ProgressBar/spec.jsx on lines 40..44

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

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

  test('uses the "progress" property directly as a percentage', () => {
    const wrapper = shallow(<ProgressBar value={45} />);
    const progress = wrapper.find(`.${styles.ProgressBar_progress}`);
    expect(progress.props().style.width).toBe('45%');
  });
Severity: Major
Found in src/components/ProgressBar/spec.jsx and 2 other locations - About 3 hrs to fix
src/components/ProgressBar/spec.jsx on lines 26..30
src/components/ProgressBar/spec.jsx on lines 40..44

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

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

      test('returns a default ApiResponse if data set to undefined', () => {
        const result = ApiResponseHelper.create({ data: undefined });
        expect(result.loading).toBe(false);
        expect(result.error).toBeUndefined();
        expect(result.data).toBeUndefined();
Severity: Major
Found in src/domain/ApiResponseHelper/spec.js and 2 other locations - About 2 hrs to fix
src/domain/ApiResponseHelper/spec.js on lines 149..154
src/domain/ApiResponseHelper/spec.js on lines 170..175

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

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

      test('returns a default ApiResponse if loading set to undefined', () => {
        const result = ApiResponseHelper.create({ loading: undefined });
        expect(result.loading).toBe(false);
        expect(result.error).toBeUndefined();
        expect(result.data).toBeUndefined();
Severity: Major
Found in src/domain/ApiResponseHelper/spec.js and 2 other locations - About 2 hrs to fix
src/domain/ApiResponseHelper/spec.js on lines 170..175
src/domain/ApiResponseHelper/spec.js on lines 183..188

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

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

      test('returns a default ApiResponse if error set to undefined', () => {
        const result = ApiResponseHelper.create({ error: undefined });
        expect(result.loading).toBe(false);
        expect(result.error).toBeUndefined();
        expect(result.data).toBeUndefined();
Severity: Major
Found in src/domain/ApiResponseHelper/spec.js and 2 other locations - About 2 hrs to fix
src/domain/ApiResponseHelper/spec.js on lines 149..154
src/domain/ApiResponseHelper/spec.js on lines 183..188

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

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 testButtonClick has 67 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function testButtonClick(props = {}) {
  describe('when clicked', () => {
    test('calls onClick', () => {
      const onClick = jest.fn();
      const wrapper = shallow(<Button {...props} onClick={onClick} />);
Severity: Major
Found in src/components/Button/button.spec.jsx - About 2 hrs to fix

    File index.jsx has 278 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import styles from './style.postcss';
    
    import React, { PureComponent } from 'react';
    import PropTypes from 'prop-types';
    import { Set } from 'immutable';
    Severity: Minor
    Found in src/containers/Header/NotificationsTray/index.jsx - About 2 hrs to fix

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

      test('renders profile info with the given surname', () => {
        const wrapper = mount(<Profile name="John" surname="Doe" localName="王呆呆" />);
        expect(wrapper.find(`.${styles.StudentCard_profile_localName}`).text()).toBe('王呆呆');
      });
      Severity: Major
      Found in src/components/StudentCard/Profile/spec.jsx and 1 other location - About 2 hrs to fix
      src/components/StudentCard/Profile/spec.jsx on lines 15..18

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

      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

      test('renders profile info with the given name', () => {
        const wrapper = mount(<Profile name="John" surname="Doe" localName="王呆呆" />);
        expect(wrapper.find(`.${styles.StudentCard_profile_name}`).text()).toBe('John Doe');
      });
      Severity: Major
      Found in src/components/StudentCard/Profile/spec.jsx and 1 other location - About 2 hrs to fix
      src/components/StudentCard/Profile/spec.jsx on lines 20..23

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

      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

        test('applies Field.__stackedHorizontally when enabled', () => {
          const wrapper = mount(<Field {...requiredPropNoops} neighborStackMode="horizontal" />);
          expect(wrapper.find(`.${styles.Field}.${styles.__stackedHorizontally}`)).toHaveLength(1);
        });
      Severity: Major
      Found in src/components/Form/Field/spec.jsx and 1 other location - About 2 hrs to fix
      src/components/Form/Field/spec.jsx on lines 95..98

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

      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

        test('applies Field_wrap.__stackedVertically when enabled', () => {
          const wrapper = mount(<Field {...requiredPropNoops} innerStackMode="vertical" />);
          expect(wrapper.find(`.${styles.Field_wrap}.${styles.__stackedVertically}`)).toHaveLength(1);
        });
      Severity: Major
      Found in src/components/Form/Field/spec.jsx and 1 other location - About 2 hrs to fix
      src/components/Form/Field/spec.jsx on lines 90..93

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 82.

      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