pedrojpj/recompose-extends

View on GitHub
src/withForm/WithForm.test.js

Summary

Maintainability
F
1 wk
Test Coverage

File WithForm.test.js has 698 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import Enzyme, { mount } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import { compose, withState, withHandlers } from 'recompose';

Severity: Major
Found in src/withForm/WithForm.test.js - About 1 day to fix

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

      it('should not maintain any fields since they do not exist in the form', () => {
        const Form = ({ form, updateForm, updateField }) => (
          <form>
            <input
              type="text"
    Severity: Major
    Found in src/withForm/WithForm.test.js and 1 other location - About 1 day to fix
    src/withForm/WithForm.test.js on lines 332..353

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

    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('should update value of a field with updateField func', () => {
        const Form = ({ form, updateForm, updateField }) => (
          <form>
            <input
              type="text"
    Severity: Major
    Found in src/withForm/WithForm.test.js and 1 other location - About 1 day to fix
    src/withForm/WithForm.test.js on lines 355..376

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

    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(
          withForm({
            elements: {
              value: [{ id: 1, value: 1 }, { id: 2, value: 2 }],
              required: true
    Severity: Major
    Found in src/withForm/WithForm.test.js and 1 other location - About 4 hrs to fix
    src/withForm/WithForm.test.js on lines 533..548

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 132.

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

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

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

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

    Refactorings

    Further Reading

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

        const Component = compose(
          withForm({
            elements: {
              value: [{ id: 1, value: 1 }, { id: 2, value: 2 }],
              required: true
    Severity: Major
    Found in src/withForm/WithForm.test.js and 1 other location - About 4 hrs to fix
    src/withForm/WithForm.test.js on lines 496..511

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 132.

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

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

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

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

    Refactorings

    Further Reading

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

        const Form = ({ form, updateForm, submitForm }) => (
          <form>
            <input name="password" value={form.password} onChange={updateForm} />
            <input
              name="repeatPassword"
    Severity: Major
    Found in src/withForm/WithForm.test.js and 3 other locations - About 4 hrs to fix
    src/withForm/WithForm.test.js on lines 628..634
    src/withForm/WithForm.test.js on lines 657..663
    src/withForm/WithForm.test.js on lines 699..705

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

        const Form = ({ form, updateForm, submitForm }) => (
          <form>
            <input name="name" value={form.name} onChange={updateForm} />
            <input name="email" value={form.email} onChange={updateForm} />
            <button type="submit" onClick={submitForm} />
    Severity: Major
    Found in src/withForm/WithForm.test.js and 3 other locations - About 4 hrs to fix
    src/withForm/WithForm.test.js on lines 591..601
    src/withForm/WithForm.test.js on lines 628..634
    src/withForm/WithForm.test.js on lines 699..705

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

        const Form = ({ form, updateForm, submitForm }) => (
          <form>
            <input name="name" value={form.name} onChange={updateForm} />
            <input name="copyName" value={form.copyName} onChange={updateForm} />
            <button type="submit" onClick={submitForm} />
    Severity: Major
    Found in src/withForm/WithForm.test.js and 3 other locations - About 4 hrs to fix
    src/withForm/WithForm.test.js on lines 591..601
    src/withForm/WithForm.test.js on lines 657..663
    src/withForm/WithForm.test.js on lines 699..705

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

        const Form = ({ form, updateForm, submitForm }) => (
          <form>
            <input name="name" value={form.name} onChange={updateForm} />
            <input name="email" value={form.email} onChange={updateForm} />
            <button type="submit" onClick={submitForm} />
    Severity: Major
    Found in src/withForm/WithForm.test.js and 3 other locations - About 4 hrs to fix
    src/withForm/WithForm.test.js on lines 591..601
    src/withForm/WithForm.test.js on lines 628..634
    src/withForm/WithForm.test.js on lines 657..663

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

        const Form = ({ form, updateForm, submitForm }) => (
          <form>
            <input
              type="password"
              name="password"
    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 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="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 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 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 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

    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

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

          withHandlers({
            addCustomError: ({ formSetError }) => () => {
              formSetError('invalid');
            },
            checkError: ({ formFieldsWithErrors }) => () => formFieldsWithErrors
    Severity: Minor
    Found in src/withForm/WithForm.test.js and 1 other location - About 50 mins to fix
    src/withForm/WithForm.test.js on lines 235..240

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

    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

          withHandlers({
            addError: ({ formSetError }) => () => {
              formSetError('name');
            },
            checkErrors: ({ formFieldsWithErrors }) => () => formFieldsWithErrors
    Severity: Minor
    Found in src/withForm/WithForm.test.js and 1 other location - About 50 mins to fix
    src/withForm/WithForm.test.js on lines 458..463

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

    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

        wrapper.find('input').simulate('change', {
          target: {
            name: 'check',
            type: 'checkbox',
            checked: true,
    Severity: Minor
    Found in src/withForm/WithForm.test.js and 2 other locations - About 35 mins to fix
    src/withForm/WithForm.test.js on lines 283..285
    src/withForm/WithForm.test.js on lines 309..316

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

    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

        wrapper.find('input').simulate('change', {
          target: { name: 'check', type: 'checkbox', checked: true, value: 'false' }
        });
    Severity: Minor
    Found in src/withForm/WithForm.test.js and 2 other locations - About 35 mins to fix
    src/withForm/WithForm.test.js on lines 309..316
    src/withForm/WithForm.test.js on lines 320..327

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

    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

        wrapper.find('input').simulate('change', {
          target: {
            name: 'check',
            type: 'checkbox',
            checked: false,
    Severity: Minor
    Found in src/withForm/WithForm.test.js and 2 other locations - About 35 mins to fix
    src/withForm/WithForm.test.js on lines 283..285
    src/withForm/WithForm.test.js on lines 320..327

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

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

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

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

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

    Refactorings

    Further Reading

    There are no issues that match your filters.

    Category
    Status