angliafarmers/ember-material-design-datepicker

View on GitHub

Showing 6 of 12 total issues

File md-datepicker.js has 323 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import Ember from 'ember';
import layout from '../templates/components/md-datepicker';

export default Ember.Component.extend({
  layout,
Severity: Minor
Found in addon/components/md-datepicker.js - About 3 hrs to fix

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

    export default Ember.Component.extend({
      layout,
      classNames: ['md-datepicker-group'],
      locale: null,
      init() {
    Severity: Minor
    Found in addon/components/md-datepicker.js - About 2 hrs to fix

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

        daySpans: Ember.computed('viewingDate', 'selectedDate', 'minDate', 'maxDate', 'hourOffset', function() {
          let viewingDate = this.get('viewingDate');
          let selectedDate = this.get('selectedDate');
          let minDate = this.get('minDate');
          let maxDate = this.get('maxDate');
      Severity: Minor
      Found in addon/components/md-datepicker.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 daySpans has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        daySpans: Ember.computed('viewingDate', 'selectedDate', 'minDate', 'maxDate', 'hourOffset', function() {
          let viewingDate = this.get('viewingDate');
          let selectedDate = this.get('selectedDate');
          let minDate = this.get('minDate');
          let maxDate = this.get('maxDate');
      Severity: Minor
      Found in addon/components/md-datepicker.js - About 1 hr to fix

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

            dateClicked(dayspan) {
              let date = dayspan.date;
              let isValid = true;
        
              // Preserve selected time
        Severity: Minor
        Found in addon/components/md-datepicker.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 keyUp has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            keyUp() {
              this.set('isDirty', true);
        
              let dateText = this.get('dateText');
              let isValid = this.get('isValidDate');
        Severity: Minor
        Found in addon/components/md-datepicker.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