techvision/brails4

View on GitHub

Showing 157 of 157 total issues

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

  $.fn.scrollspy = function (option) {
    return this.each(function () {
      var $this   = $(this)
      var data    = $this.data('bs.scrollspy')
      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 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

                            var lbl = dc.parent.range.current.mDay + ', ' + dc.parent.range.wDays[dc.parent.range.current.wDay].lng + ' '
                                + dc.parent.range[dc.parent.range.current.month].name + ' ' + dc.parent.range.current.year, pre = '';
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 880..882

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

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

                                                title: dc.parent.range.current.mDay + ', '
                                                    + dc.parent.range.wDays[dc.parent.range.current.wDay].lng + ' '
                                                    + dc.parent.range[dc.parent.range.current.month].name + ' ' + dc.parent.range.current.year
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 800..801

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

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

                                            keydown: function(ev){
                                                changePressed(ev);
                                                var k = ev.which || ev.keyCode;

                                                if ((k >= 37 && k <= 40) || k == 27 || (k >= 33 && k <= 36)){
Severity: Major
Found in app/assets/javascripts/calendar_generator.js - About 4 hrs to fix

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

      $.fn.alert = function (option) {
        return this.each(function () {
          var $this = $(this)
          var data  = $this.data('bs.alert')
    
    
    Severity: Major
    Found in app/assets/javascripts/bootstrap.js and 1 other location - About 3 hrs to fix
    app/assets/javascripts/bootstrap.js on lines 794..802

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 114.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

      $.fn.dropdown = function (option) {
        return this.each(function () {
          var $this = $(this)
          var data  = $this.data('dropdown')
    
    
    Severity: Major
    Found in app/assets/javascripts/bootstrap.js and 1 other location - About 3 hrs to fix
    app/assets/javascripts/bootstrap.js on lines 135..143

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 114.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function runBefore has 97 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                            runBefore: function(dc){
                                if (config.ajax && typeof config.ajax === 'function' && !dc.stopAjax && !dc.ajaxLoading){
                                    dc.ajaxLoading = dc.cancel = true;
                                    config.ajax.apply(dc,
                                                    [
    Severity: Major
    Found in app/assets/javascripts/calendar_generator.js - About 3 hrs to fix

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

                                                              if (wd != dc.iterS && dc.range.current.mDay > 1){
                                                                  dc.range.current.mDay--;
                                                                  dc.range.current.wDay = (wd - 1) < 0 ? 6 : wd - 1;
                                                                  dc.setFocus(dc.range.index[dc.range.current.mDay - 1], this);
                                                              }
      Severity: Major
      Found in app/assets/javascripts/calendar_generator.js and 1 other location - About 3 hrs to fix
      app/assets/javascripts/calendar_generator.js on lines 482..495

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 98.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function reset has 74 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                              reset: function(){
                                  var dc = this;
      
                                  if (dc.openEditor){
                                      dc.comments = dc.parent.range[dc.parent.range.current.month].comments;
      Severity: Major
      Found in app/assets/javascripts/calendar_generator.js - About 2 hrs to fix

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

                                        $A.setAttr(dc.commentBtn,
                                                        {
                                                        title: (config.editor && config.editor.role || 'Edit') + ' ' + $A.reg[pId + 'commentTooltip'].role
                                                        }).innerHTML = config.editor && config.editor.role || 'Edit';
        Severity: Major
        Found in app/assets/javascripts/calendar_generator.js and 1 other location - About 2 hrs to fix
        app/assets/javascripts/calendar_generator.js on lines 888..891

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

        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.setAttr(dc.commentBtn,
                                                        {
                                                        title: (config.editor && config.editor.action1 || 'Save') + ' ' + $A.reg[pId + 'commentTooltip'].role
                                                        }).innerHTML = config.editor && config.editor.action1 || 'Save';
        Severity: Major
        Found in app/assets/javascripts/calendar_generator.js and 1 other location - About 2 hrs to fix
        app/assets/javascripts/calendar_generator.js on lines 905..908

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

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

        function ytPlayerInit(list,aspect,ytp,pid)
        {
          var width = "480";
          if (aspect == "normal") 
          {
        Severity: Major
        Found in app/assets/javascripts/ytp.js - About 2 hrs to fix

          File tabPanel.js has 278 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          $(document).ready(function() {
            var panel1 = new tabpanel("tabpanel1", false);
          });
          
          //
          Severity: Minor
          Found in app/assets/javascripts/tabPanel.js - About 2 hrs to fix

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

                                                                        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;
            Severity: Major
            Found in app/assets/javascripts/calendar_generator.js and 1 other location - About 2 hrs to fix
            app/assets/javascripts/calendar_generator.js on lines 505..506

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

            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

                                                                        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;
            Severity: Major
            Found in app/assets/javascripts/calendar_generator.js and 1 other location - About 2 hrs to fix
            app/assets/javascripts/calendar_generator.js on lines 489..490

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

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

            tabpanel.prototype.handleTabKeyDown = function($tab, e) {
            
              if (e.altKey) {
                // do nothing
                return true;
            Severity: Major
            Found in app/assets/javascripts/tabPanel.js - About 2 hrs to fix

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

                                                                      {
                                                                      shrt: config.days && config.days[4] ? config.days[4].s : 'T',
                                                                      lng: config.days && config.days[4] ? config.days[4].l : 'Thursday'
                                                                      },
              Severity: Major
              Found in app/assets/javascripts/calendar_generator.js and 6 other locations - About 2 hrs to fix
              app/assets/javascripts/calendar_generator.js on lines 150..153
              app/assets/javascripts/calendar_generator.js on lines 154..157
              app/assets/javascripts/calendar_generator.js on lines 158..161
              app/assets/javascripts/calendar_generator.js on lines 162..165
              app/assets/javascripts/calendar_generator.js on lines 170..173
              app/assets/javascripts/calendar_generator.js on lines 174..177

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

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

                                                                      {
                                                                      shrt: config.days && config.days[2] ? config.days[2].s : 'T',
                                                                      lng: config.days && config.days[2] ? config.days[2].l : 'Tuesday'
                                                                      },
              Severity: Major
              Found in app/assets/javascripts/calendar_generator.js and 6 other locations - About 2 hrs to fix
              app/assets/javascripts/calendar_generator.js on lines 150..153
              app/assets/javascripts/calendar_generator.js on lines 154..157
              app/assets/javascripts/calendar_generator.js on lines 162..165
              app/assets/javascripts/calendar_generator.js on lines 166..169
              app/assets/javascripts/calendar_generator.js on lines 170..173
              app/assets/javascripts/calendar_generator.js on lines 174..177

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

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

                                                                      {
                                                                      shrt: config.days && config.days[5] ? config.days[5].s : 'F',
                                                                      lng: config.days && config.days[5] ? config.days[5].l : 'Friday'
                                                                      },
              Severity: Major
              Found in app/assets/javascripts/calendar_generator.js and 6 other locations - About 2 hrs to fix
              app/assets/javascripts/calendar_generator.js on lines 150..153
              app/assets/javascripts/calendar_generator.js on lines 154..157
              app/assets/javascripts/calendar_generator.js on lines 158..161
              app/assets/javascripts/calendar_generator.js on lines 162..165
              app/assets/javascripts/calendar_generator.js on lines 166..169
              app/assets/javascripts/calendar_generator.js on lines 174..177

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

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

                                                                      {
                                                                      shrt: config.days && config.days[1] ? config.days[1].s : 'M',
                                                                      lng: config.days && config.days[1] ? config.days[1].l : 'Monday'
                                                                      },
              Severity: Major
              Found in app/assets/javascripts/calendar_generator.js and 6 other locations - About 2 hrs to fix
              app/assets/javascripts/calendar_generator.js on lines 150..153
              app/assets/javascripts/calendar_generator.js on lines 158..161
              app/assets/javascripts/calendar_generator.js on lines 162..165
              app/assets/javascripts/calendar_generator.js on lines 166..169
              app/assets/javascripts/calendar_generator.js on lines 170..173
              app/assets/javascripts/calendar_generator.js on lines 174..177

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

              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