appbaseio/reactivesearch

View on GitHub

Showing 1,376 of 1,376 total issues

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

    componentWillReceiveProps(nextProps) {
        if (!isEqual(this.props.range, nextProps.range) && nextProps.range) {
            this.updateQueryOptions(nextProps, nextProps.range);
            // floor and ceil to take edge cases into account
            this.updateRange({
Severity: Major
Found in packages/web/src/components/range/DynamicRangeSlider.js - About 2 hrs to fix

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

            if (this.props.defaultSelected !== nextProps.defaultSelected) {
                this.setValue(nextProps.defaultSelected);
            } else if (this.state.currentValue !== nextProps.selectedValue) {
                this.setValue(nextProps.selectedValue || '');
            }
    Severity: Major
    Found in packages/web/src/components/list/SingleDataList.js and 3 other locations - About 2 hrs to fix
    packages/native/src/components/list/SingleDropdownList.js on lines 71..75
    packages/web/src/components/list/SingleDropdownList.js on lines 100..104
    packages/web/src/components/list/SingleList.js on lines 96..100

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 81.

    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.defaultSelected !== nextProps.defaultSelected) {
                this.setValue(nextProps.defaultSelected);
            } else if (this.state.currentValue !== nextProps.selectedValue) {
                this.setValue(nextProps.selectedValue || '');
            }
    Severity: Major
    Found in packages/native/src/components/list/SingleDropdownList.js and 3 other locations - About 2 hrs to fix
    packages/web/src/components/list/SingleDataList.js on lines 81..85
    packages/web/src/components/list/SingleDropdownList.js on lines 100..104
    packages/web/src/components/list/SingleList.js on lines 96..100

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 81.

    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.defaultSelected !== nextProps.defaultSelected) {
                this.setValue(nextProps.defaultSelected);
            } else if (this.state.currentValue !== nextProps.selectedValue) {
                this.setValue(nextProps.selectedValue || '');
            }
    Severity: Major
    Found in packages/web/src/components/list/SingleList.js and 3 other locations - About 2 hrs to fix
    packages/native/src/components/list/SingleDropdownList.js on lines 71..75
    packages/web/src/components/list/SingleDataList.js on lines 81..85
    packages/web/src/components/list/SingleDropdownList.js on lines 100..104

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

    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.defaultSelected !== nextProps.defaultSelected) {
                this.setValue(nextProps.defaultSelected);
            } else if (this.state.currentValue !== nextProps.selectedValue) {
                this.setValue(nextProps.selectedValue || '');
            }
    Severity: Major
    Found in packages/web/src/components/list/SingleDropdownList.js and 3 other locations - About 2 hrs to fix
    packages/native/src/components/list/SingleDropdownList.js on lines 71..75
    packages/web/src/components/list/SingleDataList.js on lines 81..85
    packages/web/src/components/list/SingleList.js on lines 96..100

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 81.

    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

                                            let selected
                                                = this.props.multi
                                                // MultiDropdownList
                                                && ((selectedItem && !!selectedItem[item[keyField]])
                                                    // MultiDropdownRange
    Severity: Major
    Found in packages/web/src/components/shared/Dropdown.js and 1 other location - About 2 hrs to fix
    packages/vue/src/components/shared/DropDown.jsx on lines 128..134

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

    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

                                                let selected
                                                    = this.$props.multi // MultiDropdownList
                                                    && ((selectedItem && !!selectedItem[item[keyField]]) // MultiDropdownRange
                                                        || (Array.isArray(selectedItem)
                                                            && selectedItem.find(
    Severity: Major
    Found in packages/vue/src/components/shared/DropDown.jsx and 1 other location - About 2 hrs to fix
    packages/web/src/components/shared/Dropdown.js on lines 168..175

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

    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

    File index.js has 261 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import Appbase from 'appbase-js';
    
    import valueReducer from '@appbaseio/reactivecore/lib/reducers/valueReducer';
    import queryReducer from '@appbaseio/reactivecore/lib/reducers/queryReducer';
    import queryOptionsReducer from '@appbaseio/reactivecore/lib/reducers/queryOptionsReducer';
    Severity: Minor
    Found in packages/web/src/server/index.js - About 2 hrs to fix

      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

              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/src/components/result/ReactiveMap.js and 1 other location - About 2 hrs to fix
      packages/maps-native/src/components/maps/ReactiveMap.js on lines 201..207

      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

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

      const singleDropdownRangeProps = {
          componentId: 'BookSensor',
          dataField: 'average_rating',
          data: [
              { start: 0, end: 3, label: 'Rating < 3' },
      Severity: Major
      Found in packages/web/examples/ssr/pages/singledropdownrange.js and 1 other location - About 2 hrs to fix
      packages/web/examples/ssr/pages/singlerange.js on lines 20..29

      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

      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

      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/GeoDistanceDropdown.js and 1 other location - About 2 hrs to fix
      packages/maps/src/components/basic/GeoDistanceSlider.js on lines 562..569

      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

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

      const singleRangeProps = {
          componentId: 'BookSensor',
          dataField: 'average_rating',
          data: [
              { start: 0, end: 3, label: 'Rating < 3' },
      Severity: Major
      Found in packages/web/examples/ssr/pages/singlerange.js and 1 other location - About 2 hrs to fix
      packages/web/examples/ssr/pages/singledropdownrange.js on lines 20..29

      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

      Function setStore has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              setStore(props) {
                  const credentials
                      = props.url && props.url.trim() !== '' && !props.credentials
                          ? null
                          : props.credentials;
      Severity: Major
      Found in packages/vue/src/components/ReactiveBase/index.jsx - About 2 hrs to fix

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

            componentWillReceiveProps(nextProps) {
                this.currentSelectedState = nextProps.selectedValues;
                if (!isEqual(this.props.selectedValues, nextProps.selectedValues)) {
                    const searchParams = this.props.getSearchParams
                      ? this.props.getSearchParams()
        Severity: Major
        Found in packages/web/src/components/basic/URLParamsProvider.js - About 2 hrs to fix

          Function mounted has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              mounted() {
                  this.addComponent(this.internalComponent);
                  this.addComponent(this.$props.componentId);
          
                  if (this.$props.stream) {
          Severity: Major
          Found in packages/vue/src/components/result/ReactiveList.jsx - About 2 hrs to fix

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

                render() {
                    const {
                        className, style, themePreset, ...rest
                    } = this.props;
                    return (
            Severity: Major
            Found in packages/web/src/components/range/RangeInput.js - About 2 hrs to fix

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

              const reactiveListProps = {
                  componentId: 'SearchResult',
                  dataField: 'original_title.raw',
                  className: 'result-list-container',
                  from: 0,
              Severity: Major
              Found in packages/web/examples/ssr/pages/multidropdownlist.js and 7 other locations - About 2 hrs to fix
              packages/web/examples/ssr/pages/categorysearch.js on lines 27..37
              packages/web/examples/ssr/pages/datasearch.js on lines 22..32
              packages/web/examples/ssr/pages/multilist.js on lines 22..32
              packages/web/examples/ssr/pages/numberbox.js on lines 27..37
              packages/web/examples/ssr/pages/singledropdownlist.js on lines 27..37
              packages/web/examples/ssr/pages/singlelist.js on lines 22..32
              packages/web/examples/ssr/pages/textfield.js on lines 21..31

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

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

              const reactiveListProps = {
                  componentId: 'SearchResult',
                  dataField: 'original_title.raw',
                  className: 'result-list-container',
                  from: 0,
              Severity: Major
              Found in packages/web/examples/ssr/pages/multilist.js and 7 other locations - About 2 hrs to fix
              packages/web/examples/ssr/pages/categorysearch.js on lines 27..37
              packages/web/examples/ssr/pages/datasearch.js on lines 22..32
              packages/web/examples/ssr/pages/multidropdownlist.js on lines 27..37
              packages/web/examples/ssr/pages/numberbox.js on lines 27..37
              packages/web/examples/ssr/pages/singledropdownlist.js on lines 27..37
              packages/web/examples/ssr/pages/singlelist.js on lines 22..32
              packages/web/examples/ssr/pages/textfield.js on lines 21..31

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

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

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

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

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

              Refactorings

              Further Reading

              Severity
              Category
              Status
              Source
              Language