jtassin/react-amount-field

View on GitHub
examples/src/ReduxFormExample.jsx

Summary

Maintainability
B
4 hrs
Test Coverage

Showing 5 of 5 total issues

Function render has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const ExampleForm = function render(props) {
const {
handleSubmit,
resolvedValue,
resolvedVisited,
Severity: Minor
Found in examples/src/ReduxFormExample.jsx - About 1 hr to fix

    Function mapStateToProps has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    function mapStateToProps(state) {
    let resolvedValue = null;
    let resolvedVisited = false;
    let resolvedTouched = false;
    let resolvedActive = false;
    Severity: Minor
    Found in examples/src/ReduxFormExample.jsx - About 1 hr to fix

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

    if (form.reduxForm.fields.field.active) {
    resolvedActive = form.reduxForm.fields.field.active;
    }
    Severity: Minor
    Found in examples/src/ReduxFormExample.jsx and 2 other locations - About 35 mins to fix
    examples/src/ReduxFormExample.jsx on lines 68..70
    examples/src/ReduxFormExample.jsx on lines 71..73

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

    if (form.reduxForm.fields.field.visited) {
    resolvedVisited = form.reduxForm.fields.field.visited;
    }
    Severity: Minor
    Found in examples/src/ReduxFormExample.jsx and 2 other locations - About 35 mins to fix
    examples/src/ReduxFormExample.jsx on lines 71..73
    examples/src/ReduxFormExample.jsx on lines 74..76

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

    if (form.reduxForm.fields.field.touched) {
    resolvedTouched = form.reduxForm.fields.field.touched;
    }
    Severity: Minor
    Found in examples/src/ReduxFormExample.jsx and 2 other locations - About 35 mins to fix
    examples/src/ReduxFormExample.jsx on lines 68..70
    examples/src/ReduxFormExample.jsx on lines 74..76
    Category
    Status