appbaseio/reactivesearch

View on GitHub
packages/maps-native/src/components/maps/ReactiveMap.js

Summary

Maintainability
F
2 wks
Test Coverage

File ReactiveMap.js has 683 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { Component } from 'react';
import { View, StyleSheet, Text } from 'react-native';
import { Button, Icon } from 'native-base';
import { MapView } from 'expo';

Severity: Major
Found in packages/maps-native/src/components/maps/ReactiveMap.js - About 1 day to fix

    Function componentWillReceiveProps has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        componentWillReceiveProps(nextProps) {
            if (
                this.props.sortBy !== nextProps.sortBy
                || this.props.size !== nextProps.size
                || !isEqual(this.props.dataField, nextProps.dataField)
    Severity: Minor
    Found in packages/maps-native/src/components/maps/ReactiveMap.js - About 3 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function componentWillReceiveProps has 81 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        componentWillReceiveProps(nextProps) {
            if (
                this.props.sortBy !== nextProps.sortBy
                || this.props.size !== nextProps.size
                || !isEqual(this.props.dataField, nextProps.dataField)
    Severity: Major
    Found in packages/maps-native/src/components/maps/ReactiveMap.js - About 3 hrs to fix

      Function componentDidMount has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          componentDidMount() {
              this.props.addComponent(this.internalComponent);
              this.props.addComponent(this.props.componentId);
      
              if (this.props.stream) {
      Severity: Minor
      Found in packages/maps-native/src/components/maps/ReactiveMap.js - About 1 hr to fix

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

        const mapStateToProps = (state, props) => ({
            mapKey: state.config.mapKey,
            hits: (state.hits[props.componentId] && state.hits[props.componentId].hits) || [],
            streamHits: state.streamHits[props.componentId] || [],
            currentPage:
        Severity: Minor
        Found in packages/maps-native/src/components/maps/ReactiveMap.js - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function componentDidMount has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            componentDidMount() {
                this.props.addComponent(this.internalComponent);
                this.props.addComponent(this.props.componentId);
        
                if (this.props.stream) {
        Severity: Minor
        Found in packages/maps-native/src/components/maps/ReactiveMap.js - About 25 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            getHitsCenter = (hits) => {
                const data = hits.map(hit => hit[this.props.dataField]);
        
                if (data.length) {
                    const numCoords = data.length;
        Severity: Major
        Found in packages/maps-native/src/components/maps/ReactiveMap.js and 1 other location - About 2 days to fix
        packages/maps/src/components/result/ReactiveMap.js on lines 360..412

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

        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

        const mapStateToProps = (state, props) => ({
            mapKey: state.config.mapKey,
            hits: (state.hits[props.componentId] && state.hits[props.componentId].hits) || [],
            streamHits: state.streamHits[props.componentId] || [],
            currentPage:
        Severity: Major
        Found in packages/maps-native/src/components/maps/ReactiveMap.js and 1 other location - About 1 day to fix
        packages/maps/src/components/result/ReactiveMap.js on lines 1051..1061

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

        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

            loadMore = () => {
                if (
                    this.props.hits
                    && !this.props.pagination
                    && this.props.total !== this.props.hits.length
        Severity: Major
        Found in packages/maps-native/src/components/maps/ReactiveMap.js and 2 other locations - About 1 day to fix
        packages/maps/src/components/result/ReactiveMap.js on lines 495..521
        packages/native/src/components/result/ReactiveList.js on lines 251..277

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

        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

            setPage = (page) => {
                const value = this.props.size * page;
                const options = getQueryOptions(this.props);
                options.from = this.state.from;
                this.setState({
        Severity: Major
        Found in packages/maps-native/src/components/maps/ReactiveMap.js and 1 other location - About 1 day to fix
        packages/maps/src/components/result/ReactiveMap.js on lines 523..550

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

        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

                        <Button
                            onPress={this.nextPage}
                            light={this.state.currentPage < this.state.totalPages - 1}
                            disabled={this.state.currentPage >= this.state.totalPages - 1}
                            style={getInnerKey(this.props.innerStyle, 'button')}
        Severity: Major
        Found in packages/maps-native/src/components/maps/ReactiveMap.js and 1 other location - About 6 hrs to fix
        packages/native/src/components/result/ReactiveList.js on lines 438..450

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

        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

                        <Button
                            light={this.state.currentPage !== 0}
                            disabled={this.state.currentPage === 0}
                            onPress={this.prevPage}
                            style={getInnerKey(this.props.innerStyle, 'button')}
        Severity: Major
        Found in packages/maps-native/src/components/maps/ReactiveMap.js and 1 other location - About 5 hrs to fix
        packages/native/src/components/result/ReactiveList.js on lines 386..398

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

        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

            parseLocation(location) {
                if (Array.isArray(location)) {
                    return {
                        lat: Number(location[0]),
                        lng: Number(location[1]),
        Severity: Major
        Found in packages/maps-native/src/components/maps/ReactiveMap.js and 1 other location - About 5 hrs to fix
        packages/maps/src/components/result/ReactiveMap.js on lines 559..572

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

        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

                        {this.state.currentPage >= this.props.pages ? (
                            <View
                                style={{
                                    height: 45,
                                    display: 'flex',
        Severity: Major
        Found in packages/maps-native/src/components/maps/ReactiveMap.js and 1 other location - About 4 hrs to fix
        packages/native/src/components/result/ReactiveList.js on lines 420..436

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 117.

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

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

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

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

        Refactorings

        Further Reading

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

            setPage = (page) => {
                const value = this.props.size * page;
                const options = getQueryOptions(this.props);
                this.setState({
                    from: value,
        Severity: Major
        Found in packages/maps-native/src/components/maps/ReactiveMap.js and 1 other location - About 3 hrs to fix
        packages/native/src/components/result/ReactiveList.js on lines 279..295

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

        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.pagination
                    && nextProps.hits
                    && this.props.hits
                    && nextProps.hits.length < this.props.hits.length
        Severity: Major
        Found in packages/maps-native/src/components/maps/ReactiveMap.js and 1 other location - About 3 hrs to fix
        packages/maps/src/components/result/ReactiveMap.js on lines 272..285

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

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

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

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

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

        Refactorings

        Further Reading

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

                if (
                    !nextProps.pagination
                    && this.props.hits
                    && nextProps.hits
                    && (this.props.hits.length < nextProps.hits.length
        Severity: Major
        Found in packages/maps-native/src/components/maps/ReactiveMap.js and 2 other locations - About 3 hrs to fix
        packages/maps/src/components/result/ReactiveMap.js on lines 260..270
        packages/native/src/components/result/ReactiveList.js on lines 190..200

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

        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

                this.mapStyles = [
                    { label: 'Standard', value: Standard },
                    { label: 'Blue Essence', value: BlueEssence },
                    { label: 'Blue Water', value: BlueWater },
                    { label: 'Flat Map', value: FlatMap },
        Severity: Major
        Found in packages/maps-native/src/components/maps/ReactiveMap.js and 1 other location - About 3 hrs to fix
        packages/maps/src/components/result/ReactiveMap.js on lines 81..89

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

        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.pagination && nextProps.total !== this.props.total) {
                    this.setState({
                        totalPages: Math.ceil(nextProps.total / nextProps.size),
                        currentPage: this.props.total ? 0 : this.state.currentPage,
                    });
        Severity: Major
        Found in packages/maps-native/src/components/maps/ReactiveMap.js and 1 other location - About 3 hrs to fix
        packages/maps/src/components/result/ReactiveMap.js on lines 287..292

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

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

            setReact = (props) => {
                const { react } = props;
                if (react) {
                    const newReact = pushToAndClause(react, this.internalComponent);
                    props.watchComponent(props.componentId, newReact);
        Severity: Major
        Found in packages/maps-native/src/components/maps/ReactiveMap.js and 14 other locations - About 2 hrs to fix
        packages/maps/src/components/result/ReactiveMap.js on lines 350..358
        packages/native/src/components/list/MultiDropdownList.js on lines 99..107
        packages/native/src/components/list/SingleDropdownList.js on lines 83..91
        packages/native/src/components/range/RangeSlider.js on lines 110..118
        packages/native/src/components/result/ReactiveList.js on lines 241..249
        packages/native/src/components/search/DataSearch.js on lines 108..116
        packages/web/src/components/basic/TagCloud.js on lines 97..107
        packages/web/src/components/list/MultiDropdownList.js on lines 123..133
        packages/web/src/components/list/MultiList.js on lines 117..127
        packages/web/src/components/list/SingleDropdownList.js on lines 112..122
        packages/web/src/components/list/SingleList.js on lines 108..118
        packages/web/src/components/range/RangeSlider.js on lines 115..125
        packages/web/src/components/search/CategorySearch.js on lines 144..154
        packages/web/src/components/search/DataSearch.js on lines 121..131

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

        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 (this.props.defaultMapStyle !== nextProps.defaultMapStyle) {
                    this.setState({
                        currentMapStyle:
                            this.mapStyles.find(style => style.label === nextProps.defaultMapStyle)
                            || this.mapStyles[0],
        Severity: Major
        Found in packages/maps-native/src/components/maps/ReactiveMap.js and 1 other location - About 2 hrs to fix
        packages/maps/src/components/result/ReactiveMap.js on lines 312..318

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

        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

                return this.props.onAllData
                    ? this.props.onAllData(
                        parseHits(this.props.hits),
                        parseHits(this.props.streamHits),
                        this.loadMore,
        Severity: Major
        Found in packages/maps-native/src/components/maps/ReactiveMap.js and 1 other location - About 2 hrs to fix
        packages/maps/src/components/result/ReactiveMap.js on lines 955..963

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

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

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

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

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

        Refactorings

        Further Reading

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

                if (streamResults.length) {
                    const ids = streamResults.map(item => item._id);
                    filteredResults = filteredResults.filter(item => !ids.includes(item._id));
                }
        Severity: Major
        Found in packages/maps-native/src/components/maps/ReactiveMap.js and 4 other locations - About 1 hr to fix
        packages/maps/src/components/result/ReactiveMap.js on lines 863..866
        packages/native/src/components/result/ReactiveList.js on lines 489..492
        packages/vue/src/components/result/ReactiveList.jsx on lines 296..299
        packages/web/src/components/result/ReactiveList.js on lines 529..532

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

        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 (this.props.pagination && this.state.isLoading) {
                    if (nextProps.onPageChange) {
                        nextProps.onPageChange();
                    }
                    this.setState({
        Severity: Major
        Found in packages/maps-native/src/components/maps/ReactiveMap.js and 1 other location - About 1 hr to fix
        packages/maps/src/components/result/ReactiveMap.js on lines 251..258

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

        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

            getStart = () => {
                const midValue = parseInt(this.props.pages / 2, 10);
                const start = this.state.currentPage - midValue;
                return start > 1 ? start : 2;
            };
        Severity: Major
        Found in packages/maps-native/src/components/maps/ReactiveMap.js and 1 other location - About 1 hr to fix
        packages/native/src/components/result/ReactiveList.js on lines 309..313

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 66.

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

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

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

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

        Refactorings

        Further Reading

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

            nextPage = () => {
                if (this.state.currentPage < this.state.totalPages - 1) {
                    this.setPage(this.state.currentPage + 1);
                }
            };
        Severity: Major
        Found in packages/maps-native/src/components/maps/ReactiveMap.js and 1 other location - About 1 hr to fix
        packages/native/src/components/result/ReactiveList.js on lines 303..307

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

        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

                            <Button
                                onPress={() => this.setPage(0)}
                                light={this.state.currentPage !== 0}
                                style={[
                                    ...primaryStyles.button,
        Severity: Major
        Found in packages/maps-native/src/components/maps/ReactiveMap.js and 1 other location - About 1 hr to fix
        packages/native/src/components/result/ReactiveList.js on lines 400..418

        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

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

                if (
                    this.props.sortBy !== nextProps.sortBy
                    || this.props.size !== nextProps.size
                    || !isEqual(this.props.dataField, nextProps.dataField)
                ) {
        Severity: Major
        Found in packages/maps-native/src/components/maps/ReactiveMap.js and 1 other location - About 1 hr to fix
        packages/maps/src/components/result/ReactiveMap.js on lines 182..203

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 61.

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

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

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

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

        Refactorings

        Further Reading

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

            componentWillUnmount() {
                this.props.removeComponent(this.props.componentId);
                this.props.removeComponent(this.internalComponent);
            }
        Severity: Major
        Found in packages/maps-native/src/components/maps/ReactiveMap.js and 15 other locations - About 45 mins to fix
        packages/maps/src/components/result/ReactiveMap.js on lines 345..348
        packages/native/src/components/list/MultiDropdownList.js on lines 94..97
        packages/native/src/components/list/SingleDropdownList.js on lines 78..81
        packages/native/src/components/range/RangeSlider.js on lines 105..108
        packages/native/src/components/search/DataSearch.js on lines 103..106
        packages/web/src/components/basic/TagCloud.js on lines 92..95
        packages/web/src/components/list/MultiDataList.js on lines 100..103
        packages/web/src/components/list/MultiDropdownList.js on lines 118..121
        packages/web/src/components/list/MultiList.js on lines 112..115
        packages/web/src/components/list/SingleDataList.js on lines 88..91
        packages/web/src/components/list/SingleDropdownList.js on lines 107..110
        packages/web/src/components/list/SingleList.js on lines 103..106
        packages/web/src/components/range/RangeSlider.js on lines 110..113
        packages/web/src/components/search/CategorySearch.js on lines 129..132
        packages/web/src/components/search/DataSearch.js on lines 116..119

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

        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

                        <Button
                            key={i - 1}
                            onPress={() => this.setPage(i - 1)}
                            light={this.state.currentPage !== i - 1}
                            style={{
        Severity: Minor
        Found in packages/maps-native/src/components/maps/ReactiveMap.js and 1 other location - About 45 mins to fix
        packages/native/src/components/result/ReactiveList.js on lines 335..352

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

        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

            prevPage = () => {
                if (this.state.currentPage) {
                    this.setPage(this.state.currentPage - 1);
                }
            };
        Severity: Minor
        Found in packages/maps-native/src/components/maps/ReactiveMap.js and 1 other location - About 40 mins to fix
        packages/native/src/components/result/ReactiveList.js on lines 297..301

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

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

                if (this.props.stream !== nextProps.stream) {
                    this.props.setStreaming(nextProps.componentId, nextProps.stream);
                }
        Severity: Major
        Found in packages/maps-native/src/components/maps/ReactiveMap.js and 3 other locations - About 35 mins to fix
        packages/maps/src/components/result/ReactiveMap.js on lines 242..244
        packages/native/src/components/result/ReactiveList.js on lines 182..184
        packages/web/src/components/result/ReactiveList.js on lines 192..194

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

        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 currentMapStyle
                    = this.mapStyles.find(style => style.label === props.defaultMapStyle)
                    || this.mapStyles[0];
        Severity: Minor
        Found in packages/maps-native/src/components/maps/ReactiveMap.js and 1 other location - About 35 mins to fix
        packages/maps/src/components/result/ReactiveMap.js on lines 91..93

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

        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