appbaseio/reactivesearch

View on GitHub

Showing 1,042 of 1,376 total issues

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

        hasValidValue(component) {
            if (!component) return false;
            if (Array.isArray(component.value)) return !!component.value.length;
            return !!component.value;
        },
Severity: Major
Found in packages/vue/src/components/URLParamsProvider.jsx and 1 other location - About 1 hr to fix
packages/web/src/components/basic/URLParamsProvider.js on lines 105..109

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

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

        options(newVal) {
            this.modifiedOptions = newVal[this.$props.dataField]
                ? newVal[this.$props.dataField].buckets
                : [];
        },
Severity: Major
Found in packages/vue/src/components/list/SingleList.jsx and 1 other location - About 1 hr to fix
packages/vue/src/components/list/MultiList.jsx on lines 95..99

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

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

        options(newVal) {
            this.modifiedOptions = newVal[this.$props.dataField]
                ? newVal[this.$props.dataField].buckets
                : [];
        },
Severity: Major
Found in packages/vue/src/components/list/MultiList.jsx and 1 other location - About 1 hr to fix
packages/vue/src/components/list/SingleList.jsx on lines 94..98

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

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

    hasValidValue(component) {
        if (!component) return false;
        if (Array.isArray(component.value)) return !!component.value.length;
        return !!component.value;
    }
Severity: Major
Found in packages/web/src/components/basic/URLParamsProvider.js and 1 other location - About 1 hr to fix
packages/vue/src/components/URLParamsProvider.jsx on lines 91..95

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

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

                input: event => {
                    this.setState({
                        isOpen: true,
                        inputValue: event.target.value
                    });
Severity: Major
Found in packages/vue/src/components/basic/DownShift.jsx and 1 other location - About 1 hr to fix
packages/vue/src/components/basic/DownShift.jsx on lines 237..245

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

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

    onSuggestionSelected = (suggestion) => {
        this.setValue(suggestion.value, true, this.props, causes.SUGGESTION_SELECT);
        this.onValueSelected(suggestion.value, causes.SUGGESTION_SELECT, suggestion.source);
    };
Severity: Major
Found in packages/web/src/components/search/DataSearch.js and 1 other location - About 1 hr to fix
packages/vue/src/components/search/DataSearch.jsx on lines 324..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 55.

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

                click: event => {
                    this.setState({
                        isOpen: true,
                        inputValue: event.target.value
                    });
Severity: Major
Found in packages/vue/src/components/basic/DownShift.jsx and 1 other location - About 1 hr to fix
packages/vue/src/components/basic/DownShift.jsx on lines 276..284

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

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

        onSuggestionSelected(suggestion) {
            this.setValue(
                suggestion.value,
                true,
                this.$props,
Severity: Major
Found in packages/vue/src/components/search/DataSearch.jsx and 1 other location - About 1 hr to fix
packages/web/src/components/search/DataSearch.js on lines 376..379

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

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/vue/src/components/range/MultiRange.jsx 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/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 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/RatingsFilter.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/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 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/basic/DataController.js and 8 other locations - About 55 mins to fix
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
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 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/basic/ToggleButton.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/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 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

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

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

                {Object.keys(selectedValues)
                    .filter(
                        id => this.props.components.includes(id) && selectedValues[id].showFilter,
                    )
                    .map((component, index) => {
Severity: Minor
Found in packages/native/src/components/basic/SelectedFilters.js and 1 other location - About 55 mins to fix
packages/web/src/components/basic/SelectedFilters.js on lines 50..74

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

                            <li
                                key={item.key}
                                class={`${this.$data.currentValue[item.key] ? 'active' : ''}`}
                            >
                                <Checkbox
Severity: Major
Found in packages/vue/src/components/list/MultiList.jsx and 3 other locations - About 55 mins to fix
packages/web/src/components/list/MultiDataList.js on lines 380..419
packages/web/src/components/list/MultiList.js on lines 426..465
packages/web/src/components/range/MultiRange.js on lines 201..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 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 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/basic/DataController.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/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

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

    constructor() {
        super();

        this.state = {
            title: '',
Severity: Major
Found in site/demos/datalayer/src/index.js and 2 other locations - About 55 mins to fix
site/demos/polygon/src/index.js on lines 16..23
site/demos/polyline/src/index.js on lines 16..23

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 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/basic/TextField.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/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
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 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/vue/src/components/range/SingleRange.jsx 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/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

Severity
Category
Status
Source
Language