appbaseio/reactivesearch

View on GitHub
packages/native/src/components/date/DateRange.js

Summary

Maintainability
F
1 wk
Test Coverage

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

    render() {
        let markedDates = {};
        const current = this.state.currentDate
            ? this.state.currentDate.start.dateString
            : this.props.startDate || Date();
Severity: Major
Found in packages/native/src/components/date/DateRange.js - About 7 hrs to fix

    File DateRange.js has 475 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React, { Component } from 'react';
    import { View, Modal, TouchableWithoutFeedback, Platform } from 'react-native';
    import { Calendar } from 'react-native-calendars';
    import { Text, Body, Item, Header, Left, Button, Icon, Title, Right } from 'native-base';
    
    
    Severity: Minor
    Found in packages/native/src/components/date/DateRange.js - About 7 hrs to fix

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

          render() {
              let markedDates = {};
              const current = this.state.currentDate
                  ? this.state.currentDate.start.dateString
                  : this.props.startDate || Date();
      Severity: Minor
      Found in packages/native/src/components/date/DateRange.js - About 3 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Consider simplifying this complex logical expression.
      Open

                  if (this.state.currentDate.end) {
                      const range = this.getDateRange(
                          new XDate(this.state.currentDate.start.timestamp),
                          new XDate(this.state.currentDate.end.timestamp),
                      );
      Severity: Critical
      Found in packages/native/src/components/date/DateRange.js - About 3 hrs to fix

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

            componentWillReceiveProps(nextProps) {
                checkPropChange(this.props.react, nextProps.react, () => this.setReact(nextProps));
        
                let startDate = null;
                let endDate = null;
        Severity: Minor
        Found in packages/native/src/components/date/DateRange.js - About 1 hr to fix

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

              componentWillReceiveProps(nextProps) {
                  checkPropChange(this.props.react, nextProps.react, () => this.setReact(nextProps));
          
                  let startDate = null;
                  let endDate = null;
          Severity: Minor
          Found in packages/native/src/components/date/DateRange.js - About 1 hr to fix

          Cognitive Complexity

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

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

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

          Further reading

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

              componentDidMount() {
                  this.props.addComponent(this.props.componentId);
                  this.setReact(this.props);
          
                  let startDate = null;
          Severity: Minor
          Found in packages/native/src/components/date/DateRange.js - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                    if (this.state.currentDate) {
                        markedDates = {
                            [this.state.currentDate.start.dateString]: {
                                startingDay: true,
                                color:
            Severity: Major
            Found in packages/native/src/components/date/DateRange.js - About 1 hr to fix

              Similar 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/date/DateRange.js and 1 other location - About 2 days to fix
              packages/native/src/components/date/DatePicker.js on lines 214..262

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

              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

                              markedDates[this.state.currentDate.end.dateString] = {
                                  endingDay: true,
                                  color:
                                      this.props.innerProps
                                      && this.props.innerProps.calendar
              Severity: Major
              Found in packages/native/src/components/date/DateRange.js and 1 other location - About 1 day to fix
              packages/native/src/components/date/DateRange.js on lines 271..287

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

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

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

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

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

              Refactorings

              Further Reading

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

                              [this.state.currentDate.start.dateString]: {
                                  startingDay: true,
                                  color:
                                      this.props.innerProps
                                      && this.props.innerProps.calendar
              Severity: Major
              Found in packages/native/src/components/date/DateRange.js and 1 other location - About 1 day to fix
              packages/native/src/components/date/DateRange.js on lines 312..328

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

              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

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

              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

                                  {this.state.currentDate && this.state.currentDate.end ? (
                                      <Button
                                          onPress={this.toggleModal}
                                          style={{
                                              width: '100%',
              Severity: Major
              Found in packages/native/src/components/date/DateRange.js and 1 other location - About 6 hrs to fix
              packages/native/src/components/date/DatePicker.js on lines 274..297

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

              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 (startDate) {
                          this.handleDateChange(
                              {
                                  dateString: new XDate(startDate).toString('yyyy-MM-dd'),
                                  timestamp: new XDate(startDate).getTime(),
              Severity: Major
              Found in packages/native/src/components/date/DateRange.js and 1 other location - About 4 hrs to fix
              packages/native/src/components/date/DateRange.js on lines 53..68

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

              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 (startDate) {
                          this.handleDateChange(
                              {
                                  dateString: new XDate(startDate).toString('yyyy-MM-dd'),
                                  timestamp: new XDate(startDate).getTime(),
              Severity: Major
              Found in packages/native/src/components/date/DateRange.js and 1 other location - About 4 hrs to fix
              packages/native/src/components/date/DateRange.js on lines 88..108

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

              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={{
                                              flex: 1,
                                              alignItems: 'center',
                                              color: this.state.currentDate
              Severity: Major
              Found in packages/native/src/components/date/DateRange.js and 1 other location - About 4 hrs to fix
              packages/native/src/components/date/DatePicker.js on lines 184..204

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

              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/date/DateRange.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/range/MultiDropdownRange.js on lines 329..336
              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 2 locations. Consider refactoring.
              Open

                                  <Calendar
                                      current={current}
                                      onDayPress={this.handleDateChange}
                                      markedDates={markedDates}
                                      markingType="period"
              Severity: Major
              Found in packages/native/src/components/date/DateRange.js and 1 other location - About 2 hrs to fix
              packages/native/src/components/date/DatePicker.js on lines 263..273

              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

              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/date/DateRange.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/list/MultiDropdownList.js on lines 263..325
              packages/native/src/components/range/MultiDropdownRange.js on lines 181..252
              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

              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/date/DateRange.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/range/MultiDropdownRange.js on lines 323..327
              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

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

                              <Item
                                  regular
                                  style={{ marginLeft: 0, ...this.props.style }}
                                  {...getInnerKey(this.props.innerProps, 'item')}
                              >
              Severity: Minor
              Found in packages/native/src/components/date/DateRange.js and 2 other locations - About 40 mins to fix
              packages/native/src/components/basic/TextField.js on lines 132..195
              packages/native/src/components/date/DatePicker.js on lines 178..206

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 48.

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

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

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

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

              Refactorings

              Further Reading

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

                      } else if (this.props.defaultSelected) {
                          startDate = this.props.defaultSelected.start;
                          endDate = this.props.defaultSelected.end || null;
                      }
              Severity: Minor
              Found in packages/native/src/components/date/DateRange.js and 1 other location - About 35 mins to fix
              packages/native/src/components/date/DateRange.js on lines 45..51

              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

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

                      if (this.props.selectedValue) {
                          startDate = this.props.selectedValue.start;
                          endDate = this.props.selectedValue.end || null;
                      } else if (this.props.defaultSelected) {
                          startDate = this.props.defaultSelected.start;
              Severity: Minor
              Found in packages/native/src/components/date/DateRange.js and 1 other location - About 35 mins to fix
              packages/native/src/components/date/DateRange.js on lines 48..51

              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

              There are no issues that match your filters.

              Category
              Status