appbaseio/reactivesearch

View on GitHub

Showing 1,042 of 1,376 total issues

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

const getCompositeAggsQuery = (query, props, after) => {
    const clonedQuery = { ...query };
    // missing label not available in composite aggs
    const {
        dataField, size, sortBy, showMissing,
Severity: Major
Found in packages/web/src/components/list/utils.js and 1 other location - About 1 day to fix
packages/vue/src/components/list/utils.js on lines 33..73

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

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

                                    <Grid
                                        size={4}
                                        mdSize={2}
                                        smSize={1}
                                        gutter="15px"
Severity: Major
Found in site/src/components/Home.js and 1 other location - About 1 day to fix
site/src/components/Home.js on lines 428..456

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

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

                                <Grid
                                    size={4}
                                    mdSize={2}
                                    smSize={1}
                                    gutter="15px"
Severity: Major
Found in site/src/components/Home.js and 1 other location - About 1 day to fix
site/src/components/Home.js on lines 360..388

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

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

    getCoordinates(value, cb) {
        if (value) {
            fetch(
                `https://maps.googleapis.com/maps/api/geocode/json?key=${
                    this.props.mapKey
Severity: Major
Found in packages/maps/src/components/basic/GeoDistanceDropdown.js and 1 other location - About 1 day to fix
packages/maps/src/components/basic/GeoDistanceSlider.js on lines 200..221

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

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

    getCoordinates(value, cb) {
        if (value) {
            fetch(
                `https://maps.googleapis.com/maps/api/geocode/json?key=${
                    this.props.mapKey
Severity: Major
Found in packages/maps/src/components/basic/GeoDistanceSlider.js and 1 other location - About 1 day to fix
packages/maps/src/components/basic/GeoDistanceDropdown.js on lines 192..213

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

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 (nextProps.defaultQuery && !isEqual(nextProps.defaultQuery(), this.defaultQuery)) {
            const options = getQueryOptions(nextProps);
            options.from = 0;
            this.defaultQuery = nextProps.defaultQuery();

Severity: Major
Found in packages/native/src/components/result/ReactiveList.js and 1 other location - About 1 day to fix
packages/web/src/components/result/ReactiveList.js on lines 160..190

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

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 (nextProps.defaultQuery && !isEqual(nextProps.defaultQuery(), this.defaultQuery)) {
            const options = getQueryOptions(nextProps);
            options.from = 0;
            this.defaultQuery = nextProps.defaultQuery();

Severity: Major
Found in packages/web/src/components/result/ReactiveList.js and 1 other location - About 1 day to fix
packages/native/src/components/result/ReactiveList.js on lines 150..180

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

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);
        if (this.internalComponent) {
            this.props.addComponent(this.internalComponent);
        }
Severity: Major
Found in packages/web/src/components/basic/ReactiveComponent.js and 1 other location - About 1 day to fix
packages/native/src/components/basic/ReactiveComponent.js on lines 39..61

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

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);
        if (this.internalComponent) {
            this.props.addComponent(this.internalComponent);
        }
Severity: Major
Found in packages/native/src/components/basic/ReactiveComponent.js and 1 other location - About 1 day to fix
packages/web/src/components/basic/ReactiveComponent.js on lines 43..65

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

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

const Input = styled('input')`
    ${input};
    ${({ themePreset }) => themePreset === 'dark' && darkInput};

    ${props =>
Severity: Major
Found in packages/vue/src/styles/Input.js and 1 other location - About 1 day to fix
packages/web/src/styles/Input.js on lines 36..71

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

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

const Input = styled('input')`
    ${input};
    ${({ themePreset }) => themePreset === 'dark' && darkInput};

    ${props =>
Severity: Major
Found in packages/web/src/styles/Input.js and 1 other location - About 1 day to fix
packages/vue/src/styles/Input.js on lines 36..71

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

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

DateRange.propTypes = {
    addComponent: types.funcRequired,
    componentId: types.stringRequired,
    defaultSelected: types.dateObject,
    react: types.react,
Severity: Major
Found in packages/native/src/components/date/DateRange.js and 1 other location - About 1 day to fix
packages/native/src/components/range/MultiDropdownRange.js on lines 291..314

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

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

MultiDropdownRange.propTypes = {
    addComponent: types.funcRequired,
    componentId: types.stringRequired,
    defaultSelected: types.stringArray,
    react: types.react,
Severity: Major
Found in packages/native/src/components/range/MultiDropdownRange.js and 1 other location - About 1 day to fix
packages/native/src/components/date/DateRange.js on lines 465..488

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

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

export default class Main extends Component {
    static async getInitialProps() {
        return {
            store: await initReactivesearch(
                [
Severity: Major
Found in packages/web/examples/ssr/pages/multidropdownrange.js and 21 other locations - About 1 day to fix
packages/web/examples/ssr/pages/categorysearch.js on lines 39..79
packages/web/examples/ssr/pages/datasearch.js on lines 34..74
packages/web/examples/ssr/pages/datepicker.js on lines 66..106
packages/web/examples/ssr/pages/daterange.js on lines 76..116
packages/web/examples/ssr/pages/dynamicrangeslider.js on lines 40..80
packages/web/examples/ssr/pages/multidropdownlist.js on lines 39..79
packages/web/examples/ssr/pages/multilist.js on lines 34..74
packages/web/examples/ssr/pages/multirange.js on lines 37..77
packages/web/examples/ssr/pages/numberbox.js on lines 39..79
packages/web/examples/ssr/pages/rangeinput.js on lines 43..83
packages/web/examples/ssr/pages/rangeslider.js on lines 48..88
packages/web/examples/ssr/pages/ratingsfilter.js on lines 45..85
packages/web/examples/ssr/pages/reactivelist.js on lines 41..81
packages/web/examples/ssr/pages/resultlist.js on lines 41..80
packages/web/examples/ssr/pages/singledatalist.js on lines 47..87
packages/web/examples/ssr/pages/singledropdownlist.js on lines 39..79
packages/web/examples/ssr/pages/singledropdownrange.js on lines 42..82
packages/web/examples/ssr/pages/singlelist.js on lines 34..74
packages/web/examples/ssr/pages/singlerange.js on lines 42..82
packages/web/examples/ssr/pages/textfield.js on lines 33..73
packages/web/examples/ssr/pages/togglebutton.js on lines 41..80

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

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

export default class Main extends Component {
    static async getInitialProps() {
        return {
            store: await initReactivesearch(
                [
Severity: Major
Found in packages/web/examples/ssr/pages/multidropdownlist.js and 21 other locations - About 1 day to fix
packages/web/examples/ssr/pages/categorysearch.js on lines 39..79
packages/web/examples/ssr/pages/datasearch.js on lines 34..74
packages/web/examples/ssr/pages/datepicker.js on lines 66..106
packages/web/examples/ssr/pages/daterange.js on lines 76..116
packages/web/examples/ssr/pages/dynamicrangeslider.js on lines 40..80
packages/web/examples/ssr/pages/multidropdownrange.js on lines 42..82
packages/web/examples/ssr/pages/multilist.js on lines 34..74
packages/web/examples/ssr/pages/multirange.js on lines 37..77
packages/web/examples/ssr/pages/numberbox.js on lines 39..79
packages/web/examples/ssr/pages/rangeinput.js on lines 43..83
packages/web/examples/ssr/pages/rangeslider.js on lines 48..88
packages/web/examples/ssr/pages/ratingsfilter.js on lines 45..85
packages/web/examples/ssr/pages/reactivelist.js on lines 41..81
packages/web/examples/ssr/pages/resultlist.js on lines 41..80
packages/web/examples/ssr/pages/singledatalist.js on lines 47..87
packages/web/examples/ssr/pages/singledropdownlist.js on lines 39..79
packages/web/examples/ssr/pages/singledropdownrange.js on lines 42..82
packages/web/examples/ssr/pages/singlelist.js on lines 34..74
packages/web/examples/ssr/pages/singlerange.js on lines 42..82
packages/web/examples/ssr/pages/textfield.js on lines 33..73
packages/web/examples/ssr/pages/togglebutton.js on lines 41..80

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

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

export default class Main extends Component {
    static async getInitialProps() {
        return {
            store: await initReactivesearch(
                [
Severity: Major
Found in packages/web/examples/ssr/pages/ratingsfilter.js and 21 other locations - About 1 day to fix
packages/web/examples/ssr/pages/categorysearch.js on lines 39..79
packages/web/examples/ssr/pages/datasearch.js on lines 34..74
packages/web/examples/ssr/pages/datepicker.js on lines 66..106
packages/web/examples/ssr/pages/daterange.js on lines 76..116
packages/web/examples/ssr/pages/dynamicrangeslider.js on lines 40..80
packages/web/examples/ssr/pages/multidropdownlist.js on lines 39..79
packages/web/examples/ssr/pages/multidropdownrange.js on lines 42..82
packages/web/examples/ssr/pages/multilist.js on lines 34..74
packages/web/examples/ssr/pages/multirange.js on lines 37..77
packages/web/examples/ssr/pages/numberbox.js on lines 39..79
packages/web/examples/ssr/pages/rangeinput.js on lines 43..83
packages/web/examples/ssr/pages/rangeslider.js on lines 48..88
packages/web/examples/ssr/pages/reactivelist.js on lines 41..81
packages/web/examples/ssr/pages/resultlist.js on lines 41..80
packages/web/examples/ssr/pages/singledatalist.js on lines 47..87
packages/web/examples/ssr/pages/singledropdownlist.js on lines 39..79
packages/web/examples/ssr/pages/singledropdownrange.js on lines 42..82
packages/web/examples/ssr/pages/singlelist.js on lines 34..74
packages/web/examples/ssr/pages/singlerange.js on lines 42..82
packages/web/examples/ssr/pages/textfield.js on lines 33..73
packages/web/examples/ssr/pages/togglebutton.js on lines 41..80

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

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

export default class Main extends Component {
    static async getInitialProps() {
        return {
            store: await initReactivesearch(
                [
Severity: Major
Found in packages/web/examples/ssr/pages/rangeinput.js and 21 other locations - About 1 day to fix
packages/web/examples/ssr/pages/categorysearch.js on lines 39..79
packages/web/examples/ssr/pages/datasearch.js on lines 34..74
packages/web/examples/ssr/pages/datepicker.js on lines 66..106
packages/web/examples/ssr/pages/daterange.js on lines 76..116
packages/web/examples/ssr/pages/dynamicrangeslider.js on lines 40..80
packages/web/examples/ssr/pages/multidropdownlist.js on lines 39..79
packages/web/examples/ssr/pages/multidropdownrange.js on lines 42..82
packages/web/examples/ssr/pages/multilist.js on lines 34..74
packages/web/examples/ssr/pages/multirange.js on lines 37..77
packages/web/examples/ssr/pages/numberbox.js on lines 39..79
packages/web/examples/ssr/pages/rangeslider.js on lines 48..88
packages/web/examples/ssr/pages/ratingsfilter.js on lines 45..85
packages/web/examples/ssr/pages/reactivelist.js on lines 41..81
packages/web/examples/ssr/pages/resultlist.js on lines 41..80
packages/web/examples/ssr/pages/singledatalist.js on lines 47..87
packages/web/examples/ssr/pages/singledropdownlist.js on lines 39..79
packages/web/examples/ssr/pages/singledropdownrange.js on lines 42..82
packages/web/examples/ssr/pages/singlelist.js on lines 34..74
packages/web/examples/ssr/pages/singlerange.js on lines 42..82
packages/web/examples/ssr/pages/textfield.js on lines 33..73
packages/web/examples/ssr/pages/togglebutton.js on lines 41..80

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

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

export default class Main extends Component {
    static async getInitialProps() {
        return {
            store: await initReactivesearch(
                [
Severity: Major
Found in packages/web/examples/ssr/pages/textfield.js and 21 other locations - About 1 day to fix
packages/web/examples/ssr/pages/categorysearch.js on lines 39..79
packages/web/examples/ssr/pages/datasearch.js on lines 34..74
packages/web/examples/ssr/pages/datepicker.js on lines 66..106
packages/web/examples/ssr/pages/daterange.js on lines 76..116
packages/web/examples/ssr/pages/dynamicrangeslider.js on lines 40..80
packages/web/examples/ssr/pages/multidropdownlist.js on lines 39..79
packages/web/examples/ssr/pages/multidropdownrange.js on lines 42..82
packages/web/examples/ssr/pages/multilist.js on lines 34..74
packages/web/examples/ssr/pages/multirange.js on lines 37..77
packages/web/examples/ssr/pages/numberbox.js on lines 39..79
packages/web/examples/ssr/pages/rangeinput.js on lines 43..83
packages/web/examples/ssr/pages/rangeslider.js on lines 48..88
packages/web/examples/ssr/pages/ratingsfilter.js on lines 45..85
packages/web/examples/ssr/pages/reactivelist.js on lines 41..81
packages/web/examples/ssr/pages/resultlist.js on lines 41..80
packages/web/examples/ssr/pages/singledatalist.js on lines 47..87
packages/web/examples/ssr/pages/singledropdownlist.js on lines 39..79
packages/web/examples/ssr/pages/singledropdownrange.js on lines 42..82
packages/web/examples/ssr/pages/singlelist.js on lines 34..74
packages/web/examples/ssr/pages/singlerange.js on lines 42..82
packages/web/examples/ssr/pages/togglebutton.js on lines 41..80

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

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

export default class Main extends Component {
    static async getInitialProps() {
        return {
            store: await initReactivesearch(
                [
Severity: Major
Found in packages/web/examples/ssr/pages/datasearch.js and 21 other locations - About 1 day to fix
packages/web/examples/ssr/pages/categorysearch.js on lines 39..79
packages/web/examples/ssr/pages/datepicker.js on lines 66..106
packages/web/examples/ssr/pages/daterange.js on lines 76..116
packages/web/examples/ssr/pages/dynamicrangeslider.js on lines 40..80
packages/web/examples/ssr/pages/multidropdownlist.js on lines 39..79
packages/web/examples/ssr/pages/multidropdownrange.js on lines 42..82
packages/web/examples/ssr/pages/multilist.js on lines 34..74
packages/web/examples/ssr/pages/multirange.js on lines 37..77
packages/web/examples/ssr/pages/numberbox.js on lines 39..79
packages/web/examples/ssr/pages/rangeinput.js on lines 43..83
packages/web/examples/ssr/pages/rangeslider.js on lines 48..88
packages/web/examples/ssr/pages/ratingsfilter.js on lines 45..85
packages/web/examples/ssr/pages/reactivelist.js on lines 41..81
packages/web/examples/ssr/pages/resultlist.js on lines 41..80
packages/web/examples/ssr/pages/singledatalist.js on lines 47..87
packages/web/examples/ssr/pages/singledropdownlist.js on lines 39..79
packages/web/examples/ssr/pages/singledropdownrange.js on lines 42..82
packages/web/examples/ssr/pages/singlelist.js on lines 34..74
packages/web/examples/ssr/pages/singlerange.js on lines 42..82
packages/web/examples/ssr/pages/textfield.js on lines 33..73
packages/web/examples/ssr/pages/togglebutton.js on lines 41..80

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

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

export default class Main extends Component {
    static async getInitialProps() {
        return {
            store: await initReactivesearch(
                [
Severity: Major
Found in packages/web/examples/ssr/pages/singledatalist.js and 21 other locations - About 1 day to fix
packages/web/examples/ssr/pages/categorysearch.js on lines 39..79
packages/web/examples/ssr/pages/datasearch.js on lines 34..74
packages/web/examples/ssr/pages/datepicker.js on lines 66..106
packages/web/examples/ssr/pages/daterange.js on lines 76..116
packages/web/examples/ssr/pages/dynamicrangeslider.js on lines 40..80
packages/web/examples/ssr/pages/multidropdownlist.js on lines 39..79
packages/web/examples/ssr/pages/multidropdownrange.js on lines 42..82
packages/web/examples/ssr/pages/multilist.js on lines 34..74
packages/web/examples/ssr/pages/multirange.js on lines 37..77
packages/web/examples/ssr/pages/numberbox.js on lines 39..79
packages/web/examples/ssr/pages/rangeinput.js on lines 43..83
packages/web/examples/ssr/pages/rangeslider.js on lines 48..88
packages/web/examples/ssr/pages/ratingsfilter.js on lines 45..85
packages/web/examples/ssr/pages/reactivelist.js on lines 41..81
packages/web/examples/ssr/pages/resultlist.js on lines 41..80
packages/web/examples/ssr/pages/singledropdownlist.js on lines 39..79
packages/web/examples/ssr/pages/singledropdownrange.js on lines 42..82
packages/web/examples/ssr/pages/singlelist.js on lines 34..74
packages/web/examples/ssr/pages/singlerange.js on lines 42..82
packages/web/examples/ssr/pages/textfield.js on lines 33..73
packages/web/examples/ssr/pages/togglebutton.js on lines 41..80

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

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