busy-web/ember-date-time

View on GitHub
addon/components/ember-date-range-picker.js

Summary

Maintainability
F
1 wk
Test Coverage

File ember-date-range-picker.js has 718 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * @module Components
 *
 */
import $ from 'jquery';
Severity: Major
Found in addon/components/ember-date-range-picker.js - About 1 day to fix

    Function getInterval has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

        getInterval(direction=0) {
            let { span, type } = get(this, 'selected');
            let start, end;
            if (!isEmpty(type) && !isNone(span)) {
                start = _time(getStart(this)).valueOf();
    Severity: Minor
    Found in addon/components/ember-date-range-picker.js - About 4 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

    Function setup has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        setup: on('init', function() {
            const isUnix = !isNone(get(this, 'startUnix')) || !isNone(get(this, 'endUnix'));
            set(this, '_isUnix', isUnix);
    
            // get locale converted format str
    Severity: Minor
    Found in addon/components/ember-date-range-picker.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

    Function setup has 85 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        setup: on('init', function() {
            const isUnix = !isNone(get(this, 'startUnix')) || !isNone(get(this, 'endUnix'));
            set(this, '_isUnix', isUnix);
    
            // get locale converted format str
    Severity: Major
    Found in addon/components/ember-date-range-picker.js - About 3 hrs to fix

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

          selectedDateRange: computed('selected', '_start', '_end', 'format', function() {
              const { id } = get(this, 'selected');
              const start = _time(getStart(this));
              const end = _time(getEnd(this));
              let isCurrent = false;
      Severity: Minor
      Found in addon/components/ember-date-range-picker.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

      `` has 24 functions (exceeds 20 allowed). Consider refactoring.
      Open

      export default Component.extend({
          /**
           * @private
           * @property classNames
           * @type String
      Severity: Minor
      Found in addon/components/ember-date-range-picker.js - About 2 hrs to fix

        Function handleAltKeys has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

        function handleAltKeys(target, keyName, isOpen) {
            if (keyName === '/') {
                target.send('toggleList');
            } else {
                let selectedId = get(target, 'selected.id');
        Severity: Minor
        Found in addon/components/ember-date-range-picker.js - About 2 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

        Function selectedDateRange has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            selectedDateRange: computed('selected', '_start', '_end', 'format', function() {
                const { id } = get(this, 'selected');
                const start = _time(getStart(this));
                const end = _time(getEnd(this));
                let isCurrent = false;
        Severity: Minor
        Found in addon/components/ember-date-range-picker.js - About 1 hr to fix

          Function updateDates has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

              updateDates(type, time, calendar, singleSet=false) {
                  let isStart = get(this, 'isStart');
                  if (!get(this, 'allowCustom')) {
                      isStart = true;
                  }
          Severity: Minor
          Found in addon/components/ember-date-range-picker.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 getInterval has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              getInterval(direction=0) {
                  let { span, type } = get(this, 'selected');
                  let start, end;
                  if (!isEmpty(type) && !isNone(span)) {
                      start = _time(getStart(this)).valueOf();
          Severity: Minor
          Found in addon/components/ember-date-range-picker.js - About 1 hr to fix

            Function keyDownEventHandler has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function keyDownEventHandler(target) {
                return function(event) {
                    let isOpen = get(target, 'isListOpen');
                    let handler = keyEvent({ event });
                    if (event.altKey) {
            Severity: Minor
            Found in addon/components/ember-date-range-picker.js - About 1 hr to fix

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

                  updateDates(type, time, calendar, singleSet=false) {
                      let isStart = get(this, 'isStart');
                      if (!get(this, 'allowCustom')) {
                          isStart = true;
                      }
              Severity: Minor
              Found in addon/components/ember-date-range-picker.js - About 1 hr to fix

                Function setState has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    setState() {
                        let start = getStart(this);
                        let end = getEnd(this);
                
                        let timestamp = start;
                Severity: Minor
                Found in addon/components/ember-date-range-picker.js - About 1 hr to fix

                  Function getDefaultAction has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      getDefaultAction() {
                          if (get(this, 'isCustom')) {
                              const span = _time.daysApart(getStart(this), getEnd(this)) + 1;
                              return EmberObject.create({name: loc('Custom'), span, type: 'days'});
                          } else if (!isEmpty(get(this, 'defaultAction'))) {
                  Severity: Minor
                  Found in addon/components/ember-date-range-picker.js - About 1 hr to fix

                    Avoid deeply nested control flow statements.
                    Open

                                    if (isOpen) {
                                        nextListItem(target);
                                    }
                    Severity: Major
                    Found in addon/components/ember-date-range-picker.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                  } else if (handler.keyName === 'ArrowUp') {
                                      if (isOpen) {
                                          prevListItem(target);
                                      }
                                  } else if (handler.keyName === 'Enter') {
                      Severity: Major
                      Found in addon/components/ember-date-range-picker.js - About 45 mins to fix

                        Function setSelected has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            setSelected(id) {
                                // reset selected list
                                get(this, '__actionList').forEach(item => set(item, 'selected', false));
                        
                                let selected;
                        Severity: Minor
                        Found in addon/components/ember-date-range-picker.js - About 45 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 (!isOpen) {
                                                target.send('selectCustom');
                                            }
                        Severity: Major
                        Found in addon/components/ember-date-range-picker.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if (start < __start) {
                                                      __start = _time(__start).subtract(7, 'days').valueOf();
                                                  }
                          Severity: Major
                          Found in addon/components/ember-date-range-picker.js - About 45 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                            return i18n('last_week');
                            Severity: Major
                            Found in addon/components/ember-date-range-picker.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                          return classify(start.format('MMMM'));
                              Severity: Major
                              Found in addon/components/ember-date-range-picker.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                            return `${start.format('MMM D')}`;
                                Severity: Major
                                Found in addon/components/ember-date-range-picker.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                              return `${start.format('MMM D')} - ${end.format('MMM D')}`;
                                  Severity: Major
                                  Found in addon/components/ember-date-range-picker.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                                    return i18n('this_day');
                                    Severity: Major
                                    Found in addon/components/ember-date-range-picker.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                                      return i18n('next_day');
                                      Severity: Major
                                      Found in addon/components/ember-date-range-picker.js - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                                        return start.format('dddd');
                                        Severity: Major
                                        Found in addon/components/ember-date-range-picker.js - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                                      return `${start.format('ll')} - ${end.format('ll')}`;
                                          Severity: Major
                                          Found in addon/components/ember-date-range-picker.js - About 30 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                            return `${start.format('MMM D')} - ${end.format('MMM D YYYY')}`;
                                            Severity: Major
                                            Found in addon/components/ember-date-range-picker.js - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                              return i18n('last_day');
                                              Severity: Major
                                              Found in addon/components/ember-date-range-picker.js - About 30 mins to fix

                                                Avoid too many return statements within this function.
                                                Open

                                                                return i18n('next_week');
                                                Severity: Major
                                                Found in addon/components/ember-date-range-picker.js - About 30 mins to fix

                                                  Avoid too many return statements within this function.
                                                  Open

                                                              return `${start.format('MMM D')} - ${end.format('MMM D')}`;
                                                  Severity: Major
                                                  Found in addon/components/ember-date-range-picker.js - About 30 mins to fix

                                                    Avoid too many return statements within this function.
                                                    Open

                                                                    return i18n('this_week');
                                                    Severity: Major
                                                    Found in addon/components/ember-date-range-picker.js - About 30 mins to fix

                                                      Avoid too many return statements within this function.
                                                      Open

                                                                      return `${start.format('MMM D YYYY')} - ${end.format('MMM D YYYY')}`;
                                                      Severity: Major
                                                      Found in addon/components/ember-date-range-picker.js - About 30 mins to fix

                                                        Avoid too many return statements within this function.
                                                        Open

                                                                        return `${start.format('MMM D')} - ${end.format('MMM D YYYY')}`;
                                                        Severity: Major
                                                        Found in addon/components/ember-date-range-picker.js - About 30 mins to fix

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

                                                                  if (!get(this, 'changeFired') && (!isNone(this.getAttr('endTime')) || !isNone(this.getAttr('endUnix')))) {
                                                                      setEnd(this, setUserEnd(this, (this.getAttr('endTime') || this.getAttr('endUnix'))));
                                                                  } else if (isNone(getEnd(this))) {
                                                                      setEnd(this, _time().timestamp());
                                                                  }
                                                          Severity: Major
                                                          Found in addon/components/ember-date-range-picker.js and 1 other location - About 4 hrs to fix
                                                          addon/components/ember-date-range-picker.js on lines 232..236

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

                                                                  if (!get(this, 'changeFired') && (!isNone(this.getAttr('startTime')) || !isNone(this.getAttr('startUnix')))) {
                                                                      setStart(this, setUserStart(this, (this.getAttr('startTime') || this.getAttr('startUnix'))));
                                                                  } else if (isNone(getStart(this))) {
                                                                      setStart(this, _time().timestamp());
                                                                  }
                                                          Severity: Major
                                                          Found in addon/components/ember-date-range-picker.js and 1 other location - About 4 hrs to fix
                                                          addon/components/ember-date-range-picker.js on lines 238..242

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

                                                          function getUserStart(target) {
                                                              let time = getStart(target);
                                                              if (get(target, 'utc')) {
                                                                  time = _time.utcFromLocal(time).timestamp();
                                                              }
                                                          Severity: Major
                                                          Found in addon/components/ember-date-range-picker.js and 1 other location - About 2 hrs to fix
                                                          addon/components/ember-date-range-picker.js on lines 801..811

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

                                                          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

                                                          function getUserEnd(target) {
                                                              let time = getEnd(target);
                                                              if (get(target, 'utc')) {
                                                                  time = _time.utcFromLocal(time).timestamp();
                                                              }
                                                          Severity: Major
                                                          Found in addon/components/ember-date-range-picker.js and 1 other location - About 2 hrs to fix
                                                          addon/components/ember-date-range-picker.js on lines 789..799

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

                                                          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

                                                          function setUserEnd(target, time) {
                                                              if (get(target, '_isUnix')) {
                                                                  time = _time.unix(time).timestamp();
                                                              }
                                                          
                                                          
                                                          Severity: Major
                                                          Found in addon/components/ember-date-range-picker.js and 1 other location - About 2 hrs to fix
                                                          addon/components/ember-date-range-picker.js on lines 813..822

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 81.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                          function setUserStart(target, time) {
                                                              if (get(target, '_isUnix')) {
                                                                  time = _time.unix(time).timestamp();
                                                              }
                                                          
                                                          
                                                          Severity: Major
                                                          Found in addon/components/ember-date-range-picker.js and 1 other location - About 2 hrs to fix
                                                          addon/components/ember-date-range-picker.js on lines 824..833

                                                          Duplicated Code

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

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

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

                                                          Tuning

                                                          This issue has a mass of 81.

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

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

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

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

                                                          Refactorings

                                                          Further Reading

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

                                                                      } else if (_time().year() === start.year() && _time().week() === start.week()) {
                                                                          return start.format('dddd');
                                                                      } else if (_time().year() !== start.year()) {
                                                                          return `${start.format('MMM D')} - ${end.format('MMM D YYYY')}`;
                                                                      }
                                                          Severity: Major
                                                          Found in addon/components/ember-date-range-picker.js and 1 other location - About 1 hr to fix
                                                          addon/components/ember-date-range-picker.js on lines 177..181

                                                          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

                                                                      } else if (_time().year() !== start.year() && start.year() !== end.year()) {
                                                                          return `${start.format('MMM D YYYY')} - ${end.format('MMM D YYYY')}`;
                                                                      } else if (_time().year() !== start.year()) {
                                                                          return `${start.format('MMM D')} - ${end.format('MMM D YYYY')}`;
                                                                      }
                                                          Severity: Major
                                                          Found in addon/components/ember-date-range-picker.js and 1 other location - About 1 hr to fix
                                                          addon/components/ember-date-range-picker.js on lines 190..194

                                                          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

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

                                                          function setEnd(target, time) {
                                                              time = _time(time).endOf('day').valueOf();
                                                              if (getEnd(target) !== time) {
                                                                  set(target, '_end', time);
                                                              }
                                                          Severity: Major
                                                          Found in addon/components/ember-date-range-picker.js and 1 other location - About 1 hr to fix
                                                          addon/components/ember-date-range-picker.js on lines 843..848

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

                                                          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

                                                          function setStart(target, time) {
                                                              time = _time(time).startOf('day').valueOf();
                                                              if (getStart(target) !== time) {
                                                                  set(target, '_start', time);
                                                              }
                                                          Severity: Major
                                                          Found in addon/components/ember-date-range-picker.js and 1 other location - About 1 hr to fix
                                                          addon/components/ember-date-range-picker.js on lines 850..855

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

                                                          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

                                                                      actionList.push(EmberObject.create({id: 'weekly', name: loc('Weekly'), span: 1, type: 'weeks', sort: 200, selected: false}));
                                                          Severity: Minor
                                                          Found in addon/components/ember-date-range-picker.js and 1 other location - About 55 mins to fix
                                                          addon/components/ember-date-range-picker.js on lines 312..312

                                                          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

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

                                                                      actionList.push(EmberObject.create({id: 'monthly', name: loc('Monthly'), span: 1, type: 'months', sort: 300, selected: false}));
                                                          Severity: Minor
                                                          Found in addon/components/ember-date-range-picker.js and 1 other location - About 55 mins to fix
                                                          addon/components/ember-date-range-picker.js on lines 311..311

                                                          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

                                                          There are no issues that match your filters.

                                                          Category
                                                          Status