railstaichung/rails-taichung

View on GitHub

Showing 177 of 177 total issues

Function Jcrop has 1301 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  $.Jcrop = function (obj, opt) {
    var options = $.extend({}, $.Jcrop.defaults),
        docOffset,
        _ua = navigator.userAgent.toLowerCase(),
        is_msie = /msie/.test(_ua),
Severity: Major
Found in app/assets/javascripts/jquery.Jcrop.js - About 6 days to fix

    File Jcrop.js has 2042 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*! Jcrop.js v2.0.4 - build: 20151117
     *  @copyright 2008-2015 Tapmodo Interactive LLC
     *  @license Free software under MIT License
     *  @website http://jcrop.org/
     **/
    Severity: Major
    Found in app/assets/javascripts/Jcrop.js - About 5 days to fix

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

      /* =========================================================
       * bootstrap-datetimepicker.js
       * =========================================================
       * Copyright 2012 Stefan Petre
       *
      Severity: Major
      Found in app/assets/javascripts/bootstrap-datetimepicker.js - About 4 days to fix

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

        /**
         * jquery.Jcrop.js v0.9.12
         * jQuery Image Cropping Plugin - released under MIT License
         * Author: Kelly Hallman <khallman@gmail.com>
         * http://github.com/tapmodo/Jcrop
        Severity: Major
        Found in app/assets/javascripts/jquery.Jcrop.js - About 3 days to fix

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

          (function() {
            var __hasProp = {}.hasOwnProperty,
              __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
          
            this.Gmaps.Google.Builders.Polygon = (function(_super) {
          Severity: Major
          Found in public/javascripts/gmaps_google.js and 1 other location - About 2 days to fix
          public/javascripts/gmaps_google.js on lines 658..696

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

          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() {
            var __hasProp = {}.hasOwnProperty,
              __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
          
            this.Gmaps.Google.Builders.Polyline = (function(_super) {
          Severity: Major
          Found in public/javascripts/gmaps_google.js and 1 other location - About 2 days to fix
          public/javascripts/gmaps_google.js on lines 619..657

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

          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() {
            var __hasProp = {}.hasOwnProperty,
              __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
          
            this.Gmaps.Google.Objects.Polygon = (function(_super) {
          Severity: Major
          Found in public/javascripts/gmaps_google.js and 1 other location - About 2 days to fix
          public/javascripts/gmaps_google.js on lines 904..932

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

          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() {
            var __hasProp = {}.hasOwnProperty,
              __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
          
            this.Gmaps.Google.Objects.Polyline = (function(_super) {
          Severity: Major
          Found in public/javascripts/gmaps_google.js and 1 other location - About 2 days to fix
          public/javascripts/gmaps_google.js on lines 875..903

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

          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

          File gmaps_google.js has 793 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          (function() {
            this.Gmaps = {
              build: function(type, options) {
                var model;
                if (options == null) {
          Severity: Major
          Found in public/javascripts/gmaps_google.js - About 1 day to fix

            Function Coords has 244 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                var Coords = (function () {
                  var x1 = 0,
                      y1 = 0,
                      x2 = 0,
                      y2 = 0,
            Severity: Major
            Found in app/assets/javascripts/jquery.Jcrop.js - About 1 day to fix

              Function Modernizr has 240 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              var Modernizr = (function( window, document, undefined ) {
              
                  var version = '2.7.1',
              
                  Modernizr = {},
              Severity: Major
              Found in app/assets/javascripts/Jcrop.js - About 1 day to fix

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

                  DPGlobal.templateV3 = '<div class="datetimepicker">' +
                    '<div class="datetimepicker-minutes">' +
                    '<table class=" table-condensed">' +
                    DPGlobal.headTemplateV3 +
                    DPGlobal.contTemplate +
                Severity: Major
                Found in app/assets/javascripts/bootstrap-datetimepicker.js and 1 other location - About 1 day to fix
                app/assets/javascripts/bootstrap-datetimepicker.js on lines 1787..1823

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

                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

                  DPGlobal.template = '<div class="datetimepicker">' +
                    '<div class="datetimepicker-minutes">' +
                    '<table class=" table-condensed">' +
                    DPGlobal.headTemplate +
                    DPGlobal.contTemplate +
                Severity: Major
                Found in app/assets/javascripts/bootstrap-datetimepicker.js and 1 other location - About 1 day to fix
                app/assets/javascripts/bootstrap-datetimepicker.js on lines 1824..1860

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

                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 Selection has 215 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    var Selection = (function () {
                      var awake,
                          hdep = 370,
                          borders = {},
                          handle = {},
                Severity: Major
                Found in app/assets/javascripts/jquery.Jcrop.js - About 1 day to fix

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

                      click: function (e) {
                        e.stopPropagation();
                        e.preventDefault();
                        var target = $(e.target).closest('span, td, th, legend');
                        if (target.is('.' + this.icontype)) {
                  Severity: Major
                  Found in app/assets/javascripts/bootstrap-datetimepicker.js - About 7 hrs to fix

                    Function Datetimepicker has 168 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      var Datetimepicker = function (element, options) {
                        var that = this;
                    
                        this.element = $(element);
                    
                    
                    Severity: Major
                    Found in app/assets/javascripts/bootstrap-datetimepicker.js - About 6 hrs to fix

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

                          fill: function () {
                            if (this.date == null || this.viewDate == null) {
                              return;
                            }
                            var d = new Date(this.viewDate),
                      Severity: Major
                      Found in app/assets/javascripts/bootstrap-datetimepicker.js - About 6 hrs to fix

                        Function Handler has 161 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          this.Gmaps.Objects.Handler = (function() {
                            function Handler(type, options) {
                              this.type = type;
                              if (options == null) {
                                options = {};
                        Severity: Major
                        Found in public/javascripts/gmaps_google.js - About 6 hrs to fix

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

                              parseDate: function (date, format, language, type, timezone) {
                                if (date instanceof Date) {
                                  var dateUTC = new Date(date.valueOf() - date.getTimezoneOffset() * 60000);
                                  dateUTC.setMilliseconds(0);
                                  return dateUTC;
                          Severity: Major
                          Found in app/assets/javascripts/bootstrap-datetimepicker.js - About 5 hrs to fix

                            Function keydown has 123 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/bootstrap-datetimepicker.js - About 4 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language