busy-web/ember-date-time

View on GitHub

Showing 94 of 144 total issues

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

    File date-input.js has 699 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

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

      Function setupTime has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
      Open

          setupTime() {
              let timestamp = get(this, 'timestamp');
              let unix = get(this, 'unix');
              let minDate = get(this, 'minDate');
              let maxDate = get(this, 'maxDate');
      Severity: Minor
      Found in addon/components/ember-date-time-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 upDownArrows has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
      Open

          upDownArrows(keyName) {
              const { sectionFormat, start, end } = getMeta(this);
              const type = sectionFormatType(this);
              let _date = get(this, '_date');
      
      
      Severity: Minor
      Found in addon/components/private/date-input.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 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 buildDaysArrayForMonth has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

        buildDaysArrayForMonth: function() {
              const calendarDate = get(this, 'calendarDate');
          const minDate =    get(this, 'stateManager.minDate');
          const maxDate = get(this, 'stateManager.maxDate');
              let [ startRange, endRange ] = (get(this, 'stateManager.range') || []);
      Severity: Minor
      Found in addon/components/private/date-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 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

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

        /**
         * @module Components
         *
         */
        import $ from 'jquery';
        Severity: Minor
        Found in addon/components/ember-date-time-picker.js - About 2 hrs to fix

          `` 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 upDownArrows has 59 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                upDownArrows(keyName) {
                    const { sectionFormat, start, end } = getMeta(this);
                    const type = sectionFormatType(this);
                    let _date = get(this, '_date');
            
            
            Severity: Major
            Found in addon/components/private/date-input.js - About 2 hrs to fix

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

              export default TextField.extend({
                  classNames: ['busyweb', 'emberdatetime', 'p-date-input'],
                  classNameBindings: ['isDateInRange::invalid', 'active'],
              
                  type: 'text',
              Severity: Minor
              Found in addon/components/private/date-input.js - About 2 hrs to fix

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

                    setActiveState(options={}) {
                        if (isNone(get(this, 'stateManager'))) {
                            this.setState();
                        }
                
                
                Severity: Minor
                Found in addon/components/ember-date-time-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 keyDown has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                Open

                    keyDown(event) {
                        if (isModifierKeyActive(this, event)) {
                            return true;
                        }
                
                
                Severity: Minor
                Found in addon/components/private/date-input.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 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

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

                export default Component.extend({
                    classNames: ['busyweb', 'emberdatetime', 'p-time-picker'],
                    layout: layout,
                
                    stateManager: null,
                Severity: Minor
                Found in addon/components/private/time-picker.js - About 2 hrs to fix

                  Function buildDaysArrayForMonth has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    buildDaysArrayForMonth: function() {
                          const calendarDate = get(this, 'calendarDate');
                      const minDate =    get(this, 'stateManager.minDate');
                      const maxDate = get(this, 'stateManager.maxDate');
                          let [ startRange, endRange ] = (get(this, 'stateManager.range') || []);
                  Severity: Major
                  Found in addon/components/private/date-picker.js - About 2 hrs to fix

                    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

                      Severity
                      Category
                      Status
                      Source
                      Language