railsfrance/railsfrance.org

View on GitHub

Showing 228 of 228 total issues

File jquery-1.6.4.js has 6184 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * jQuery JavaScript Library v1.6.4
 * http://jquery.com/
 *
 * Copyright 2011, John Resig
Severity: Major
Found in app/assets/javascripts/lib/jquery-1.6.4.js - About 2 wks to fix

    Function bxSlider has 846 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        $.fn.bxSlider = function(options){        
                    
            var defaults = {
                mode: 'horizontal',                                    // 'horizontal', 'vertical', 'fade'
                infiniteLoop: true,                                    // true, false - display first slide after last
    Severity: Major
    Found in app/assets/javascripts/lib/jquery.bxSlider.js - About 4 days to fix

      File bots.rb has 1459 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      module Bots
        # Bots list from http://www.user-agents.org/allagents.xml
      
        WILD_CARDS = ["bot","yahoo","slurp","google","msn","crawler"]
      
      
      Severity: Major
      Found in lib/models/bots.rb - About 3 days to fix

        Function jQuery has 590 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var jQuery = (function() {
        
        // Define a local copy of jQuery
        var jQuery = function( selector, context ) {
                // The jQuery object is actually just the init constructor 'enhanced'
        Severity: Major
        Found in app/assets/javascripts/lib/jquery-1.6.4.js - About 2 days to fix

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

                  if(this._defaults.maxDateTime !== null && dp_date){
                      var maxDateTime = this._defaults.maxDateTime,
                          maxDateTimeDate = new Date(maxDateTime.getFullYear(), maxDateTime.getMonth(), maxDateTime.getDate(), 0, 0, 0, 0);
              
                      if(this.hourMaxOriginal === null || this.minuteMaxOriginal === null || this.secondMaxOriginal === null){
          Severity: Major
          Found in app/assets/javascripts/lib/jquery-ui-timepicker-addon.js and 1 other location - About 2 days to fix
          app/assets/javascripts/lib/jquery-ui-timepicker-addon.js on lines 521..552

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

          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(this._defaults.minDateTime !== null && dp_date){
                      var minDateTime = this._defaults.minDateTime,
                          minDateTimeDate = new Date(minDateTime.getFullYear(), minDateTime.getMonth(), minDateTime.getDate(), 0, 0, 0, 0);
          
                      if(this.hourMinOriginal === null || this.minuteMinOriginal === null || this.secondMinOriginal === null){
          Severity: Major
          Found in app/assets/javascripts/lib/jquery-ui-timepicker-addon.js and 1 other location - About 2 days to fix
          app/assets/javascripts/lib/jquery-ui-timepicker-addon.js on lines 554..585

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

          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 jquery.bxSlider.js has 857 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /**
           * jQuery bxSlider v3.0
           * http://bxslider.com
           *
           * Copyright 2010, Steven Wanderski
          Severity: Major
          Found in app/assets/javascripts/lib/jquery.bxSlider.js - About 2 days to fix

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

                                if(options.mode == 'horizontal'){                        
                                    // get the new 'left' property for $parent
                                    var parentLeft = (options.moveSlideQty * childrenOuterWidth);
                                    // animate to the new 'left'
                                    $parent.animate({'left': '-='+parentLeft+'px'}, options.speed, options.easing, function(){
            Severity: Major
            Found in app/assets/javascripts/lib/jquery.bxSlider.js and 1 other location - About 1 day to fix
            app/assets/javascripts/lib/jquery.bxSlider.js on lines 310..338

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

            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.mode == 'horizontal'){
                                    // get the new 'left' property for $parent
                                    var parentLeft = (options.moveSlideQty * childrenOuterWidth);
                                    // animate to the new 'left'
                                    $parent.animate({'left': '+='+parentLeft+'px'}, options.speed, options.easing, function(){
            Severity: Major
            Found in app/assets/javascripts/lib/jquery.bxSlider.js and 1 other location - About 1 day to fix
            app/assets/javascripts/lib/jquery.bxSlider.js on lines 214..242

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

            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 jquery-ui-timepicker-addon.js has 748 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*
            * jQuery timepicker addon
            * By: Trent Richardson [http://trentrichardson.com]
            * Version 0.9.5
            * Last Modified: 05/25/2011
            Severity: Major
            Found in app/assets/javascripts/lib/jquery-ui-timepicker-addon.js - About 1 day to fix

              Function ajax has 242 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  ajax: function( url, options ) {
              
                      // If url is an object, simulate pre-1.5 signature
                      if ( typeof url === "object" ) {
                          options = url;
              Severity: Major
              Found in app/assets/javascripts/lib/jquery-1.6.4.js - About 1 day to fix

                Function _injectTimePicker has 209 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    _injectTimePicker: function() {
                        var $dp = this.inst.dpDiv,
                            o = this._defaults,
                            tp_inst = this,
                            // Added by Peter Medeiros:
                Severity: Major
                Found in app/assets/javascripts/lib/jquery-ui-timepicker-addon.js - About 1 day to fix

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

                              if (o.showMinute && o.minuteGrid > 0) {
                                  html += '<dd class="ui_tpicker_minute ui_tpicker_minute_' + o.minuteGrid + '">' +
                                          '<div id="ui_tpicker_minute_' + dp_id + '"' +
                                          ((o.showMinute) ? '' : noDisplay) + '></div>' +
                                          '<div style="padding-left: 1px"><table><tr>';
                  Severity: Major
                  Found in app/assets/javascripts/lib/jquery-ui-timepicker-addon.js and 1 other location - About 7 hrs to fix
                  app/assets/javascripts/lib/jquery-ui-timepicker-addon.js on lines 332..346

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

                  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 (o.showSecond && o.secondGrid > 0) {
                                  html += '<dd class="ui_tpicker_second ui_tpicker_second_' + o.secondGrid + '">' +
                                          '<div id="ui_tpicker_second_' + dp_id + '"' +
                                          ((o.showSecond) ? '' : noDisplay) + '></div>' +
                                          '<div style="padding-left: 1px"><table><tr>';
                  Severity: Major
                  Found in app/assets/javascripts/lib/jquery-ui-timepicker-addon.js and 1 other location - About 7 hrs to fix
                  app/assets/javascripts/lib/jquery-ui-timepicker-addon.js on lines 313..327

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

                  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

                                  $tp.find(".ui_tpicker_minute table").css({
                                      width: size + "%",
                                      marginLeft: (size / (-2 * minuteGridSize)) + "%",
                                      borderCollapse: 'collapse'
                                  }).find("td").each(function(index) {
                  Severity: Major
                  Found in app/assets/javascripts/lib/jquery-ui-timepicker-addon.js and 1 other location - About 7 hrs to fix
                  app/assets/javascripts/lib/jquery-ui-timepicker-addon.js on lines 471..486

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

                  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

                                  $tp.find(".ui_tpicker_second table").css({
                                      width: size + "%",
                                      marginLeft: (size / (-2 * secondGridSize)) + "%",
                                      borderCollapse: 'collapse'
                                  }).find("td").each(function(index) {
                  Severity: Major
                  Found in app/assets/javascripts/lib/jquery-ui-timepicker-addon.js and 1 other location - About 7 hrs to fix
                  app/assets/javascripts/lib/jquery-ui-timepicker-addon.js on lines 452..467

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

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

                  jQuery.support = (function() {
                  
                      var div = document.createElement( "div" ),
                          documentElement = document.documentElement,
                          all,
                  Severity: Major
                  Found in app/assets/javascripts/lib/jquery-1.6.4.js - About 5 hrs to fix

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

                            function setAutoControlsVars(){
                                // check if text or images should be used for controls
                                // check "start"
                                if(options.startImage != ''){
                                    startContent = options.startImage;
                    Severity: Major
                    Found in app/assets/javascripts/lib/jquery.bxSlider.js and 1 other location - About 5 hrs to fix
                    app/assets/javascripts/lib/jquery.bxSlider.js on lines 720..740

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

                    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 setControlsVars(){
                                // check if text or images should be used for controls
                                // check "next"
                                if(options.nextImage != ''){
                                    nextContent = options.nextImage;
                    Severity: Major
                    Found in app/assets/javascripts/lib/jquery.bxSlider.js and 1 other location - About 5 hrs to fix
                    app/assets/javascripts/lib/jquery.bxSlider.js on lines 863..883

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

                    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.tickerDirection == 'next'){
                                        // get the 'left' property where the ticker stopped
                                        var stoppedLeft = parseInt($parent.css('left'));
                                        // calculate the remaining distance the show must travel until the loop
                                        var remainingDistance = (origShowWidth + stoppedLeft) + $children.eq(0).width();            
                    Severity: Major
                    Found in app/assets/javascripts/lib/jquery.bxSlider.js and 1 other location - About 5 hrs to fix
                    app/assets/javascripts/lib/jquery.bxSlider.js on lines 453..463

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

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language