DamageStudios/rims

View on GitHub
app/assets/javascripts/jasny-bootstrap.js

Summary

Maintainability
F
2 mos
Test Coverage

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

/*!
 * Jasny Bootstrap v3.1.0 (http://jasny.github.io/bootstrap)
 * Copyright 2012-2014 Arnold Daniels
 * Licensed under Apache-2.0 (https://github.com/jasny/bootstrap/blob/master/LICENSE)
 */
Severity: Major
Found in app/assets/javascripts/jasny-bootstrap.js - About 1 day to fix

    Function show has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      OffCanvas.prototype.show = function () {
        if (this.state) return
        
        var startEvent = $.Event('show.bs.offcanvas')
        this.$element.trigger(startEvent)
    Severity: Minor
    Found in app/assets/javascripts/jasny-bootstrap.js - About 1 hr to fix

      Function checkVal has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        Inputmask.prototype.checkVal = function(allow) {
          var len = this.mask.length
          //try to place characters where they belong
          var test = this.$element.val()
          var lastMatch = -1
      Severity: Minor
      Found in app/assets/javascripts/jasny-bootstrap.js - About 1 hr to fix

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

          Inputmask.prototype.caret = function(begin, end) {
            if (this.$element.length === 0) return
            if (typeof begin == 'number') {
              end = (typeof end == 'number') ? end : begin
              return this.$element.each(function() {
        Severity: Minor
        Found in app/assets/javascripts/jasny-bootstrap.js - About 1 hr to fix

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

            Fileinput.prototype.change = function(e) {
              if (e.target.files === undefined) e.target.files = e.target && e.target.value ? [ {name: e.target.value.replace(/^.+\\/, '')} ] : []
              if (e.target.files.length === 0) return
          
              this.$hidden.val('')
          Severity: Minor
          Found in app/assets/javascripts/jasny-bootstrap.js - About 1 hr to fix

            Function init has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              Inputmask.prototype.init = function() {
                var defs = this.options.definitions
                var len = this.mask.length
            
                this.tests = [] 
            Severity: Minor
            Found in app/assets/javascripts/jasny-bootstrap.js - About 1 hr to fix

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

              +function ($) { "use strict";
              
                var isIphone = (window.orientation !== undefined)
                var isAndroid = navigator.userAgent.toLowerCase().indexOf("android") > -1
                var isIE = window.navigator.appName == 'Microsoft Internet Explorer'
              Severity: Major
              Found in app/assets/javascripts/jasny-bootstrap.js and 1 other location - About 3 wks to fix
              public/assets/application-404f4a61b35c93d3441d4475969d79cc4182aff2126750b4beaab13f73340f19.js on lines 14107..14445

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

              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 ($) { "use strict";
              
                // OFFCANVAS PUBLIC CLASS DEFINITION
                // =================================
              
              
              Severity: Major
              Found in app/assets/javascripts/jasny-bootstrap.js and 1 other location - About 2 wks to fix
              public/assets/application-404f4a61b35c93d3441d4475969d79cc4182aff2126750b4beaab13f73340f19.js on lines 13726..14000

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

              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 ($) { "use strict";
              
                var isIE = window.navigator.appName == 'Microsoft Internet Explorer'
              
                // FILEUPLOAD PUBLIC CLASS DEFINITION
              Severity: Major
              Found in app/assets/javascripts/jasny-bootstrap.js and 1 other location - About 1 wk to fix
              public/assets/application-404f4a61b35c93d3441d4475969d79cc4182aff2126750b4beaab13f73340f19.js on lines 14466..14637

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

              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 ($) { "use strict";
              
                var Rowlink = function (element, options) {
                  this.$element = $(element)
                  this.options = $.extend({}, Rowlink.DEFAULTS, options)
              Severity: Major
              Found in app/assets/javascripts/jasny-bootstrap.js and 1 other location - About 3 days to fix
              public/assets/application-404f4a61b35c93d3441d4475969d79cc4182aff2126750b4beaab13f73340f19.js on lines 14021..14085

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

              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