appbaseio/reactivesearch

View on GitHub
packages/native/src/components/range/SingleDropdownRange.js

Summary

Maintainability
D
2 days
Test Coverage

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

    render() {
        return (
            <Picker
                iosHeader="Select one"
                mode="dropdown"
Severity: Minor
Found in packages/native/src/components/range/SingleDropdownRange.js - About 1 hr to fix

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

        componentWillMount() {
            this.props.addComponent(this.props.componentId);
            this.setReact(this.props);
    
            if (this.props.selectedValue) {
    Severity: Major
    Found in packages/native/src/components/range/SingleDropdownRange.js and 8 other locations - About 4 hrs to fix
    packages/native/src/components/basic/TextField.js on lines 33..42
    packages/native/src/components/range/MultiDropdownRange.js on lines 47..56
    packages/web/src/components/basic/TextField.js on lines 37..46
    packages/web/src/components/basic/ToggleButton.js on lines 35..44
    packages/web/src/components/date/DatePicker.js on lines 38..47
    packages/web/src/components/range/MultiDropdownRange.js on lines 40..49
    packages/web/src/components/range/MultiRange.js on lines 41..50
    packages/web/src/components/range/SingleDropdownRange.js on lines 37..46

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 117.

    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 mapDispatchtoProps = dispatch => ({
        addComponent: component => dispatch(addComponent(component)),
        removeComponent: component => dispatch(removeComponent(component)),
        watchComponent: (component, react) => dispatch(watchComponent(component, react)),
        updateQuery: updateQueryObject => dispatch(updateQuery(updateQueryObject)),
    Severity: Major
    Found in packages/native/src/components/range/SingleDropdownRange.js and 4 other locations - About 3 hrs to fix
    packages/native/src/components/basic/TextField.js on lines 246..253
    packages/native/src/components/date/DatePicker.js on lines 336..343
    packages/native/src/components/date/DateRange.js on lines 501..508
    packages/native/src/components/range/MultiDropdownRange.js on lines 329..336

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

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

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

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

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

    Refactorings

    Further Reading

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

        updateQuery = (value, props) => {
            const query = props.customQuery || this.defaultQuery;
    
            props.updateQuery({
                componentId: props.componentId,
    Severity: Major
    Found in packages/native/src/components/range/SingleDropdownRange.js and 4 other locations - About 2 hrs to fix
    packages/native/src/components/basic/TextField.js on lines 99..110
    packages/native/src/components/list/MultiDropdownList.js on lines 211..222
    packages/native/src/components/list/SingleDropdownList.js on lines 130..141
    packages/native/src/components/range/MultiDropdownRange.js on lines 163..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 90.

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

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

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

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

    Refactorings

    Further Reading

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

            if (!isEqual(this.props.defaultSelected, nextProps.defaultSelected)) {
                this.setValue(nextProps.defaultSelected, true);
            } else if (!isEqual(this.state.currentValue, nextProps.selectedValue)) {
                this.setValue(nextProps.selectedValue, true);
            }
    Severity: Major
    Found in packages/native/src/components/range/SingleDropdownRange.js and 1 other location - About 2 hrs to fix
    packages/web/src/components/range/SingleDropdownRange.js on lines 55..59

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

    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

            const performUpdate = () => {
                this.setState(
                    {
                        currentValue,
                    },
    packages/native/src/components/date/DatePicker.js on lines 108..118
    packages/native/src/components/list/SingleDropdownList.js on lines 111..121

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

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

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

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

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

    Refactorings

    Further Reading

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

        defaultQuery = (value, props) => {
            if (value) {
                return {
                    range: {
                        [props.dataField]: {
    Severity: Major
    Found in packages/native/src/components/range/SingleDropdownRange.js and 1 other location - About 1 hr to fix
    packages/vue/src/components/range/SingleRange.jsx on lines 166..179

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

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

    const mapStateToProps = (state, props) => ({
        selectedValue:
            (state.selectedValues[props.componentId]
                && state.selectedValues[props.componentId].value)
            || null,
    Severity: Major
    Found in packages/native/src/components/range/SingleDropdownRange.js and 8 other locations - About 55 mins to fix
    packages/native/src/components/basic/DataController.js on lines 103..108
    packages/native/src/components/basic/TextField.js on lines 239..244
    packages/vue/src/components/range/MultiRange.jsx on lines 223..228
    packages/vue/src/components/range/SingleRange.jsx on lines 181..186
    packages/web/src/components/basic/DataController.js on lines 112..117
    packages/web/src/components/basic/ToggleButton.js on lines 252..257
    packages/web/src/components/range/RatingsFilter.js on lines 218..223
    packages/web/src/components/range/SingleRange.js on lines 220..225

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

    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

            checkPropChange(this.props.dataField, nextProps.dataField, () => {
                this.updateQuery(this.state.currentValue, nextProps);
            });
    Severity: Minor
    Found in packages/native/src/components/range/SingleDropdownRange.js and 2 other locations - About 35 mins to fix
    packages/native/src/components/range/MultiDropdownRange.js on lines 61..63
    packages/web/src/components/basic/NumberBox.js on lines 54..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 46.

    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