camdub/Internships

View on GitHub
public/javascripts/jquery.uniform.js

Summary

Maintainability
F
1 wk
Test Coverage

Function uniform has 457 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  $.fn.uniform = function(options) {

    options = $.extend($.uniform.options, options);

    var el = this;
Severity: Major
Found in public/javascripts/jquery.uniform.js - About 2 days to fix

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

    /*
    
    Uniform v1.7.5
    Copyright © 2009 Josh Pyles / Pixelmatrix Design LLC
    http://pixelmatrixdesign.com
    Severity: Minor
    Found in public/javascripts/jquery.uniform.js - About 7 hrs to fix

      Function doFile has 76 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function doFile(elem){
            //sanitize input
            var $el = $(elem);
      
            var divTag = $('<div />'),
      Severity: Major
      Found in public/javascripts/jquery.uniform.js - About 3 hrs to fix

        Function update has 63 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            $.uniform.update = function(elem){
              if(elem == undefined){
                elem = $($.uniform.elements);
              }
              //sanitize input
        Severity: Major
        Found in public/javascripts/jquery.uniform.js - About 2 hrs to fix

          Function doSelect has 57 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function doSelect(elem){
                var $el = $(elem);
                
                var divTag = $('<div />'),
                    spanTag = $('<span />');
          Severity: Major
          Found in public/javascripts/jquery.uniform.js - About 2 hrs to fix

            Function doButton has 55 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function doButton(elem){
                  var $el = $(elem);
                  
                  var divTag = $("<div>"),
                      spanTag = $("<span>");
            Severity: Major
            Found in public/javascripts/jquery.uniform.js - About 2 hrs to fix

              Function doRadio has 55 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function doRadio(elem){
                    var $el = $(elem);
                    
                    var divTag = $('<div />'),
                        spanTag = $('<span />');
              Severity: Major
              Found in public/javascripts/jquery.uniform.js - About 2 hrs to fix

                Function doCheckbox has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function doCheckbox(elem){
                      var $el = $(elem);
                      
                      var divTag = $('<div />'),
                          spanTag = $('<span />');
                Severity: Major
                Found in public/javascripts/jquery.uniform.js - About 2 hrs to fix

                  Avoid deeply nested control flow statements.
                  Open

                            if($e.is(":disabled")){
                              divTag.addClass(options.disabledClass);
                            }else{
                              divTag.removeClass(options.disabledClass);
                            }
                  Severity: Major
                  Found in public/javascripts/jquery.uniform.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                            }else if($e.is(":submit") || $e.is(":reset") || $e.is("button") || $e.is("a") || elem.is("input[type=button]")){
                              var divTag = $e.closest("div");
                              divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass);
                              
                              if($e.is(":disabled")){
                    Severity: Major
                    Found in public/javascripts/jquery.uniform.js - About 45 mins to fix

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

                              }else if($e.is(":radio")){
                                //element is a radio
                                var spanTag = $e.closest("span");
                                var divTag = $e.closest("div");
                      
                      
                      Severity: Major
                      Found in public/javascripts/jquery.uniform.js and 1 other location - About 6 hrs to fix
                      public/javascripts/jquery.uniform.js on lines 577..635

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

                      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

                              }else if($e.is(":checkbox")){
                                //element is a checkbox
                                var spanTag = $e.closest("span");
                                var divTag = $e.closest("div");
                      
                      
                      Severity: Major
                      Found in public/javascripts/jquery.uniform.js and 1 other location - About 6 hrs to fix
                      public/javascripts/jquery.uniform.js on lines 594..635

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

                      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(options.useID && $el.attr("id") != ""){
                              divTag.attr("id", options.idPrefix+"-"+$el.attr("id"));
                            }
                      Severity: Major
                      Found in public/javascripts/jquery.uniform.js and 1 other location - About 1 hr to fix
                      public/javascripts/jquery.uniform.js on lines 313..315

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

                      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(options.useID && elem.attr("id") != ""){
                              divTag.attr("id", options.idPrefix+"-"+elem.attr("id"));
                            }
                      Severity: Major
                      Found in public/javascripts/jquery.uniform.js and 1 other location - About 1 hr to fix
                      public/javascripts/jquery.uniform.js on lines 394..396

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

                      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

                              }else if($e.is(":submit") || $e.is(":reset") || $e.is("button") || $e.is("a") || elem.is("input[type=button]")){
                                var divTag = $e.closest("div");
                                divTag.removeClass(options.hoverClass+" "+options.focusClass+" "+options.activeClass);
                                
                                if($e.is(":disabled")){
                      Severity: Major
                      Found in public/javascripts/jquery.uniform.js and 1 other location - About 1 hr to fix
                      public/javascripts/jquery.uniform.js on lines 665..667

                      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

                              }else if(elem.is("a") || elem.is(":submit") || elem.is(":reset") || elem.is("button") || elem.is("input[type=button]")){
                                doButton(elem);
                              }
                      Severity: Major
                      Found in public/javascripts/jquery.uniform.js and 1 other location - About 1 hr to fix
                      public/javascripts/jquery.uniform.js on lines 625..635

                      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

                              }else if($(this).is("select")){
                                //remove sibling span
                                $(this).siblings("span").remove();
                                //unwrap parent div
                                $(this).unwrap();
                      Severity: Minor
                      Found in public/javascripts/jquery.uniform.js and 1 other location - About 35 mins to fix
                      public/javascripts/jquery.uniform.js on lines 502..510

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

                      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

                              "mousedown.uniform": function() {
                                if(!$(elem).is(":disabled")){
                                  divTag.addClass(options.activeClass);
                                }
                              },
                      Severity: Minor
                      Found in public/javascripts/jquery.uniform.js and 1 other location - About 35 mins to fix
                      public/javascripts/jquery.uniform.js on lines 346..350

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

                      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

                              }else if($(this).is(":file")){
                                //remove sibling spans
                                $(this).siblings("span").remove();
                                //unwrap parent div
                                $(this).unwrap();
                      Severity: Minor
                      Found in public/javascripts/jquery.uniform.js and 1 other location - About 35 mins to fix
                      public/javascripts/jquery.uniform.js on lines 494..510

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

                      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

                              "mousedown.uniform touchend.uniform": function() {
                                if(!$(elem).is(":disabled")){
                                  divTag.addClass(options.activeClass);
                                }
                              },
                      Severity: Minor
                      Found in public/javascripts/jquery.uniform.js and 1 other location - About 35 mins to fix
                      public/javascripts/jquery.uniform.js on lines 443..447

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

                      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