ourcities/panela-de-pressao

View on GitHub

Showing 136 of 136 total issues

Function enableCssMediaQueries has a Cognitive Complexity of 268 (exceeds 5 allowed). Consider refactoring.
Open

domReady(function enableCssMediaQueries(){
var _37;
var _38={LENGTH_UNIT:/[0-9]+(em|ex|px|in|cm|mm|pt|pc)$/,RESOLUTION_UNIT:/[0-9]+(dpi|dpcm)$/,ASPECT_RATIO:/^[0-9]+\/[0-9]+$/,ABSOLUTE_VALUE:/^[0-9]*(\.[0-9]+)*$/};
var _39=[];
var _3a=function(){
Severity: Minor
Found in app/assets/javascripts/css3-mediaqueries.js - About 5 days to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function inputmask has 864 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        $.fn.inputmask = function (fn, options) {
            var opts = $.extend(true, {}, $.inputmask.defaults, options);
            var pasteEvent = isInputEventSupported('paste') ? 'paste' : 'input';

            var iphone = navigator.userAgent.match(/iphone/i) != null;
Severity: Major
Found in app/assets/javascripts/lib/jquery.inputmask.js - About 4 days to fix

    Function cssHelper has a Cognitive Complexity of 185 (exceeds 5 allowed). Consider refactoring.
    Open

    var cssHelper=function(){
    var _3={BLOCKS:/[^\s{][^{]*\{(?:[^{}]*\{[^{}]*\}[^{}]*|[^{}]*)*\}/g,BLOCKS_INSIDE:/[^\s{][^{]*\{[^{}]*\}/g,DECLARATIONS:/[a-zA-Z\-]+[^;]*:[^;]+;/g,RELATIVE_URLS:/url\(['"]?([^\/\)'"][^:\)'"]+)['"]?\)/g,REDUNDANT_COMPONENTS:/(?:\/\*([^*\\\\]|\*(?!\/))+\*\/|@import[^;]+;)/g,REDUNDANT_WHITESPACE:/\s*(,|:|;|\{|\})\s*/g,MORE_WHITESPACE:/\s{2,}/g,FINAL_SEMICOLONS:/;\}/g,NOT_WHITESPACE:/\S+/g};
    var _4,_5=false;
    var _6=[];
    var _7=function(fn){
    Severity: Minor
    Found in app/assets/javascripts/css3-mediaqueries.js - About 3 days to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function mask has 455 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                function mask(el) {
                    var $input = $(el);
                    if (!$input.is(":input")) return;
    
                    //correct greedy setting if needed
    Severity: Major
    Found in app/assets/javascripts/lib/jquery.inputmask.js - About 2 days to fix

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

      /**
      * @license Input Mask plugin for jquery
      * http://github.com/RobinHerbots/jquery.inputmask
      * Copyright (c) 2010 - 2012 Robin Herbots
      * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
      Severity: Major
      Found in app/assets/javascripts/lib/jquery.inputmask.js - About 2 days to fix

        File backbone.js has 856 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        //     Backbone.js 0.9.2
        
        //     (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc.
        //     Backbone may be freely distributed under the MIT license.
        //     For all details and documentation:
        Severity: Major
        Found in app/assets/javascripts/lib/backbone.js - About 2 days to fix

          Function cssHelper has 412 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var cssHelper=function(){
          var _3={BLOCKS:/[^\s{][^{]*\{(?:[^{}]*\{[^{}]*\}[^{}]*|[^{}]*)*\}/g,BLOCKS_INSIDE:/[^\s{][^{]*\{[^{}]*\}/g,DECLARATIONS:/[a-zA-Z\-]+[^;]*:[^;]+;/g,RELATIVE_URLS:/url\(['"]?([^\/\)'"][^:\)'"]+)['"]?\)/g,REDUNDANT_COMPONENTS:/(?:\/\*([^*\\\\]|\*(?!\/))+\*\/|@import[^;]+;)/g,REDUNDANT_WHITESPACE:/\s*(,|:|;|\{|\})\s*/g,MORE_WHITESPACE:/\s{2,}/g,FINAL_SEMICOLONS:/;\}/g,NOT_WHITESPACE:/\S+/g};
          var _4,_5=false;
          var _6=[];
          var _7=function(fn){
          Severity: Major
          Found in app/assets/javascripts/css3-mediaqueries.js - About 2 days to fix

            File css3-mediaqueries.js has 777 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            if(typeof Object.create!=="function"){
            Object.create=function(o){
            function F(){
            };
            F.prototype=o;
            Severity: Major
            Found in app/assets/javascripts/css3-mediaqueries.js - About 1 day to fix

              File underscore.js has 700 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              //     Underscore.js 1.3.3
              //     (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
              //     Underscore is freely distributable under the MIT license.
              //     Portions of Underscore are inspired or borrowed from Prototype,
              //     Oliver Steele's Functional, and John Resig's Micro-Templating.
              Severity: Major
              Found in app/assets/javascripts/lib/underscore.js - About 1 day to fix

                Function enableCssMediaQueries has 287 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                domReady(function enableCssMediaQueries(){
                var _37;
                var _38={LENGTH_UNIT:/[0-9]+(em|ex|px|in|cm|mm|pt|pc)$/,RESOLUTION_UNIT:/[0-9]+(dpi|dpcm)$/,ASPECT_RATIO:/^[0-9]+\/[0-9]+$/,ABSOLUTE_VALUE:/^[0-9]*(\.[0-9]+)*$/};
                var _39=[];
                var _3a=function(){
                Severity: Major
                Found in app/assets/javascripts/css3-mediaqueries.js - About 1 day to fix

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

                  var _40=function(_41,_42){
                  var l=_41.length;
                  var min=(_41.substring(0,4)==="min-");
                  var max=(!min&&_41.substring(0,4)==="max-");
                  if(_42!==null){
                  Severity: Major
                  Found in app/assets/javascripts/css3-mediaqueries.js - About 5 hrs to fix

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

                          $('a.facebook_share_btn, a.twitter_share_btn').click(function(event, target){
                            event.preventDefault();
                            var obj = $(event.target);
                            var url = null;
                            url = obj.attr('href');
                    Severity: Major
                    Found in app/assets/javascripts/app.js and 1 other location - About 4 hrs to fix
                    app/assets/javascripts/app.js on lines 98..109

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

                    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

                            $("a.facebook_share, a.twitter_share").click(function(event, target){
                              event.preventDefault();
                              var obj = $(event.target);
                              var url = null;
                    
                    
                    Severity: Major
                    Found in app/assets/javascripts/app.js and 1 other location - About 4 hrs to fix
                    app/assets/javascripts/app.js on lines 86..95

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

                    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("height"===_41.substring(l-6,l)){
                    _47=document.documentElement.clientHeight||document.body.clientHeight;
                    if(_42!==null){
                    if(_43==="length"){
                    return ((min&&_47>=_44)||(max&&_47<_44)||(!min&&!max&&_47===_44));
                    Severity: Major
                    Found in app/assets/javascripts/css3-mediaqueries.js and 1 other location - About 3 hrs to fix
                    app/assets/javascripts/css3-mediaqueries.js on lines 573..647

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

                    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("width"===_41.substring(l-5,l)){
                    _46=document.documentElement.clientWidth||document.body.clientWidth;
                    if(_42!==null){
                    if(_43==="length"){
                    return ((min&&_46>=_44)||(max&&_46<_44)||(!min&&!max&&_46===_44));
                    Severity: Major
                    Found in app/assets/javascripts/css3-mediaqueries.js and 1 other location - About 3 hrs to fix
                    app/assets/javascripts/css3-mediaqueries.js on lines 585..646

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

                    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("device-height"===_41.substring(l-13,l)){
                    _47=screen.height;
                    if(_42!==null){
                    if(_43==="length"){
                    return ((min&&_47>=_44)||(max&&_47<_44)||(!min&&!max&&_47===_44));
                    Severity: Major
                    Found in app/assets/javascripts/css3-mediaqueries.js and 1 other location - About 3 hrs to fix
                    app/assets/javascripts/css3-mediaqueries.js on lines 549..649

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

                    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("device-width"===_41.substring(l-12,l)){
                    _46=screen.width;
                    if(_42!==null){
                    if(_43==="length"){
                    return ((min&&_46>=_44)||(max&&_46<_44)||(!min&&!max&&_46===_44));
                    Severity: Major
                    Found in app/assets/javascripts/css3-mediaqueries.js and 1 other location - About 3 hrs to fix
                    app/assets/javascripts/css3-mediaqueries.js on lines 561..648

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

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

                                    function keydownEvent(e) {
                                        //Safari 5.1.x - modal dialog fires keypress twice workaround
                                        skipKeyPressEvent = false;
                    
                                        var input = this, k = e.keyCode, pos = caret(input);
                    Severity: Major
                    Found in app/assets/javascripts/lib/jquery.inputmask.js - About 3 hrs to fix

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

                                                      get: function () {
                                                          var $self = $(this), inputData = $(this).data('inputmask');
                                                          return inputData && inputData['autoUnmask'] ? $self.inputmask('unmaskedvalue') : this._valueGet() != inputData['_buffer'].join('') ? this._valueGet() : '';
                                                      },
                      Severity: Major
                      Found in app/assets/javascripts/lib/jquery.inputmask.js and 1 other location - About 3 hrs to fix
                      app/assets/javascripts/lib/jquery.inputmask.js on lines 757..760

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

                      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

                      Consider simplifying this complex logical expression.
                      Open

                          if ($.fn.inputmask == undefined) {
                              $.inputmask = {
                                  //options default
                                  defaults: {
                                      placeholder: "_",
                      Severity: Critical
                      Found in app/assets/javascripts/lib/jquery.inputmask.js - About 3 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language