Showing 60 of 60 total issues

Function ajaxSubmit has 492 lines of code (exceeds 25 allowed). Consider refactoring.
Open

$.fn.ajaxSubmit = function(options) {
    /*jshint scripturl:true */

    // fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
    if (!this.length) {
Severity: Major
Found in app/assets/javascripts/plugins/jquery.form.js - About 2 days to fix

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

    /*!
     * jQuery Form Plugin
     * version: 3.14 (30-JUL-2012)
     * @requires jQuery v1.3.2 or later
     *
    Severity: Major
    Found in app/assets/javascripts/plugins/jquery.form.js - About 1 day to fix

      Function populate has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring.
      Open

      jQuery.fn.populate = function(obj, options) {
          
          
          // ------------------------------------------------------------------------------------------
          // JSON conversion function
      Severity: Minor
      Found in app/assets/javascripts/plugins/jquery.populate.js - About 1 day 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 fileUploadIframe has 337 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function fileUploadIframe(a) {
              var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;
              var useProp = !!$.fn.prop;
      
              if ($(':input[name=submit],:input[id=submit]', form).length) {
      Severity: Major
      Found in app/assets/javascripts/plugins/jquery.form.js - About 1 day to fix

        Function populate has 175 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        jQuery.fn.populate = function(obj, options) {
            
            
            // ------------------------------------------------------------------------------------------
            // JSON conversion function
        Severity: Major
        Found in app/assets/javascripts/plugins/jquery.populate.js - About 7 hrs to fix

          Function cb has 125 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  function cb(e) {
                      if (xhr.aborted || callbackProcessed) {
                          return;
                      }
                      try {
          Severity: Major
          Found in app/assets/javascripts/plugins/jquery.form.js - About 5 hrs to fix

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

            (function() {
              var uv = document.createElement('script'); uv.type = 'text/javascript'; uv.async = true;
              uv.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'widget.uservoice.com/oQboNJSy7Yjg0ErIlX7MOw.js';
              var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(uv, s);
            })();
            Severity: Major
            Found in app/assets/javascripts/plugins/uservoice.js and 1 other location - About 4 hrs to fix
            app/assets/javascripts/plugins/google_analytics.js on lines 6..10

            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

            (function() {
              var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
              ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
              var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
            })();
            Severity: Major
            Found in app/assets/javascripts/plugins/google_analytics.js and 1 other location - About 4 hrs to fix
            app/assets/javascripts/plugins/uservoice.js on lines 2..6

            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

            Consider simplifying this complex logical expression.
            Open

                if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
                    (t == 'checkbox' || t == 'radio') && !el.checked ||
                    (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
                    tag == 'select' && el.selectedIndex == -1)) {
                        return null;
            Severity: Critical
            Found in app/assets/javascripts/plugins/jquery.form.js - About 3 hrs to fix

              Function jtextarea has 81 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  $.fn.jtextarea = function(opt) {
                      
                      var hmin=0;
                                  
                      var settings = {
              Severity: Major
              Found in app/assets/javascripts/plugins/jtextarea.js - About 3 hrs to fix

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

                // Generated by CoffeeScript 1.6.1
                
                /* ============================================================
                # bootstrap-tour.js v0.1
                # http://pushly.github.com/bootstrap-tour/
                Severity: Minor
                Found in app/assets/javascripts/plugins/bootstrap-tour.js - About 3 hrs to fix

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

                  Tutorial.data['dashboard'] = {
                    name: "Dashboard",
                  
                    steps: [{
                      element:   ".new-project-link",
                  Severity: Major
                  Found in app/assets/javascripts/tutorials/dashboard.js and 1 other location - About 3 hrs to fix
                  app/assets/javascripts/tutorials/backlog.js on lines 3..22

                  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

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

                  Tutorial.data['backlog'] = {
                    name: "Backlog",
                  
                    steps: [{
                      element:   ".new-issue-link",
                  Severity: Major
                  Found in app/assets/javascripts/tutorials/backlog.js and 1 other location - About 3 hrs to fix
                  app/assets/javascripts/tutorials/dashboard.js on lines 3..22

                  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

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

                              for ( var i in styles ) {
                                       
                                  if ( /:/i.test(styles[i]) ) {
                                      st = styles[i].match(/font[^;]+/ig);
                                      var le = styles[i].match(/line-height[^;]+/ig);
                  Severity: Major
                  Found in app/assets/javascripts/plugins/jtextarea.js and 1 other location - About 2 hrs to fix
                  app/assets/javascripts/plugins/jtextarea.js on lines 173..181

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

                  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

                                  for ( var i in styles ) {
                                       
                                      if ( /:/i.test(styles[i]) ) {
                                          st = styles[i].match(/font[^;]+/ig);
                                          var le = styles[i].match(/line-height[^;]+/ig);
                  Severity: Major
                  Found in app/assets/javascripts/plugins/jtextarea.js and 1 other location - About 2 hrs to fix
                  app/assets/javascripts/plugins/jtextarea.js on lines 200..208

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

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

                          function doSubmit() {
                              // make sure form attrs are set
                              var t = $form.attr('target'), a = $form.attr('action');
                  
                              // update form attrs in IE friendly way
                  Severity: Major
                  Found in app/assets/javascripts/plugins/jquery.form.js - About 2 hrs to fix

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

                                    if(text.indexOf('%0D%0A') > -1){
                                        re_nl = /%0D%0A/g ;
                                    }else if(text.indexOf('%0A') > -1){
                                        re_nl = /%0A/g ;
                                    }else if(text.indexOf('%0D') > -1){
                    Severity: Major
                    Found in app/assets/javascripts/plugins/jtextarea.js and 1 other location - About 2 hrs to fix
                    app/assets/javascripts/plugins/jtextarea.js on lines 27..33

                    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(text.indexOf('%0D%0A') > -1){
                                        re_nl = /%0D%0A/g ;
                                    }else if(text.indexOf('%0A') > -1){
                                        re_nl = /%0A/g ;
                                    }else if(text.indexOf('%0D') > -1){
                    Severity: Major
                    Found in app/assets/javascripts/plugins/jtextarea.js and 1 other location - About 2 hrs to fix
                    app/assets/javascripts/plugins/jtextarea.js on lines 66..72

                    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

                    Function populateFormElement has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            function populateFormElement(form, name, value)
                            {
                    
                                // check that the named element exists in the form
                                    var name    = getElementName(name); // handle non-php naming
                    Severity: Major
                    Found in app/assets/javascripts/plugins/jquery.populate.js - About 2 hrs to fix

                      Function formToArray has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      $.fn.formToArray = function(semantic, elements) {
                          var a = [];
                          if (this.length === 0) {
                              return a;
                          }
                      Severity: Major
                      Found in app/assets/javascripts/plugins/jquery.form.js - About 2 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language