crmis/weddings

View on GitHub

Showing 135 of 334 total issues

Avoid deeply nested control flow statements.
Open

                for (i2 = i + 1; i2 < len; i2++) {
                    if (format.charAt(i2) == ']') {
                        var subformat = format.substring(i + 1, i2);
                        var subres = formatDate(date, subformat, options);
                        if (subres != formatDate(otherDate, subformat, options)) {
Severity: Major
Found in app/assets/javascripts/viewable_fullcalendar.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if (format.charAt(i2) == ')') {
                            var subres = formatDate(date, format.substring(i + 1, i2), options);
                            if (parseInt(subres.replace(/\D/, ''), 10)) {
                                res += subres;
                            }
    Severity: Major
    Found in app/assets/javascripts/viewable_fullcalendar.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                  if (helperRes) {
                                      rect.position = 'absolute';
                                      selectionHelper = $(helperRes)
                                          .css(rect)
                                          .appendTo(slotContainer);
      Severity: Major
      Found in app/assets/javascripts/viewable_fullcalendar.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if (date) {
                                    if (i2 == i + 1) {
                                        res += "'";
                                    } else {
                                        res += format.substring(i + 1, i2);
        Severity: Major
        Found in app/assets/javascripts/viewable_fullcalendar.js - About 45 mins to fix

          Consider simplifying this complex logical expression.
          Open

                  if (ignoreTimezone || !m[13]) {
                      var check = new Date(m[1], 0, 1, 9, 0);
                      if (m[3]) {
                          date.setMonth(m[3] - 1);
                          check.setMonth(m[3] - 1);
          Severity: Major
          Found in app/assets/javascripts/viewable_fullcalendar.js - About 40 mins to fix

            Consider simplifying this complex logical expression.
            Open

                                        if (!support.rgba && value._rgba[3] !== 1) {
                                            curElem = hook === "backgroundColor" ? elem.parentNode : elem;
                                            while (
                                            (backgroundColor === "" || backgroundColor === "transparent") &&
                                            curElem && curElem.style
            Severity: Major
            Found in app/assets/javascripts/viewable_calendar-editable.js - About 40 mins to fix

              Consider simplifying this complex logical expression.
              Open

                      if (o.mode === "toggle" && mode === "show") {
                          el.from = o.to || zero;
                          el.to = o.from || original;
                      } else {
                          el.from = o.from || ( mode === "show" ? zero : original );
              Severity: Major
              Found in app/assets/javascripts/viewable_calendar-editable.js - About 40 mins to fix

                Consider simplifying this complex logical expression.
                Open

                                if (
                                    inst.options.greedy && !inst.options.disabled &&
                                    inst.options.scope === draggable.options.scope &&
                                    inst.accept.call(inst.element[0], (draggable.currentItem || draggable.element)) &&
                                    $.ui.intersect(draggable, $.extend(inst, {offset: inst.element.offset()}), inst.options.tolerance)
                Severity: Major
                Found in app/assets/javascripts/viewable_calendar-editable.js - About 40 mins to fix

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

                          t.rect = function (row0, col0, row1, col1, originElement) { // row1,col1 is inclusive
                  Severity: Minor
                  Found in app/assets/javascripts/viewable_fullcalendar.js - About 35 mins to fix

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

                                switchClass: function (remove, add, speed, easing, callback) {
                    Severity: Minor
                    Found in app/assets/javascripts/viewable_calendar-editable.js - About 35 mins to fix

                      Method store_location has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def store_location
                          # store last url - this is needed for post-login redirect to whatever the user last visited.
                          return unless request.get?
                          if (request.path != "/users/sign_in" &&
                            request.path != "/users/sign_up" &&
                      Severity: Minor
                      Found in app/controllers/application_controller.rb - 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;
                      Severity: Major
                      Found in app/assets/javascripts/viewable_calendar-editable.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return false;
                        Severity: Major
                        Found in app/assets/javascripts/viewable_calendar-editable.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return null;
                          Severity: Major
                          Found in app/assets/javascripts/viewable_fullcalendar.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                        return true;
                            Severity: Major
                            Found in app/assets/javascripts/viewable_calendar-editable.js - About 30 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language