appbaseio/reactivesearch

View on GitHub
packages/native/src/components/range/MultiDropdownRange.js

Summary

Maintainability
F
1 wk
Test Coverage

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

    render() {
        const { color, ...checkBoxStyles } = getInnerKey(this.props.innerStyle, 'checkbox');
        return (
            <View>
                {this.state.showModal ? (
Severity: Major
Found in packages/native/src/components/range/MultiDropdownRange.js - About 4 hrs to fix

    File MultiDropdownRange.js has 308 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* eslint-disable */
    import React, { Component } from 'react';
    import { View, Modal, ListView, TouchableWithoutFeedback } from 'react-native';
    import { CheckBox, Text, Body, Item, Header, Left, Button, Icon, Title, Right } from 'native-base';
    
    
    Severity: Minor
    Found in packages/native/src/components/range/MultiDropdownRange.js - About 3 hrs to fix

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

                              <Header {...getInnerKey(this.props.innerProps, 'header')}>
                                  <Left style={getInnerKey(this.props.innerStyle, 'left')}>
                                      <Button
                                          transparent
                                          onPress={this.toggleModal}
      Severity: Major
      Found in packages/native/src/components/range/MultiDropdownRange.js and 1 other location - About 1 day to fix
      packages/native/src/components/list/MultiDropdownList.js on lines 270..295

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 314.

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

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

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

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

      Refactorings

      Further Reading

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

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

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 210.

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

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

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

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

      Refactorings

      Further Reading

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

          defaultQuery = (values, props) => {
              const generateRangeQuery = (dataField, items) => {
                  if (items.length > 0) {
                      return items.map(value => ({
                          range: {
      Severity: Major
      Found in packages/native/src/components/range/MultiDropdownRange.js and 1 other location - About 5 hrs to fix
      packages/vue/src/components/range/MultiRange.jsx on lines 194..221

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 150.

      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

                                  <Text
                                      numberOfLines={1}
                                      ellipsizeMode="tail"
                                      style={{
                                          flex: 1,
      Severity: Major
      Found in packages/native/src/components/range/MultiDropdownRange.js and 1 other location - About 4 hrs to fix
      packages/native/src/components/list/MultiDropdownList.js on lines 333..355

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

          componentDidMount() {
              this.props.addComponent(this.props.componentId);
              this.setReact(this.props);
      
              if (this.props.selectedValue) {
      Severity: Major
      Found in packages/native/src/components/range/MultiDropdownRange.js and 8 other locations - About 4 hrs to fix
      packages/native/src/components/basic/TextField.js on lines 33..42
      packages/native/src/components/range/SingleDropdownRange.js on lines 34..43
      packages/web/src/components/basic/TextField.js on lines 37..46
      packages/web/src/components/basic/ToggleButton.js on lines 35..44
      packages/web/src/components/date/DatePicker.js on lines 38..47
      packages/web/src/components/range/MultiDropdownRange.js on lines 40..49
      packages/web/src/components/range/MultiRange.js on lines 41..50
      packages/web/src/components/range/SingleDropdownRange.js on lines 37..46

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 117.

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

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

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

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

      Refactorings

      Further Reading

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

      const mapDispatchtoProps = dispatch => ({
          addComponent: component => dispatch(addComponent(component)),
          removeComponent: component => dispatch(removeComponent(component)),
          watchComponent: (component, react) => dispatch(watchComponent(component, react)),
          updateQuery: updateQueryObject => dispatch(updateQuery(updateQueryObject)),
      Severity: Major
      Found in packages/native/src/components/range/MultiDropdownRange.js and 4 other locations - About 3 hrs to fix
      packages/native/src/components/basic/TextField.js on lines 246..253
      packages/native/src/components/date/DatePicker.js on lines 336..343
      packages/native/src/components/date/DateRange.js on lines 501..508
      packages/native/src/components/range/SingleDropdownRange.js on lines 191..198

      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

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

          updateQuery = (value, props) => {
              const query = props.customQuery || this.defaultQuery;
      
              props.updateQuery({
                  componentId: props.componentId,
      Severity: Major
      Found in packages/native/src/components/range/MultiDropdownRange.js and 4 other locations - About 2 hrs to fix
      packages/native/src/components/basic/TextField.js on lines 99..110
      packages/native/src/components/list/MultiDropdownList.js on lines 211..222
      packages/native/src/components/list/SingleDropdownList.js on lines 130..141
      packages/native/src/components/range/SingleDropdownRange.js on lines 105..116

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

      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

                          <Modal
                              supportedOrientations={this.props.supportedOrientations || null}
                              transparent={false}
                              visible={this.state.showModal}
                              onRequestClose={this.toggleModal}
      Severity: Major
      Found in packages/native/src/components/range/MultiDropdownRange.js and 4 other locations - About 1 hr to fix
      packages/native/src/components/date/DatePicker.js on lines 207..298
      packages/native/src/components/date/DateRange.js on lines 368..459
      packages/native/src/components/list/MultiDropdownList.js on lines 263..325
      packages/native/src/components/search/DataSearch.js on lines 337..441

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

      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

                                              <Text
                                                  style={{
                                                      color: this.props.theming.textColor,
                                                      marginLeft: 20,
                                                      ...getInnerKey(this.props.innerStyle, 'label'),
      Severity: Major
      Found in packages/native/src/components/range/MultiDropdownRange.js and 1 other location - About 1 hr to fix
      packages/native/src/components/shared/CheckboxItem.js on lines 34..43

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 67.

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

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

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

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

      Refactorings

      Further Reading

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

      const mapStateToProps = (state, props) => ({
          selectedValue: state.selectedValues[props.componentId]
              ? state.selectedValues[props.componentId].value
              : null,
      });
      Severity: Major
      Found in packages/native/src/components/range/MultiDropdownRange.js and 6 other locations - About 50 mins to fix
      packages/native/src/components/date/DatePicker.js on lines 330..334
      packages/native/src/components/date/DateRange.js on lines 495..499
      packages/web/src/components/basic/NumberBox.js on lines 238..242
      packages/web/src/components/date/DatePicker.js on lines 258..262
      packages/web/src/components/date/DateRange.js on lines 456..460
      packages/web/src/components/range/MultiRange.js on lines 266..270

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

      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

              checkPropChange(this.props.dataField, nextProps.dataField, () => {
                  this.updateQuery(this.state.currentValue, nextProps);
              });
      Severity: Minor
      Found in packages/native/src/components/range/MultiDropdownRange.js and 2 other locations - About 35 mins to fix
      packages/native/src/components/range/SingleDropdownRange.js on lines 48..50
      packages/web/src/components/basic/NumberBox.js on lines 54..56

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

      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

                  currentValue.forEach(value => {
                      this.selectedValues = { ...this.selectedValues, [value.label]: true };
                  });
      Severity: Minor
      Found in packages/native/src/components/range/MultiDropdownRange.js and 1 other location - About 30 mins to fix
      packages/web/src/components/range/MultiDropdownRange.js on lines 137..142

      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