KennethanCeyer/pg-calendar

View on GitHub

Showing 17 of 72 total issues

Function renderer has 379 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      local.renderer = () => {
        local.calendar.appendTo($parent.empty());
        local.calendar.find('.' + classNames.top + '-year').text(local.dateManager.year);
        local.calendar.find('.' + classNames.top + '-month').text(context.settings.monthsLong[local.dateManager.month - 1]);
        local.calendar.find(helper.format('.{0}-prev .{0}-value', classNames.top)).text(context.settings.months[local.dateManager.prevMonth - 1].toUpperCase());
Severity: Major
Found in src/js/methods/init.js - About 1 day to fix

    File init.js has 662 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    define([
      '../manager/index',
      '../component/classNames',
      '../component/helper',
      '../component/models',
    Severity: Major
    Found in src/js/methods/init.js - About 1 day to fix

      Function exports has 201 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function (grunt) {
        'use strict';
        // Project configuration
        grunt.initConfig({
          // Metadata
      Severity: Major
      Found in Gruntfile.js - About 1 day to fix

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

              const validDateArea = (startDate, endDate) => {
                let date;
        
                for (const idx in context.settings.disabledDates) {
                  date = moment(context.settings.disabledDates[idx]);
        Severity: Minor
        Found in src/js/methods/init.js - About 1 hr to fix

          Function generateDateRange has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                const generateDateRange = () => {
                  if (
                    !local.current[0] ||
                    !local.current[1]
                  ) {
          Severity: Minor
          Found in src/js/methods/init.js - About 1 hr to fix

            Avoid deeply nested control flow statements.
            Open

                          if (iDate.diff(moment(disabledRange[0])) >= 0 && iDate.diff(moment(disabledRange[1])) <= 0) {
                            $unit.addClass(helper.getSubClass('unitDisabled')).addClass(helper.getSubClass('unitDisabledRange')).addClass(helper.getSubClass('unitDisabledMultipleRange'));
                            break;
                          }
            Severity: Major
            Found in src/js/methods/init.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                if (context.settings.multiple === true) {
                                  local.calendar.find('.' + rangeClass).removeClass(rangeClass).removeClass(rangeFirstClass).removeClass(rangeLastClass);
                                  generateDateRange.call();
                                }
              Severity: Major
              Found in src/js/methods/init.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                  if (context.settings.toggle === true) {
                                    const match = local.storage.activeDates.filter(function (e, i) {
                                      return e === date;
                                    });
                                    local.current[position] = moment(date);
                Severity: Major
                Found in src/js/methods/init.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                if ((currentFormat[1] && iDateFormat === currentFormat[1])) {
                                  $unit.addClass(activeClass).addClass(activePositionClasses[1]);
                                }
                  Severity: Major
                  Found in src/js/methods/init.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                  if ((currentFormat[0] && iDateFormat === currentFormat[0])) {
                                    $unit.addClass(activeClass).addClass(activePositionClasses[0]);
                                  }
                    Severity: Major
                    Found in src/js/methods/init.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                    if ((currentFormat[0] && iDateFormat === currentFormat[0]) &&
                                      $.inArray(currentFormat[0], context.settings.disabledDates) === -1 &&
                                      (context.settings.enabledDates.length < 1 || $.inArray(currentFormat[0], context.settings.enabledDates) !== -1)) {
                                      $unit.addClass(activeClass).addClass(activePositionClasses[0]);
                                    }
                      Severity: Major
                      Found in src/js/methods/init.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                          if (context.settings.schedules.length > 0) {
                                            local.storage.schedules = context.settings.schedules.filter(event => {
                                              return event.date === date;
                                            });
                                          }
                        Severity: Major
                        Found in src/js/methods/init.js - About 45 mins to fix

                          Consider simplifying this complex logical expression.
                          Open

                              if (context.settings.lang !== language.defaultLanguage &&
                                $.inArray(context.settings.lang, global.languages.supports) !== -1) {
                                // weeks
                                context.settings.weeks = global.languages.weeks[context.settings.lang] ||
                                  global.languages.weeks[language.defaultLanguage];
                          Severity: Major
                          Found in src/js/methods/configure.js - About 40 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                    return true;
                            Severity: Major
                            Found in src/js/methods/init.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                          return false;
                              Severity: Major
                              Found in src/js/methods/init.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                        return true;
                                Severity: Major
                                Found in src/js/methods/init.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                            return false;
                                  Severity: Major
                                  Found in src/js/methods/init.js - About 30 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language