remomueller/contour

View on GitHub

Showing 40 of 40 total issues

File typeahead.js has 1130 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * typeahead.js 0.9.3
 * https://github.com/twitter/typeahead
 * Copyright 2013 Twitter, Inc. and other contributors; Licensed MIT
 */
Severity: Major
Found in app/assets/javascripts/external/typeahead.js - About 2 days to fix

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

    /* =========================================================
     * bootstrap-datepicker.js
     * http://www.eyecon.ro/bootstrap-datepicker
     * =========================================================
     * Copyright 2012 Stefan Petre
    Severity: Major
    Found in app/assets/javascripts/external/bootstrap-datepicker.js - About 2 days to fix

      Function TypeaheadView has 215 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var TypeaheadView = function() {
              var html = {
                  wrapper: '<span class="twitter-typeahead"></span>',
                  hint: '<input class="tt-hint" type="text" autocomplete="off" spellcheck="off" disabled>',
                  dropdown: '<span class="tt-dropdown-menu"></span>'
      Severity: Major
      Found in app/assets/javascripts/external/typeahead.js - About 1 day to fix

        Function Dataset has 192 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            var Dataset = function() {
                var keys = {
                    thumbprint: "thumbprint",
                    protocol: "protocol",
                    itemHash: "itemHash",
        Severity: Major
        Found in app/assets/javascripts/external/typeahead.js - About 7 hrs to fix

          Function DropdownView has 167 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              var DropdownView = function() {
                  var html = {
                      suggestionsList: '<span class="tt-suggestions"></span>'
                  }, css = {
                      suggestionsList: {
          Severity: Major
          Found in app/assets/javascripts/external/typeahead.js - About 6 hrs to fix

            Function InputView has 121 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                var InputView = function() {
                    function InputView(o) {
                        var that = this;
                        utils.bindAll(this);
                        this.specialKeyCodeMap = {
            Severity: Major
            Found in app/assets/javascripts/external/typeahead.js - About 4 hrs to fix

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

                                          case 'M':
                                              filtered = $(dates[language].monthsShort).filter(function(){
                                                  var m = this.slice(0, parts[i].length),
                                                      p = parts[i].slice(0, m.length);
                                                  return m == p;
              Severity: Major
              Found in app/assets/javascripts/external/bootstrap-datepicker.js and 1 other location - About 4 hrs to fix
              app/assets/javascripts/external/bootstrap-datepicker.js on lines 897..904

              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 122.

              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 'MM':
                                              filtered = $(dates[language].months).filter(function(){
                                                  var m = this.slice(0, parts[i].length),
                                                      p = parts[i].slice(0, m.length);
                                                  return m == p;
              Severity: Major
              Found in app/assets/javascripts/external/bootstrap-datepicker.js and 1 other location - About 4 hrs to fix
              app/assets/javascripts/external/bootstrap-datepicker.js on lines 905..912

              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 122.

              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

              Function fill has 92 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      fill: function() {
                          var d = new Date(this.viewDate),
                              year = d.getUTCFullYear(),
                              month = d.getUTCMonth(),
                              startYear = this.startDate !== -Infinity ? this.startDate.getUTCFullYear() : -Infinity,
              Severity: Major
              Found in app/assets/javascripts/external/bootstrap-datepicker.js - About 3 hrs to fix

                Function Datepicker has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    var Datepicker = function(element, options) {
                        var that = this;
                
                        this.element = $(element);
                        this.language = options.language||this.element.data('date-language')||"en";
                Severity: Major
                Found in app/assets/javascripts/external/bootstrap-datepicker.js - About 3 hrs to fix

                  Function keydown has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          keydown: function(e){
                              if (this.picker.is(':not(:visible)')){
                                  if (e.keyCode == 27) // allow escape to hide and re-show picker
                                      this.show();
                                  return;
                  Severity: Major
                  Found in app/assets/javascripts/external/bootstrap-datepicker.js - About 3 hrs to fix

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

                            parseDate: function(date, format, language) {
                                if (date instanceof Date) return date;
                                if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(date)) {
                                    var part_re = /([\-+]\d+)([dmwy])/,
                                        parts = date.match(/([\-+]\d+)([dmwy])/g),
                    Severity: Major
                    Found in app/assets/javascripts/external/bootstrap-datepicker.js - About 3 hrs to fix

                      Function click has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              click: function(e) {
                                  e.stopPropagation();
                                  e.preventDefault();
                                  var target = $(e.target).closest('span, td, th');
                                  if (target.length == 1) {
                      Severity: Major
                      Found in app/assets/javascripts/external/bootstrap-datepicker.js - About 3 hrs to fix

                        Function PersistentStorage has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            var PersistentStorage = function() {
                                var ls, methods;
                                try {
                                    ls = window.localStorage;
                                    ls.setItem("~~~", "!");
                        Severity: Major
                        Found in app/assets/javascripts/external/typeahead.js - About 3 hrs to fix

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

                              var Transport = function() {
                                  var pendingRequestsCount = 0, pendingRequests = {}, maxPendingRequests, requestCache;
                                  function Transport(o) {
                                      utils.bindAll(this);
                                      o = utils.isString(o) ? {
                          Severity: Major
                          Found in app/assets/javascripts/external/typeahead.js - About 3 hrs to fix

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

                                        for (var i=0, el, ev; i<this._events.length; i++){
                                            el = this._events[i][0];
                                            ev = this._events[i][1];
                                            el.off(ev);
                                        }
                            Severity: Major
                            Found in app/assets/javascripts/external/bootstrap-datepicker.js and 1 other location - About 2 hrs to fix
                            app/assets/javascripts/external/bootstrap-datepicker.js on lines 180..184

                            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 86.

                            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=0, el, ev; i<this._events.length; i++){
                                            el = this._events[i][0];
                                            ev = this._events[i][1];
                                            el.on(ev);
                                        }
                            Severity: Major
                            Found in app/assets/javascripts/external/bootstrap-datepicker.js and 1 other location - About 2 hrs to fix
                            app/assets/javascripts/external/bootstrap-datepicker.js on lines 187..191

                            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 86.

                            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 (this.dateWithinRange(newDate)){
                                                    this.date = newDate;
                                                    this.viewDate = newViewDate;
                                                    this.setValue();
                                                    this.update();
                            Severity: Major
                            Found in app/assets/javascripts/external/bootstrap-datepicker.js and 1 other location - About 1 hr to fix
                            app/assets/javascripts/external/bootstrap-datepicker.js on lines 713..720

                            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 74.

                            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 (this.dateWithinRange(newDate)){
                                                    this.date = newDate;
                                                    this.viewDate = newViewDate;
                                                    this.setValue();
                                                    this.update();
                            Severity: Major
                            Found in app/assets/javascripts/external/bootstrap-datepicker.js and 1 other location - About 1 hr to fix
                            app/assets/javascripts/external/bootstrap-datepicker.js on lines 688..695

                            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 74.

                            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 4 locations. Consider refactoring.
                            Open

                                    if ('autoclose' in options) {
                                        this.autoclose = options.autoclose;
                                    } else if ('dateAutoclose' in this.element.data()) {
                                        this.autoclose = this.element.data('date-autoclose');
                                    }
                            Severity: Major
                            Found in app/assets/javascripts/external/bootstrap-datepicker.js and 3 other locations - About 1 hr to fix
                            app/assets/javascripts/external/bootstrap-datepicker.js on lines 52..56
                            app/assets/javascripts/external/bootstrap-datepicker.js on lines 91..95
                            app/assets/javascripts/external/bootstrap-datepicker.js on lines 113..117

                            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 72.

                            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

                            Severity
                            Category
                            Status
                            Source
                            Language