MiraitSystems/enju_trunk

View on GitHub
app/assets/javascripts/jquery.simplecalendarjp.js

Summary

Maintainability
F
2 wks
Test Coverage

File jquery.simplecalendarjp.js has 1751 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 *-------------------------------------
 * redmine風のシンプルカレンダープラグイン
 * copyright DQNEO 2011
 * http://dqn.sakusakutto.jp/
Severity: Major
Found in app/assets/javascripts/jquery.simplecalendarjp.js - About 4 days to fix

    Function create has 209 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Calendar.prototype.create = function (_par) {
        var parent = null;
        if (! _par) {
            // default parent is the document body, in which case we create
            // a popup calendar.
    Severity: Major
    Found in app/assets/javascripts/jquery.simplecalendarjp.js - About 1 day to fix

      Function setup has 131 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Calendar.setup = function (params) {
          function param_default(pname, def) { if (typeof params[pname] == "undefined") { params[pname] = def; } };
      
          param_default("inputField",     null);
          param_default("displayArea",    null);
      Severity: Major
      Found in app/assets/javascripts/jquery.simplecalendarjp.js - About 5 hrs to fix

        Function cellClick has 122 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Calendar.cellClick = function(el, ev) {
            var cal = el.calendar;
            var closing = false;
            var newdate = false;
            var date = null;
        Severity: Major
        Found in app/assets/javascripts/jquery.simplecalendarjp.js - About 4 hrs to fix

          Function _keyEvent has 112 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Calendar._keyEvent = function(ev) {
              var cal = window._dynarch_popupCalendar;
              if (!cal || cal.multiple)
                  return false;
              (Calendar.is_ie) && (ev = window.event);
          Severity: Major
          Found in app/assets/javascripts/jquery.simplecalendarjp.js - About 4 hrs to fix

            Function _init has 104 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Calendar.prototype._init = function (firstDayOfWeek, date) {
                var today = new Date(),
                    TY = today.getFullYear(),
                    TM = today.getMonth(),
                    TD = today.getDate();
            Severity: Major
            Found in app/assets/javascripts/jquery.simplecalendarjp.js - About 4 hrs to fix

              Function parseDate has 86 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Date.parseDate = function(str, fmt) {
                  var today = new Date();
                  var y = 0;
                  var m = -1;
                  var d = 0;
              Severity: Major
              Found in app/assets/javascripts/jquery.simplecalendarjp.js - About 3 hrs to fix

                Function tableMouseOver has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                Calendar.tableMouseOver = function (ev) {
                    var cal = Calendar._C;
                    if (!cal) {
                        return;
                    }
                Severity: Major
                Found in app/assets/javascripts/jquery.simplecalendarjp.js - About 3 hrs to fix

                  Function showAtElement has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  Calendar.prototype.showAtElement = function (el, opts) {
                      var self = this;
                      var p = Calendar.getAbsolutePos(el);
                      if (!opts || typeof opts != "string") {
                          this.showAt(p.x, p.y + el.offsetHeight);
                  Severity: Major
                  Found in app/assets/javascripts/jquery.simplecalendarjp.js - About 2 hrs to fix

                    Function print has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    Date.prototype.print = function (str) {
                        var m = this.getMonth();
                        var d = this.getDate();
                        var y = this.getFullYear();
                        var wn = this.getWeekNumber();
                    Severity: Major
                    Found in app/assets/javascripts/jquery.simplecalendarjp.js - About 2 hrs to fix

                      Function hideShowCovered has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      Calendar.prototype.hideShowCovered = function () {
                          if (!Calendar.is_ie && !Calendar.is_opera)
                              return;
                          function getVisib(obj){
                              var value = obj.style.visibility;
                      Severity: Minor
                      Found in app/assets/javascripts/jquery.simplecalendarjp.js - About 1 hr to fix

                        Function tableMouseUp has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        Calendar.tableMouseUp = function(ev) {
                            var cal = Calendar._C;
                            if (!cal) {
                                return false;
                            }
                        Severity: Minor
                        Found in app/assets/javascripts/jquery.simplecalendarjp.js - About 1 hr to fix

                          Function showYearsCombo has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          Calendar.showYearsCombo = function (fwd) {
                              var cal = Calendar._C;
                              if (!cal) {
                                  return false;
                              }
                          Severity: Minor
                          Found in app/assets/javascripts/jquery.simplecalendarjp.js - About 1 hr to fix

                            Function dayMouseDown has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            Calendar.dayMouseDown = function(ev) {
                                var el = Calendar.getElement(ev);
                                if (el.disabled) {
                                    return false;
                                }
                            Severity: Minor
                            Found in app/assets/javascripts/jquery.simplecalendarjp.js - About 1 hr to fix

                              Function fixPosition has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function fixPosition(box) {
                                      if (box.x < 0)
                                          box.x = 0;
                                      if (box.y < 0)
                                          box.y = 0;
                              Severity: Minor
                              Found in app/assets/javascripts/jquery.simplecalendarjp.js - About 1 hr to fix

                                Function continuation_for_the_fucking_khtml_browser has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    Calendar.continuation_for_the_fucking_khtml_browser = function() {
                                        var w = self.element.offsetWidth;
                                        var h = self.element.offsetHeight;
                                        self.element.style.display = "none";
                                        var valign = opts.substr(0, 1);
                                Severity: Minor
                                Found in app/assets/javascripts/jquery.simplecalendarjp.js - About 1 hr to fix

                                  Function showMonthsCombo has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  Calendar.showMonthsCombo = function () {
                                      var cal = Calendar._C;
                                      if (!cal) {
                                          return false;
                                      }
                                  Severity: Minor
                                  Found in app/assets/javascripts/jquery.simplecalendarjp.js - About 1 hr to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                    if (!ne.disabled)
                                                        Calendar.cellClick(ne);
                                                    else if (prev)
                                                        prevMonth();
                                                    else
                                    Severity: Major
                                    Found in app/assets/javascripts/jquery.simplecalendarjp.js - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                          if (toolTip)
                                                              cell.title = toolTip;
                                      Severity: Major
                                      Found in app/assets/javascripts/jquery.simplecalendarjp.js - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                            if (/disabled/i.test(status))
                                                                cell.disabled = true;
                                        Severity: Major
                                        Found in app/assets/javascripts/jquery.simplecalendarjp.js - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                          switch (K) {
                                                              case 37: // KEY left
                                                              if (--x >= 0)
                                                                  ne = cal.ar_days[y][x];
                                                              else {
                                          Severity: Major
                                          Found in app/assets/javascripts/jquery.simplecalendarjp.js - About 45 mins to fix

                                            Consider simplifying this complex logical expression.
                                            Open

                                                if (ev.ctrlKey) {
                                                    switch (K) {
                                                        case 37: // KEY left
                                                        act && Calendar.cellClick(cal._nav_pm);
                                                        break;
                                            Severity: Major
                                            Found in app/assets/javascripts/jquery.simplecalendarjp.js - About 40 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

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

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                        if (year) {
                                                            if (year.year != cal.date.getFullYear()) {
                                                                if (cal.hilitedYear) {
                                                                    Calendar.removeClass(cal.hilitedYear, "hilite");
                                                                }
                                                Severity: Major
                                                Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 3 hrs to fix
                                                app/assets/javascripts/jquery.simplecalendarjp.js on lines 493..521

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 108.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                    if (mon) {
                                                        if (mon.month != cal.date.getMonth()) {
                                                            if (cal.hilitedMonth) {
                                                                Calendar.removeClass(cal.hilitedMonth, "hilite");
                                                            }
                                                Severity: Major
                                                Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 3 hrs to fix
                                                app/assets/javascripts/jquery.simplecalendarjp.js on lines 508..520

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 108.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                        switch (halign) {
                                                            case "L": p.x -= w; break;
                                                            case "R": p.x += el.offsetWidth; break;
                                                            case "C": p.x += (el.offsetWidth - w) / 2; break;
                                                            case "l": p.x += el.offsetWidth - w; break;
                                                Severity: Major
                                                Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 3 hrs to fix
                                                app/assets/javascripts/jquery.simplecalendarjp.js on lines 1498..1504

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 96.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                    if (cd.navtype < 0)
                                                        s.left = cd.offsetLeft + "px";
                                                    else {
                                                        var mcw = mc.offsetWidth;
                                                        if (typeof mcw == "undefined")
                                                Severity: Major
                                                Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 3 hrs to fix
                                                app/assets/javascripts/jquery.simplecalendarjp.js on lines 380..388

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 96.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                        if (cd.navtype < 0)
                                                            s.left = cd.offsetLeft + "px";
                                                        else {
                                                            var ycw = yc.offsetWidth;
                                                            if (typeof ycw == "undefined")
                                                Severity: Major
                                                Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 3 hrs to fix
                                                app/assets/javascripts/jquery.simplecalendarjp.js on lines 335..343

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 96.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                        switch (valign) {
                                                            case "T": p.y -= h; break;
                                                            case "B": p.y += el.offsetHeight; break;
                                                            case "C": p.y += (el.offsetHeight - h) / 2; break;
                                                            case "t": p.y += el.offsetHeight - h; break;
                                                Severity: Major
                                                Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 3 hrs to fix
                                                app/assets/javascripts/jquery.simplecalendarjp.js on lines 1506..1512

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 96.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                        if (year) {
                                                            date = new Date(cal.date);
                                                            if (year.year != date.getFullYear()) {
                                                                date.setFullYear(year.year);
                                                                cal.setDate(date);
                                                Severity: Major
                                                Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 2 hrs to fix
                                                app/assets/javascripts/jquery.simplecalendarjp.js on lines 415..434

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 88.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                    if (mon) {
                                                        date = new Date(cal.date);
                                                        if (mon.month != date.getMonth()) {
                                                            date.setMonth(mon.month);
                                                            cal.setDate(date);
                                                Severity: Major
                                                Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 2 hrs to fix
                                                app/assets/javascripts/jquery.simplecalendarjp.js on lines 425..433

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 88.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                            for (j = 0; j < 12; ++j) {
                                                                if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { t = j; break; }
                                                            }
                                                Severity: Major
                                                Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 2 hrs to fix
                                                app/assets/javascripts/jquery.simplecalendarjp.js on lines 1703..1705

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 83.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                            for (j = 0; j < 12; ++j) {
                                                                if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { m = j; break; }
                                                            }
                                                Severity: Major
                                                Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 2 hrs to fix
                                                app/assets/javascripts/jquery.simplecalendarjp.js on lines 1739..1741

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 83.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                Calendar.findYear = function(el) {
                                                    if (typeof el.year != "undefined") {
                                                        return el;
                                                    } else if (typeof el.parentNode.year != "undefined") {
                                                        return el.parentNode;
                                                Severity: Major
                                                Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 1 hr to fix
                                                app/assets/javascripts/jquery.simplecalendarjp.js on lines 298..305

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 69.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                Calendar.findMonth = function(el) {
                                                    if (typeof el.month != "undefined") {
                                                        return el;
                                                    } else if (typeof el.parentNode.month != "undefined") {
                                                        return el.parentNode;
                                                Severity: Major
                                                Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 1 hr to fix
                                                app/assets/javascripts/jquery.simplecalendarjp.js on lines 307..314

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 69.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                            if (/pm/i.test(a[i]) && hr < 12)
                                                                hr += 12;
                                                            else if (/am/i.test(a[i]) && hr >= 12)
                                                                hr -= 12;
                                                Severity: Major
                                                Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 1 hr to fix
                                                app/assets/javascripts/jquery.simplecalendarjp.js on lines 968..971

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 63.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                                    if (/pm/i.test(AP.innerHTML) && h < 12)
                                                                        h += 12;
                                                                    else if (/am/i.test(AP.innerHTML) && h == 12)
                                                                        h = 0;
                                                Severity: Major
                                                Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 1 hr to fix
                                                app/assets/javascripts/jquery.simplecalendarjp.js on lines 1717..1720

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 63.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                    if (Calendar.is_ie) {
                                                        posY = window.event.clientY + document.body.scrollTop;
                                                        posX = window.event.clientX + document.body.scrollLeft;
                                                    } else {
                                                        posY = ev.clientY + window.scrollY;
                                                Severity: Major
                                                Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 1 hr to fix
                                                app/assets/javascripts/jquery.simplecalendarjp.js on lines 538..544

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 58.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Identical blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                    if (Calendar.is_ie) {
                                                        posY = window.event.clientY + document.body.scrollTop;
                                                        posX = window.event.clientX + document.body.scrollLeft;
                                                    } else {
                                                        posX = ev.pageX;
                                                Severity: Major
                                                Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 1 hr to fix
                                                app/assets/javascripts/jquery.simplecalendarjp.js on lines 1639..1645

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 58.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                            function prevMonth() {
                                                                var date = new Date(cal.date);
                                                                date.setDate(date.getDate() - step);
                                                                cal.setDate(date);
                                                            };
                                                Severity: Major
                                                Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 1 hr to fix
                                                app/assets/javascripts/jquery.simplecalendarjp.js on lines 1078..1082

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 56.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                            function nextMonth() {
                                                                var date = new Date(cal.date);
                                                                date.setDate(date.getDate() + step);
                                                                cal.setDate(date);
                                                            };
                                                Severity: Major
                                                Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 1 hr to fix
                                                app/assets/javascripts/jquery.simplecalendarjp.js on lines 1073..1077

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 56.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                                    case 37: // KEY left
                                                                    if (--x >= 0)
                                                                        ne = cal.ar_days[y][x];
                                                                    else {
                                                                        x = 6;
                                                Severity: Major
                                                Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 1 hr to fix
                                                app/assets/javascripts/jquery.simplecalendarjp.js on lines 1102..1110

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 55.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                                    case 39: // KEY right
                                                                    if (++x < 7)
                                                                        ne = cal.ar_days[y][x];
                                                                    else {
                                                                        x = 0;
                                                Severity: Major
                                                Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 1 hr to fix
                                                app/assets/javascripts/jquery.simplecalendarjp.js on lines 1085..1093

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 55.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                        for (var i = 8; i > 0;) {
                                                            ar[--i] = Calendar._DN[i].substr(0, Calendar._SDN_len);
                                                        }
                                                Severity: Minor
                                                Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 55 mins to fix
                                                app/assets/javascripts/jquery.simplecalendarjp.js on lines 130..132

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 53.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                Similar blocks of code found in 2 locations. Consider refactoring.
                                                Open

                                                        for (var i = 12; i > 0;) {
                                                            ar[--i] = Calendar._MN[i].substr(0, Calendar._SMN_len);
                                                        }
                                                Severity: Minor
                                                Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 55 mins to fix
                                                app/assets/javascripts/jquery.simplecalendarjp.js on lines 122..124

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 53.

                                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                Refactorings

                                                Further Reading

                                                There are no issues that match your filters.

                                                Category
                                                Status