techvision/brails4

View on GitHub

Showing 157 of 157 total issues

Function setCalendar has 862 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $A.setCalendar = function(pId, trigger, targ, commentsEnabled, callback, config){

        var config = config || {},

        // Control the behavior of date selection clicks
Severity: Major
Found in app/assets/javascripts/calendar_generator.js - About 4 days to fix

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

    /**
    * bootstrap.js v3.0.0 by @fat and @mdo
    * Copyright 2013 Twitter Inc.
    * http://www.apache.org/licenses/LICENSE-2.0
    */
    Severity: Major
    Found in app/assets/javascripts/bootstrap.js - About 3 days to fix

      File calendar_generator.js has 869 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*!
      ARIA Calendar Module R1.3.4
      Copyright 2010-2013 Bryan Garaventa (WhatSock.com)
      Part of AccDC, a Cross-Browser JavaScript accessibility API, distributed under the terms of the Open Source Initiative OSI - MIT License
      */
      Severity: Major
      Found in app/assets/javascripts/calendar_generator.js - About 2 days to fix

        Function runAfter has 305 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                                runAfter: function(dc){
                                    var nMonth = function(){
                                        var month = dc.range.current.month == 11 ? 0 : dc.range.current.month + 1,
                                            year = month > 0 ? dc.range.current.year : dc.range.current.year + 1,
                                            day = dc.range.current.mDay > dc.range[month].max ? dc.range[month].max : dc.range.current.mDay;
        Severity: Major
        Found in app/assets/javascripts/calendar_generator.js - About 1 day to fix

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

                                      var nMonth = function(){
                                          var month = dc.range.current.month == 11 ? 0 : dc.range.current.month + 1,
                                              year = month > 0 ? dc.range.current.year : dc.range.current.year + 1,
                                              day = dc.range.current.mDay > dc.range[month].max ? dc.range[month].max : dc.range.current.mDay;
                                          dc.date = new Date(year, month, day);
          Severity: Major
          Found in app/assets/javascripts/calendar_generator.js and 1 other location - About 1 day to fix
          app/assets/javascripts/calendar_generator.js on lines 364..372

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

          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

                                      }, pMonth = function(){
                                          var month = dc.range.current.month < 1 ? 11 : dc.range.current.month - 1,
                                              year = month < 11 ? dc.range.current.year : dc.range.current.year - 1,
                                              day = dc.range.current.mDay > dc.range[month].max ? dc.range[month].max : dc.range.current.mDay;
                                          dc.date = new Date(year, month, day);
          Severity: Major
          Found in app/assets/javascripts/calendar_generator.js and 1 other location - About 1 day to fix
          app/assets/javascripts/calendar_generator.js on lines 356..364

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

          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

            Tooltip.prototype.leave = function (obj) {
              var self = obj instanceof this.constructor ?
                obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
          
              clearTimeout(self.timeout)
          Severity: Major
          Found in app/assets/javascripts/bootstrap.js and 1 other location - About 1 day to fix
          app/assets/javascripts/bootstrap.js on lines 1178..1191

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

          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

            Tooltip.prototype.enter = function (obj) {
              var self = obj instanceof this.constructor ?
                obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
          
              clearTimeout(self.timeout)
          Severity: Major
          Found in app/assets/javascripts/bootstrap.js and 1 other location - About 1 day to fix
          app/assets/javascripts/bootstrap.js on lines 1193..1206

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

          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.bind('#' + dc.prevBtnId,
                                                      {
                                                      click: function(ev){
                                                          pMonth();
                                                          ev.preventDefault();
          Severity: Major
          Found in app/assets/javascripts/calendar_generator.js and 1 other location - About 1 day to fix
          app/assets/javascripts/calendar_generator.js on lines 612..638

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

          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.bind('#' + dc.nextBtnId,
                                                      {
                                                      click: function(ev){
                                                          nMonth();
                                                          ev.preventDefault();
          Severity: Major
          Found in app/assets/javascripts/calendar_generator.js and 1 other location - About 1 day to fix
          app/assets/javascripts/calendar_generator.js on lines 585..611

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

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

          /*********************************** 
            Accessible Controls for the YouTube Embedded Video Player
            Copyright (c) 2010 Ken Petri, Web Accessibility Center, The Ohio State University
            
            ** Licensing **
          Severity: Minor
          Found in app/assets/javascripts/ytp.js - About 7 hrs to fix

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

            function ytvolup(ytpid)
            {
              var ytp = document.getElementById("thisytp"+ytpid);
              if (new RegExp('^(' + ytplayer.join('|') + ')$').test(ytp.id)) 
              {
            Severity: Major
            Found in app/assets/javascripts/ytp.js and 1 other location - About 7 hrs to fix
            app/assets/javascripts/ytp.js on lines 400..429

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

            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 ytvoldown(ytpid)
            {
              var ytp = document.getElementById("thisytp"+ytpid);
              if (new RegExp('^(' + ytplayer.join('|') + ')$').test(ytp.id)) 
              {
            Severity: Major
            Found in app/assets/javascripts/ytp.js and 1 other location - About 7 hrs to fix
            app/assets/javascripts/ytp.js on lines 370..399

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

            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 (wd != dc.iterS && dc.range.current.mDay > 1){
                                                                        while (dc.range.current.wDay != dc.iterS && $A.getEl(dc.baseId + (dc.range.current.mDay - 1))){
                                                                            dc.range.current.wDay = (dc.range.current.wDay - 1) < 0 ? 6 : dc.range.current.wDay - 1;
                                                                            dc.range.current.mDay--;
                                                                        }
            Severity: Major
            Found in app/assets/javascripts/calendar_generator.js and 1 other location - About 7 hrs to fix
            app/assets/javascripts/calendar_generator.js on lines 569..575

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

            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 (wd != dc.iterE && dc.range.current.mDay < dc.range[dc.range.current.month].max){
                                                                        while (dc.range.current.wDay != dc.iterE && $A.getEl(dc.baseId + (dc.range.current.mDay + 1))){
                                                                            dc.range.current.wDay = (dc.range.current.wDay + 1) > 6 ? 0 : dc.range.current.wDay + 1;
                                                                            dc.range.current.mDay++;
                                                                        }
            Severity: Major
            Found in app/assets/javascripts/calendar_generator.js and 1 other location - About 7 hrs to fix
            app/assets/javascripts/calendar_generator.js on lines 559..565

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

            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 ($A.inArray(dc.range.current.mDay, dc.range[dc.range.current.month].disabled[dc.range.current.year]
                                                                    || dc.range[dc.range.current.month].disabled['*'] || []) === -1){
                                                                    handleClick.apply(this,
                                                                                    [
                                                                                    ev,
            Severity: Major
            Found in app/assets/javascripts/calendar_generator.js and 1 other location - About 4 hrs to fix
            app/assets/javascripts/calendar_generator.js on lines 416..424

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

            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 4 locations. Consider refactoring.
            Open

              $.fn.tooltip = function (option) {
                return this.each(function () {
                  var $this   = $(this)
                  var data    = $this.data('bs.tooltip')
                  var options = typeof option == 'object' && option
            Severity: Major
            Found in app/assets/javascripts/bootstrap.js and 3 other locations - About 4 hrs to fix
            app/assets/javascripts/bootstrap.js on lines 1555..1564
            app/assets/javascripts/bootstrap.js on lines 1703..1712
            app/assets/javascripts/bootstrap.js on lines 1959..1968

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

            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 4 locations. Consider refactoring.
            Open

              $.fn.popover = function (option) {
                return this.each(function () {
                  var $this   = $(this)
                  var data    = $this.data('bs.popover')
                  var options = typeof option == 'object' && option
            Severity: Major
            Found in app/assets/javascripts/bootstrap.js and 3 other locations - About 4 hrs to fix
            app/assets/javascripts/bootstrap.js on lines 1437..1446
            app/assets/javascripts/bootstrap.js on lines 1703..1712
            app/assets/javascripts/bootstrap.js on lines 1959..1968

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

            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 ($A.inArray(dc.range.current.mDay, dc.range[dc.range.current.month].disabled[dc.range.current.year]
                                                                    || dc.range[dc.range.current.month].disabled['*'] || []) === -1){
                                                                    handleClick.apply(this,
                                                                                    [
                                                                                    ev,
            Severity: Major
            Found in app/assets/javascripts/calendar_generator.js and 1 other location - About 4 hrs to fix
            app/assets/javascripts/calendar_generator.js on lines 435..443

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

            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 4 locations. Consider refactoring.
            Open

              $.fn.affix = function (option) {
                return this.each(function () {
                  var $this   = $(this)
                  var data    = $this.data('bs.affix')
                  var options = typeof option == 'object' && option
            Severity: Major
            Found in app/assets/javascripts/bootstrap.js and 3 other locations - About 4 hrs to fix
            app/assets/javascripts/bootstrap.js on lines 1437..1446
            app/assets/javascripts/bootstrap.js on lines 1555..1564
            app/assets/javascripts/bootstrap.js on lines 1703..1712

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

            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