appbaseio/reactivesearch

View on GitHub
packages/maps/src/components/basic/GeoDistanceSlider.js

Summary

Maintainability
F
1 wk
Test Coverage

File GeoDistanceSlider.js has 533 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { Component } from 'react';
import Downshift from 'downshift';
import { withTheme } from 'emotion-theming';

import {
Severity: Major
Found in packages/maps/src/components/basic/GeoDistanceSlider.js - About 1 day to fix

    GeoDistanceSlider has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class GeoDistanceSlider extends Component {
        constructor(props) {
            super(props);
    
            this.state = {
    Severity: Minor
    Found in packages/maps/src/components/basic/GeoDistanceSlider.js - About 2 hrs to fix

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

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

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

            componentWillReceiveProps(nextProps) {
                checkPropChange(this.props.react, nextProps.react, () => this.setReact(nextProps));
        
                checkSomePropChange(this.props, nextProps, ['dataField', 'nestedField'], () => {
                    this.updateQuery(this.state.currentDistance, nextProps);
        Severity: Minor
        Found in packages/maps/src/components/basic/GeoDistanceSlider.js - About 1 hr to fix

          Function componentWillMount has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              componentWillMount() {
                  this.props.addComponent(this.props.componentId);
                  this.setReact(this.props);
          
                  if (this.props.selectedValue && this.props.selectedValue.location) {
          Severity: Minor
          Found in packages/maps/src/components/basic/GeoDistanceSlider.js - About 1 hr to fix

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

                renderSearchBox = () => {
                    let suggestionsList = [...this.state.suggestions];
                    const { theme, themePreset } = this.props;
            
                    if (this.state.userLocation) {
            Severity: Major
            Found in packages/maps/src/components/basic/GeoDistanceSlider.js and 1 other location - About 3 days to fix
            packages/maps/src/components/basic/GeoDistanceDropdown.js on lines 363..442

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

            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

                onInputChange = (e) => {
                    const { value } = e.target;
                    this.setState({
                        currentLocation: value,
                    });
            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 302..339

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

            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

                getUserLocation() {
                    navigator.geolocation.getCurrentPosition((location) => {
                        const coordinates = `${location.coords.latitude}, ${location.coords.longitude}`;
            
                        fetch(
            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 168..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 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

            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

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

                                <div className={rangeLabelsContainer}>
                                    <RangeLabel
                                        align="left"
                                        className={getClassName(this.props.innerClass, 'label') || null}
                                    >
            Severity: Major
            Found in packages/maps/src/components/basic/GeoDistanceSlider.js and 1 other location - About 5 hrs to fix
            packages/web/src/components/range/RangeSlider.js on lines 323..336

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 135.

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

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

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

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

            Refactorings

            Further Reading

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

                defaultQuery = (coordinates, distance, props) => {
                    let query = null;
                    if (coordinates && distance) {
                        query = {
                            [this.type]: {
            Severity: Major
            Found in packages/maps/src/components/basic/GeoDistanceSlider.js and 1 other location - About 4 hrs to fix
            packages/maps/src/components/basic/GeoDistanceDropdown.js on lines 143..166

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

            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

                    } else if (this.props.defaultSelected && this.props.defaultSelected.location) {
                        this.setState(
                            {
                                currentLocation: this.props.defaultSelected.location,
                            },
            Severity: Major
            Found in packages/maps/src/components/basic/GeoDistanceSlider.js and 1 other location - About 3 hrs to fix
            packages/maps/src/components/basic/GeoDistanceSlider.js on lines 62..88

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

            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

                    if (this.props.selectedValue && this.props.selectedValue.location) {
                        this.setState(
                            {
                                currentLocation: this.props.selectedValue.location,
                            },
            Severity: Major
            Found in packages/maps/src/components/basic/GeoDistanceSlider.js and 1 other location - About 3 hrs to fix
            packages/maps/src/components/basic/GeoDistanceSlider.js on lines 75..88

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

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

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

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

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

            Refactorings

            Further Reading

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

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

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 103.

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

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

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

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

            Refactorings

            Further Reading

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

            const mapStateToProps = (state, props) => ({
                mapKey: state.config.mapKey,
                selectedValue:
                    (state.selectedValues[props.componentId]
                        && state.selectedValues[props.componentId].value)
            Severity: Major
            Found in packages/maps/src/components/basic/GeoDistanceSlider.js and 1 other location - About 2 hrs to fix
            packages/maps/src/components/basic/GeoDistanceDropdown.js on lines 523..530

            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

                    } else if (
                        nextProps.selectedValue
                        && nextProps.selectedValue.distance
                        && nextProps.selectedValue.location
                        && !isEqual(this.state.currentLocation, nextProps.selectedValue.location)
            Severity: Major
            Found in packages/maps/src/components/basic/GeoDistanceSlider.js and 1 other location - About 2 hrs to fix
            packages/maps/src/components/basic/GeoDistanceDropdown.js on lines 100..120

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 76.

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

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

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

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

            Refactorings

            Further Reading

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

                    props.updateQuery({
                        componentId: props.componentId,
                        query: query(this.coordinates, distance, props),
                        value,
                        label: props.filterLabel,
            Severity: Major
            Found in packages/maps/src/components/basic/GeoDistanceSlider.js and 1 other location - About 1 hr to fix
            packages/maps/src/components/basic/GeoDistanceDropdown.js on lines 281..288

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

            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

                handleStateChange = (changes) => {
                    const { isOpen, type } = changes;
                    if (type === Downshift.stateChangeTypes.mouseUp) {
                        this.setState({
                            isOpen,
            Severity: Major
            Found in packages/maps/src/components/basic/GeoDistanceSlider.js and 4 other locations - About 1 hr to fix
            packages/maps/src/components/basic/GeoDistanceDropdown.js on lines 354..361
            packages/web/src/components/shared/Dropdown.js on lines 48..55
            packages/web/src/components/search/CategorySearch.js on lines 434..441
            packages/web/src/components/search/DataSearch.js on lines 388..395

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

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

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

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

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

            Refactorings

            Further Reading

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

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

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 62.

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

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

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

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

            Refactorings

            Further Reading

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

                handleFocus = (event) => {
                    this.setState({
                        isOpen: true,
                    });
                    if (this.props.onFocus) {
            Severity: Major
            Found in packages/maps/src/components/basic/GeoDistanceSlider.js and 3 other locations - About 1 hr to fix
            packages/maps/src/components/basic/GeoDistanceDropdown.js on lines 341..348
            packages/web/src/components/search/CategorySearch.js on lines 376..383
            packages/web/src/components/search/DataSearch.js on lines 340..347

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

            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

                    if (
                        nextProps.defaultSelected
                        && nextProps.defaultSelected.distance
                        && nextProps.defaultSelected.location
                        && !isEqual(this.props.defaultSelected, nextProps.defaultSelected)
            Severity: Minor
            Found in packages/maps/src/components/basic/GeoDistanceSlider.js and 1 other location - About 55 mins to fix
            packages/maps/src/components/basic/GeoDistanceDropdown.js on lines 93..120

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

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

                renderIcon = () => {
                    if (this.props.showIcon) {
                        return this.props.icon || <SearchSvg />;
                    }
                    return null;
            Severity: Major
            Found in packages/maps/src/components/basic/GeoDistanceSlider.js and 6 other locations - About 40 mins to fix
            packages/maps/src/components/basic/GeoDistanceDropdown.js on lines 291..296
            packages/web/src/components/basic/TextField.js on lines 155..160
            packages/web/src/components/search/CategorySearch.js on lines 458..463
            packages/web/src/components/search/CategorySearch.js on lines 465..470
            packages/web/src/components/search/DataSearch.js on lines 412..417
            packages/web/src/components/search/DataSearch.js on lines 419..424

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

            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