appbaseio/reactivesearch

View on GitHub
packages/web/src/components/range/SingleRange.js

Summary

Maintainability
D
2 days
Test Coverage

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

    render() {
        return (
            <Container style={this.props.style} className={this.props.className}>
                {this.props.title && (
                    <Title className={getClassName(this.props.innerClass, 'title') || null}>
Severity: Minor
Found in packages/web/src/components/range/SingleRange.js - About 1 hr to fix

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

        static defaultQuery = (value, props) => {
            let query = null;
            if (value) {
                query = {
                    range: {
    Severity: Major
    Found in packages/web/src/components/range/SingleRange.js and 1 other location - About 4 hrs to fix
    packages/web/src/components/range/SingleDropdownRange.js on lines 75..100

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

    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

        componentWillMount() {
            this.props.addComponent(this.props.componentId);
            this.setReact(this.props);
    
            if (this.props.selectedValue) {
    Severity: Major
    Found in packages/web/src/components/range/SingleRange.js and 1 other location - About 4 hrs to fix
    packages/web/src/components/basic/NumberBox.js on lines 36..45

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

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

    const mapDispatchtoProps = dispatch => ({
        addComponent: component => dispatch(addComponent(component)),
        removeComponent: component => dispatch(removeComponent(component)),
        updateQuery: updateQueryObject => dispatch(updateQuery(updateQueryObject)),
        watchComponent: (component, react) => dispatch(watchComponent(component, react)),
    Severity: Major
    Found in packages/web/src/components/range/SingleRange.js and 11 other locations - About 3 hrs to fix
    packages/maps/src/components/basic/GeoDistanceDropdown.js on lines 532..539
    packages/maps/src/components/basic/GeoDistanceSlider.js on lines 571..578
    packages/web/src/components/basic/NumberBox.js on lines 244..251
    packages/web/src/components/basic/TextField.js on lines 260..267
    packages/web/src/components/basic/ToggleButton.js on lines 259..266
    packages/web/src/components/date/DatePicker.js on lines 264..271
    packages/web/src/components/date/DateRange.js on lines 462..469
    packages/web/src/components/range/MultiDropdownRange.js on lines 252..259
    packages/web/src/components/range/MultiRange.js on lines 272..279
    packages/web/src/components/range/RatingsFilter.js on lines 225..232
    packages/web/src/components/range/SingleDropdownRange.js on lines 213..220

    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

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

        updateQuery = (value, props) => {
            const query = props.customQuery || SingleRange.defaultQuery;
    
            props.updateQuery({
                componentId: props.componentId,
    Severity: Major
    Found in packages/web/src/components/range/SingleRange.js and 10 other locations - About 3 hrs to fix
    packages/web/src/components/basic/TagCloud.js on lines 202..214
    packages/web/src/components/date/DatePicker.js on lines 152..164
    packages/web/src/components/list/MultiDropdownList.js on lines 284..296
    packages/web/src/components/list/MultiList.js on lines 292..304
    packages/web/src/components/list/SingleDropdownList.js on lines 189..201
    packages/web/src/components/list/SingleList.js on lines 199..211
    packages/web/src/components/range/MultiDropdownRange.js on lines 170..182
    packages/web/src/components/range/MultiRange.js on lines 173..185
    packages/web/src/components/range/RatingsFilter.js on lines 138..150
    packages/web/src/components/range/SingleDropdownRange.js on lines 131..143

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

    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

        constructor(props) {
            super(props);
    
            this.state = {
                currentValue: null,
    Severity: Major
    Found in packages/web/src/components/range/SingleRange.js and 1 other location - About 2 hrs to fix
    packages/web/src/components/range/SingleDropdownRange.js on lines 26..35

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

    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

                                    <label
                                        className={getClassName(this.props.innerClass, 'label') || null}
                                        htmlFor={`${this.props.componentId}-${item.label}`}
                                    >
                                        {item.label}
    Severity: Major
    Found in packages/web/src/components/range/SingleRange.js and 1 other location - About 2 hrs to fix
    packages/web/src/components/range/MultiRange.js on lines 214..219

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

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

                    {this.props.title && (
                        <Title className={getClassName(this.props.innerClass, 'title') || null}>
                            {this.props.title}
                        </Title>
                    )}
    Severity: Major
    Found in packages/web/src/components/range/SingleRange.js and 22 other locations - About 1 hr to fix
    packages/maps/src/components/basic/GeoDistanceDropdown.js on lines 447..451
    packages/maps/src/components/basic/GeoDistanceSlider.js on lines 455..459
    packages/web/src/components/basic/NumberBox.js on lines 170..174
    packages/web/src/components/basic/TagCloud.js on lines 247..251
    packages/web/src/components/basic/TextField.js on lines 175..179
    packages/web/src/components/basic/ToggleButton.js on lines 191..195
    packages/web/src/components/date/DatePicker.js on lines 173..177
    packages/web/src/components/date/DateRange.js on lines 305..309
    packages/web/src/components/list/MultiDataList.js on lines 341..345
    packages/web/src/components/list/MultiDropdownList.js on lines 346..350
    packages/web/src/components/list/MultiList.js on lines 384..388
    packages/web/src/components/list/SingleDataList.js on lines 259..263
    packages/web/src/components/list/SingleDropdownList.js on lines 252..256
    packages/web/src/components/list/SingleList.js on lines 291..295
    packages/web/src/components/range/DynamicRangeSlider.js on lines 404..408
    packages/web/src/components/range/MultiDropdownRange.js on lines 187..191
    packages/web/src/components/range/MultiRange.js on lines 194..198
    packages/web/src/components/range/RangeSlider.js on lines 289..293
    packages/web/src/components/range/RatingsFilter.js on lines 155..159
    packages/web/src/components/range/SingleDropdownRange.js on lines 148..152
    packages/web/src/components/search/CategorySearch.js on lines 568..572
    packages/web/src/components/search/DataSearch.js on lines 482..486

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

    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/web/src/components/range/SingleRange.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/native/src/components/range/SingleDropdownRange.js on lines 184..189
    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

    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

    There are no issues that match your filters.

    Category
    Status