busy-web/ember-date-time

View on GitHub

Showing 94 of 144 total issues

Avoid deeply nested control flow statements.
Open

                    if (!isNone(minDate)) { min = _time.utcToLocal(minDate).timestamp(); }
Severity: Major
Found in addon/components/ember-date-time-picker.js - About 45 mins to fix

    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 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 createSVGPath has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          export function createSVGPath(totalSlices, degree, x, y, start, end) {
          Severity: Minor
          Found in addon/utils/clock/math.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if (!isNone(maxDate)) { max = _time.utcToLocal(maxDate).timestamp(); }
            Severity: Major
            Found in addon/components/ember-date-time-picker.js - About 45 mins to fix

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

                  unselectPlot(value) {
                      const { text, arm, plot } = this.at(value);
                      let next, prev;
                      if (this.has('plot', value - this.selectRounder)) {
                          prev = this.at(value - this.selectRounder);
              Severity: Minor
              Found in addon/utils/clock/svg.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

              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) {
                                  nextListItem(target);
                              }
              Severity: Major
              Found in addon/components/ember-date-range-picker.js - About 45 mins to fix

                Function onMove has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                export function onMove(angleStart, cx, cy, x, y, cb=function(){}) {
                Severity: Minor
                Found in addon/utils/clock/movement.js - About 45 mins to fix

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

                  _time.isDateAfter = function(date, maxDate) {
                      let isAfter = false;
                      if (!isNone(maxDate)) {
                          if (typeof maxDate === 'number' && !isNaN(maxDate)) {
                              maxDate = _time(maxDate);
                  Severity: Minor
                  Found in addon/utils/time.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

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

                  function getInBoundsDate(date, min, max) {
                      const adjustTime = (d1, d2) => {
                          if (d1.hours() < d2.hours()) d2.hours(d1.hours());
                          if (d1.minutes() < d2.minutes()) d2.minutes(d1.minutes());
                          if (d1.seconds() < d2.seconds()) d2.seconds(d1.seconds());
                  Severity: Minor
                  Found in addon/components/private/date-input.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

                  Function setListener has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  function setListener(type, namespace, listener, capture=false, passive=false) {
                  Severity: Minor
                  Found in addon/utils/event.js - About 35 mins to fix

                    Function getCursorPosition has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    export function getCursorPosition(format, value, index, isAdd=false, isSub=false) {
                    Severity: Minor
                    Found in addon/utils/format.js - About 35 mins to fix

                      Function bind has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      export function bind(target, type, namespace, listener, { capture=false, rebind=false, passive=false, once=false }) {
                      Severity: Minor
                      Found in addon/utils/event.js - About 35 mins to fix

                        Function createPoints has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export function createPoints(start, end, rounder, selectRounder) {
                            if (selectRounder <= 0) {
                                selectRounder = 1;
                            }
                        
                        
                        Severity: Minor
                        Found in addon/utils/clock/data.js - About 35 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 setDateSection has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            setDateSection(valueSection, position) {
                                let { sectionFormat, start, end } = getMeta(this);
                                let { min, max } = sectionBounds(this);
                        
                                // moves the start ahead on position when the valueSection
                        Severity: Minor
                        Found in addon/components/private/date-input.js - About 35 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 getDate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export function getDate(type, value, timestamp) {
                            const time = _time(timestamp);
                            if (type === HOUR_FLAG) {
                                if (value === 12) {
                                    value = 0;
                        Severity: Minor
                        Found in addon/utils/clock/data.js - About 35 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 too many return statements within this function.
                        Open

                                return null;
                        Severity: Major
                        Found in addon/utils/time.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
                            Severity
                            Category
                            Status
                            Source
                            Language