busy-web/ember-date-time

View on GitHub

Showing 94 of 144 total issues

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 HOUR_FLAG;
    Severity: Major
    Found in addon/utils/time.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return MERIDIAN_FLAG;
      Severity: Major
      Found in addon/utils/time.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return /A|a/;
        Severity: Major
        Found in addon/utils/time.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return handler.preventDefault();
          Severity: Major
          Found in addon/components/private/date-input.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

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

                      changeSection(section) {
                          if (section === MERIDIAN_FLAG) {
                              section = HOUR_FLAG;
                          }
                  
                  
                  Severity: Minor
                  Found in addon/components/private/time-picker.js - About 25 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

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

                      clean(start, end) {
                          for(let i=start; i<=end; i++) {
                              if (i%this.selectRounder === 0) {
                                  const { text, arm, plot } = this.at(i);
                                  if (!isNone(text)) {
                  Severity: Minor
                  Found in addon/utils/clock/svg.js - About 25 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

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

                      saveTimestamp(date) {
                          if (!get(this, 'isDestroyed') && get(this, 'timestamp') !== date.valueOf()) {
                              const bounds = isInBounds(date, get(this, 'minDate'), get(this, 'maxDate'));
                              if (bounds.isBefore || bounds.isAfter) {
                                  set(this, 'invalidTime', true);
                  Severity: Minor
                  Found in addon/components/private/time-picker.js - About 25 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

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

                      isDateInRange: computed('value', function() {
                          // before render the position has not been set so
                          // resume calculations as if position were 0
                          let position = 0;
                          if (this.$() && this.$().length && !isEmpty(getData(this.$(), 'format'))) {
                  Severity: Minor
                  Found in addon/components/private/date-input.js - About 25 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

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

                      setActiveTime() {
                          if (get(this, '_state') === 'inDOM') {
                              const value = this.getCurrentTimeByType(get(this, 'section'));
                              if (!isNone(value)) {
                                  const clock = metaFor(this, get(this, 'section'));
                  Severity: Minor
                  Found in addon/components/private/time-picker.js - About 25 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

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

                      focusState(section) {
                          let el = this.$(`input`);
                          if (el && el.length) {
                              let index;
                              if (!isEmpty(section)) {
                  Severity: Minor
                  Found in addon/components/ember-date-time-picker.js - About 25 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Severity
                  Category
                  Status
                  Source
                  Language