appbaseio/reactivesearch

View on GitHub
packages/web/src/components/list/MultiList.js

Summary

Maintainability
F
2 wks
Test Coverage

File MultiList.js has 513 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { Component } from 'react';

import {
    addComponent,
    removeComponent,
Severity: Major
Found in packages/web/src/components/list/MultiList.js - About 1 day to fix

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

        render() {
            const {
                selectAllLabel, renderListItem, showLoadMore, loadMoreLabel,
            } = this.props;
            const { isLastBucket } = this.state;
    Severity: Major
    Found in packages/web/src/components/list/MultiList.js - About 4 hrs to fix

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

          componentWillReceiveProps(nextProps) {
              checkPropChange(this.props.react, nextProps.react, () => this.setReact(nextProps));
              checkPropChange(this.props.options, nextProps.options, () => {
                  const { showLoadMore, dataField } = nextProps;
                  if (showLoadMore) {
      Severity: Minor
      Found in packages/web/src/components/list/MultiList.js - About 1 hr to fix

        Function render has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            render() {
                const {
                    selectAllLabel, renderListItem, showLoadMore, loadMoreLabel,
                } = this.props;
                const { isLastBucket } = this.state;
        Severity: Minor
        Found in packages/web/src/components/list/MultiList.js - About 55 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

        Avoid deeply nested control flow statements.
        Open

                            if (hasMissingTerm) {
                                should = should.concat({
                                    bool: {
                                        must_not: {
                                            exists: { field: props.dataField },
        Severity: Major
        Found in packages/web/src/components/list/MultiList.js - About 45 mins to fix

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

              componentWillReceiveProps(nextProps) {
                  checkPropChange(this.props.react, nextProps.react, () => this.setReact(nextProps));
                  checkPropChange(this.props.options, nextProps.options, () => {
                      const { showLoadMore, dataField } = nextProps;
                      if (showLoadMore) {
          Severity: Minor
          Found in packages/web/src/components/list/MultiList.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

              static defaultQuery = (value, props) => {
                  let query = null;
                  const type = props.queryFormat === 'or' ? 'terms' : 'term';
          
                  if (!Array.isArray(value) || value.length === 0) {
          Severity: Major
          Found in packages/web/src/components/list/MultiList.js and 1 other location - About 2 days to fix
          packages/web/src/components/list/MultiDropdownList.js on lines 135..216

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

          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

          MultiList.propTypes = {
              addComponent: types.funcRequired,
              removeComponent: types.funcRequired,
              setQueryListener: types.funcRequired,
              setQueryOptions: types.funcRequired,
          Severity: Major
          Found in packages/web/src/components/list/MultiList.js and 1 other location - About 2 days to fix
          packages/web/src/components/list/SingleList.js on lines 390..433

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

          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 (
                      selectAllLabel
                      && ((Array.isArray(value) && value.includes(selectAllLabel))
                          || (typeof value === 'string' && value === selectAllLabel))
                  ) {
          Severity: Major
          Found in packages/web/src/components/list/MultiList.js and 1 other location - About 1 day to fix
          packages/vue/src/components/list/MultiList.jsx on lines 269..317

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

          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

                              {selectAllLabel ? (
                                  <li
                                      key={selectAllLabel}
                                      className={`${this.state.currentValue[selectAllLabel] ? 'active' : ''}`}
                                  >
          Severity: Major
          Found in packages/web/src/components/list/MultiList.js and 1 other location - About 1 day to fix
          packages/web/src/components/list/MultiDataList.js on lines 348..369

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

          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

                  checkPropChange(this.props.options, nextProps.options, () => {
                      const { showLoadMore, dataField } = nextProps;
                      if (showLoadMore) {
                          const { buckets } = nextProps.options[dataField];
                          const after = nextProps.options[dataField].after_key;
          Severity: Major
          Found in packages/web/src/components/list/MultiList.js and 1 other location - About 1 day to fix
          packages/web/src/components/list/SingleList.js on lines 67..87

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

          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

                                          <label
                                              className={getClassName(this.props.innerClass, 'label') || null}
                                              htmlFor={`${this.props.componentId}-${item.key}`}
                                          >
                                              {renderListItem ? (
          Severity: Major
          Found in packages/web/src/components/list/MultiList.js and 1 other location - About 6 hrs to fix
          packages/web/src/components/list/SingleList.js on lines 352..375

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

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

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

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

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

          Refactorings

          Further Reading

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

              componentWillMount() {
                  this.props.addComponent(this.internalComponent);
                  this.props.addComponent(this.props.componentId);
                  this.updateQueryOptions(this.props);
          
          
          Severity: Major
          Found in packages/web/src/components/list/MultiList.js and 3 other locations - About 5 hrs to fix
          packages/native/src/components/list/MultiDropdownList.js on lines 45..57
          packages/web/src/components/basic/TagCloud.js on lines 47..59
          packages/web/src/components/list/MultiDropdownList.js on lines 45..57

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

          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 mapDispatchtoProps = dispatch => ({
              addComponent: component => dispatch(addComponent(component)),
              removeComponent: component => dispatch(removeComponent(component)),
              setQueryOptions: (component, props) => dispatch(setQueryOptions(component, props)),
              loadMore: (component, aggsQuery) => dispatch(loadMore(component, aggsQuery, true, true)),
          Severity: Major
          Found in packages/web/src/components/list/MultiList.js and 1 other location - About 5 hrs to fix
          packages/web/src/components/list/SingleList.js on lines 465..474

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

          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) => ({
              options:
                  props.nestedField && state.aggregations[props.componentId]
                      ? state.aggregations[props.componentId].reactivesearch_nested
                      : state.aggregations[props.componentId],
          Severity: Major
          Found in packages/web/src/components/list/MultiList.js and 1 other location - About 5 hrs to fix
          packages/web/src/components/list/MultiDropdownList.js on lines 444..455

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

          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

                                          <Checkbox
                                              className={
                                                  getClassName(this.props.innerClass, 'checkbox') || null
                                              }
                                              id={`${this.props.componentId}-${item.key}`}
          Severity: Major
          Found in packages/web/src/components/list/MultiList.js and 2 other locations - About 5 hrs to fix
          packages/web/src/components/list/MultiDataList.js on lines 384..394
          packages/web/src/components/range/MultiRange.js on lines 205..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 142.

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

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

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

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

          Refactorings

          Further Reading

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

              renderSearch = () => {
                  if (this.props.showSearch) {
                      return (
                          <Input
                              className={getClassName(this.props.innerClass, 'input') || null}
          Severity: Major
          Found in packages/web/src/components/list/MultiList.js and 3 other locations - About 4 hrs to fix
          packages/web/src/components/list/MultiDataList.js on lines 309..325
          packages/web/src/components/list/SingleDataList.js on lines 227..243
          packages/web/src/components/list/SingleList.js on lines 247..263

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

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

                              {itemsToRender
                                  .filter((item) => {
                                      if (String(item.key).length) {
                                          if (this.props.showSearch && this.state.searchTerm) {
                                              return String(item.key)
          Severity: Major
          Found in packages/web/src/components/list/MultiList.js and 5 other locations - About 3 hrs to fix
          packages/vue/src/components/list/MultiList.jsx on lines 183..240
          packages/vue/src/components/list/SingleList.jsx on lines 169..232
          packages/vue/src/components/shared/DropDown.jsx on lines 113..194
          packages/web/src/components/shared/Dropdown.js on lines 155..231
          packages/web/src/components/list/SingleList.js on lines 323..377

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

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

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

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

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

          Refactorings

          Further Reading

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

              updateQueryOptions = (props, addAfterKey = false) => {
                  // when using composite aggs flush the current options for a fresh query
                  if (props.showLoadMore && !addAfterKey) {
                      this.setState({
                          options: [],
          Severity: Major
          Found in packages/web/src/components/list/MultiList.js and 3 other locations - About 3 hrs to fix
          packages/web/src/components/list/MultiDropdownList.js on lines 305..318
          packages/web/src/components/list/SingleDropdownList.js on lines 210..223
          packages/web/src/components/list/SingleList.js on lines 220..233

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

              updateQuery = (value, props) => {
                  const query = props.customQuery || MultiList.defaultQuery;
          
                  props.updateQuery({
                      componentId: props.componentId,
          Severity: Major
          Found in packages/web/src/components/list/MultiList.js and 10 other locations - About 3 hrs to fix
          packages/web/src/components/basic/TagCloud.js on lines 202..214
          packages/web/src/components/date/DatePicker.js on lines 152..164
          packages/web/src/components/list/MultiDropdownList.js on lines 284..296
          packages/web/src/components/list/SingleDropdownList.js on lines 189..201
          packages/web/src/components/list/SingleList.js on lines 199..211
          packages/web/src/components/range/MultiDropdownRange.js on lines 170..182
          packages/web/src/components/range/MultiRange.js on lines 173..185
          packages/web/src/components/range/RatingsFilter.js on lines 138..150
          packages/web/src/components/range/SingleDropdownRange.js on lines 131..143
          packages/web/src/components/range/SingleRange.js on lines 127..139

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

          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/web/src/components/list/MultiList.js and 14 other locations - About 2 hrs to fix
          packages/maps-native/src/components/maps/ReactiveMap.js on lines 215..223
          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/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 3 locations. Consider refactoring.
          Open

                  if (!isEqual(this.props.defaultSelected, nextProps.defaultSelected)) {
                      this.setValue(nextProps.defaultSelected, true);
                  } else if (!isEqual(selectedValue, nextProps.selectedValue)) {
                      this.setValue(nextProps.selectedValue || [], true);
                  }
          Severity: Major
          Found in packages/web/src/components/list/MultiList.js and 2 other locations - About 2 hrs to fix
          packages/native/src/components/list/MultiDropdownList.js on lines 87..91
          packages/web/src/components/list/MultiDropdownList.js on lines 111..115

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

          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

              getOptions = (buckets, props) => {
                  if (props.showLoadMore) {
                      return buckets.map(bucket => ({
                          key: bucket.key[props.dataField],
                          doc_count: bucket.doc_count,
          Severity: Major
          Found in packages/web/src/components/list/MultiList.js and 1 other location - About 1 hr to fix
          packages/web/src/components/list/SingleList.js on lines 120..129

          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

          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/web/src/components/list/MultiList.js and 22 other locations - About 1 hr to fix
          packages/maps/src/components/basic/GeoDistanceDropdown.js on lines 447..451
          packages/maps/src/components/basic/GeoDistanceSlider.js on lines 455..459
          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/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

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

              handleLoadMore = () => {
                  const queryOptions = MultiList.generateQueryOptions(this.props, this.state.after);
                  this.props.loadMore(this.props.componentId, queryOptions);
              };
          Severity: Major
          Found in packages/web/src/components/list/MultiList.js and 1 other location - About 1 hr to fix
          packages/web/src/components/list/SingleList.js on lines 242..245

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 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

                  checkSomePropChange(this.props, nextProps, ['dataField', 'nestedField'], () => {
                      this.updateQueryOptions(nextProps);
                      this.updateQuery(Object.keys(this.state.currentValue), nextProps);
                  });
          Severity: Major
          Found in packages/web/src/components/list/MultiList.js and 1 other location - About 1 hr to fix
          packages/web/src/components/basic/TagCloud.js on lines 74..77

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

                      options:
                          props.options && props.options[props.dataField]
                              ? this.getOptions(props.options[props.dataField].buckets, props)
                              : [],
          Severity: Major
          Found in packages/web/src/components/list/MultiList.js and 1 other location - About 1 hr to fix
          packages/web/src/components/list/SingleList.js on lines 38..41

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

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

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

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

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

          Refactorings

          Further Reading

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

                                      <li
                                          key={item.key}
                                          className={`${this.state.currentValue[item.key] ? 'active' : ''}`}
                                      >
                                          <Checkbox
          Severity: Major
          Found in packages/web/src/components/list/MultiList.js and 3 other locations - About 55 mins to fix
          packages/vue/src/components/list/MultiList.jsx on lines 198..239
          packages/web/src/components/list/MultiDataList.js on lines 380..419
          packages/web/src/components/range/MultiRange.js on lines 201..220

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 54.

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

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

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

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

          Refactorings

          Further Reading

          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/web/src/components/list/MultiList.js and 15 other locations - About 45 mins to fix
          packages/maps-native/src/components/maps/ReactiveMap.js on lines 210..213
          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/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 4 locations. Consider refactoring.
          Open

              static generateQueryOptions(props, after) {
                  const queryOptions = getQueryOptions(props);
                  return props.showLoadMore
                      ? getCompositeAggsQuery(queryOptions, props, after)
                      : getAggsQuery(queryOptions, props);
          Severity: Major
          Found in packages/web/src/components/list/MultiList.js and 3 other locations - About 30 mins to fix
          packages/web/src/components/list/MultiDropdownList.js on lines 298..303
          packages/web/src/components/list/SingleDropdownList.js on lines 203..208
          packages/web/src/components/list/SingleList.js on lines 213..218

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

          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

              handleInputChange = (e) => {
                  const { value } = e.target;
                  this.setState({
                      searchTerm: value,
                  });
          Severity: Major
          Found in packages/web/src/components/list/MultiList.js and 4 other locations - About 30 mins to fix
          packages/web/src/components/shared/Dropdown.js on lines 67..72
          packages/web/src/components/list/MultiDataList.js on lines 302..307
          packages/web/src/components/list/SingleDataList.js on lines 220..225
          packages/web/src/components/list/SingleList.js on lines 235..240

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

          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