pedrojpj/recompose-extends

View on GitHub

Showing 52 of 52 total issues

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

    const Form = ({ form, updateForm, submitForm }) => (
      <form>
        <input name="name" value={form.name} onChange={updateForm} />
        <button type="submit" onClick={submitForm} />
      </form>
Severity: Major
Found in src/withForm/WithForm.test.js and 4 other locations - About 2 hrs to fix
src/withForm/WithForm.test.js on lines 449..454
src/withForm/WithForm.test.js on lines 566..571
src/withForm/WithForm.test.js on lines 733..738
src/withForm/WithForm.test.js on lines 769..774

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

    const Form = ({ form, updateForm, submitForm }) => (
      <form>
        <input name="name" value={form.name} onChange={updateForm} />
        <button type="submit" onClick={submitForm} />
      </form>
Severity: Major
Found in src/withForm/WithForm.test.js and 4 other locations - About 2 hrs to fix
src/withForm/WithForm.test.js on lines 566..571
src/withForm/WithForm.test.js on lines 733..738
src/withForm/WithForm.test.js on lines 769..774
src/withForm/WithForm.test.js on lines 802..807

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

    const Form = ({ form, updateForm, submitForm }) => (
      <form>
        <input
          type="text"
          name="name"
Severity: Major
Found in src/withForm/WithForm.test.js and 7 other locations - About 2 hrs to fix
src/withForm/WithForm.test.js on lines 70..80
src/withForm/WithForm.test.js on lines 99..109
src/withForm/WithForm.test.js on lines 130..140
src/withForm/WithForm.test.js on lines 180..190
src/withForm/WithForm.test.js on lines 215..225
src/withForm/WithForm.test.js on lines 265..275
src/withForm/WithForm.test.js on lines 291..301

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

    const Form = ({ form, updateForm, submitForm }) => (
      <form>
        <input
          type="text"
          name="name"
Severity: Major
Found in src/withForm/WithForm.test.js and 7 other locations - About 2 hrs to fix
src/withForm/WithForm.test.js on lines 49..59
src/withForm/WithForm.test.js on lines 70..80
src/withForm/WithForm.test.js on lines 99..109
src/withForm/WithForm.test.js on lines 130..140
src/withForm/WithForm.test.js on lines 180..190
src/withForm/WithForm.test.js on lines 265..275
src/withForm/WithForm.test.js on lines 291..301

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

    const Form = ({ form, updateForm, submitForm }) => (
      <form>
        <input
          type="text"
          name="name"
Severity: Major
Found in src/withForm/WithForm.test.js and 7 other locations - About 2 hrs to fix
src/withForm/WithForm.test.js on lines 49..59
src/withForm/WithForm.test.js on lines 70..80
src/withForm/WithForm.test.js on lines 130..140
src/withForm/WithForm.test.js on lines 180..190
src/withForm/WithForm.test.js on lines 215..225
src/withForm/WithForm.test.js on lines 265..275
src/withForm/WithForm.test.js on lines 291..301

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

    const Form = ({ form, updateForm, submitForm }) => (
      <form>
        <input name="name" value={form.name} onChange={updateForm} />
        <button type="submit" onClick={submitForm} />
      </form>
Severity: Major
Found in src/withForm/WithForm.test.js and 4 other locations - About 2 hrs to fix
src/withForm/WithForm.test.js on lines 449..454
src/withForm/WithForm.test.js on lines 566..571
src/withForm/WithForm.test.js on lines 733..738
src/withForm/WithForm.test.js on lines 802..807

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

    const Form = ({ form, updateForm, submitForm }) => (
      <form>
        <input name="name" value={form.name} onChange={updateForm} />
        <button type="submit" onClick={submitForm} />
      </form>
Severity: Major
Found in src/withForm/WithForm.test.js and 4 other locations - About 2 hrs to fix
src/withForm/WithForm.test.js on lines 449..454
src/withForm/WithForm.test.js on lines 566..571
src/withForm/WithForm.test.js on lines 769..774
src/withForm/WithForm.test.js on lines 802..807

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

    const Form = ({ form, updateForm, submitForm }) => (
      <form>
        <input
          type="text"
          name="name"
Severity: Major
Found in src/withForm/WithForm.test.js and 7 other locations - About 2 hrs to fix
src/withForm/WithForm.test.js on lines 49..59
src/withForm/WithForm.test.js on lines 99..109
src/withForm/WithForm.test.js on lines 130..140
src/withForm/WithForm.test.js on lines 180..190
src/withForm/WithForm.test.js on lines 215..225
src/withForm/WithForm.test.js on lines 265..275
src/withForm/WithForm.test.js on lines 291..301

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

    const Form = ({ form, updateForm, submitForm }) => (
      <form>
        <input
          type="email"
          name="email"
Severity: Major
Found in src/withForm/WithForm.test.js and 7 other locations - About 2 hrs to fix
src/withForm/WithForm.test.js on lines 49..59
src/withForm/WithForm.test.js on lines 70..80
src/withForm/WithForm.test.js on lines 99..109
src/withForm/WithForm.test.js on lines 130..140
src/withForm/WithForm.test.js on lines 215..225
src/withForm/WithForm.test.js on lines 265..275
src/withForm/WithForm.test.js on lines 291..301

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

    const Form = ({ form, updateForm, submitForm }) => (
      <form>
        <input
          type="checkbox"
          name="check"
Severity: Major
Found in src/withForm/WithForm.test.js and 7 other locations - About 2 hrs to fix
src/withForm/WithForm.test.js on lines 49..59
src/withForm/WithForm.test.js on lines 70..80
src/withForm/WithForm.test.js on lines 99..109
src/withForm/WithForm.test.js on lines 130..140
src/withForm/WithForm.test.js on lines 180..190
src/withForm/WithForm.test.js on lines 215..225
src/withForm/WithForm.test.js on lines 265..275

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

File withForm.js has 270 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import { compose, withState, withProps, pure } from 'recompose';
import { withForm } from '../src/index';

const WithForm = ({
Severity: Minor
Found in example/withForm.js - About 2 hrs to fix

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

      it('should not remove prop title of the component', () => {
        const Component = removeProp('name')(ComponentMock);
        const wrapper = shallow(<Component title="Prueba" />).dive();
    
        expect(wrapper.props().children).toBeDefined();
    Severity: Major
    Found in src/removeProp/removeProp.test.js and 1 other location - About 2 hrs to fix
    src/removeProp/removeProp.test.js on lines 16..21

    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

      it('remove prop title of the component', () => {
        const Component = removeProp('title')(ComponentMock);
        const wrapper = shallow(<Component title="Prueba" />).dive();
    
        expect(wrapper.props().children).toBeUndefined();
    Severity: Major
    Found in src/removeProp/removeProp.test.js and 1 other location - About 2 hrs to fix
    src/removeProp/removeProp.test.js on lines 23..28

    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

    Function withForm has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    const withForm = (input, handlers, errors) => BaseComponent => {
      const factory = createFactory(BaseComponent);
    
      class WithForm extends Component {
        constructor(props) {
    Severity: Minor
    Found in src/withForm/index.js - About 2 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function withErrors has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const withErrors = (input = {}, component) => BaseComponent => {
      const factoryError = createFactory(component);
      const factory = createFactory(BaseComponent);
    
      class withErrorClass extends Component {
    Severity: Major
    Found in src/withErrors/index.js - About 2 hrs to fix

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

          const Component = compose(
            withState('submit', 'setSubmit', false),
            withForm(
              {
                password: {
      Severity: Major
      Found in src/withForm/WithForm.test.js and 1 other location - About 2 hrs to fix
      src/withForm/WithForm.test.js on lines 192..201

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

          const Component = compose(
            withState('submit', 'setSubmit', false),
            withForm(
              { email: { value: '', type: 'email' } },
              ({ setSubmit, resetForm }) => () => {
      Severity: Major
      Found in src/withForm/WithForm.test.js and 1 other location - About 2 hrs to fix
      src/withForm/WithForm.test.js on lines 142..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 77.

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

      const waitFor = (input, loadingComponent) => BaseComponent => {
        const factory = createFactory(BaseComponent);
        const factoryLoading = createFactory(loadingComponent);
      
        class WaitFor extends Component {
      Severity: Minor
      Found in src/waitFor/index.js - About 1 hr to fix

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

                this.setState(
                  prevState => ({
                    form: { ...prevState.form, ...customField }
                  }),
                  () => {
        Severity: Major
        Found in src/withForm/index.js and 1 other location - About 1 hr to fix
        src/withForm/index.js on lines 223..232

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

        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

                this.setState(
                  prevState => ({
                    form: { ...prevState.form, ...customField }
                  }),
                  () => {
        Severity: Major
        Found in src/withForm/index.js and 1 other location - About 1 hr to fix
        src/withForm/index.js on lines 161..170

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 68.

        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