mambax7/alumni-26x

View on GitHub
media/jquery/tablesorter-master/js/widgets/widget-alignChar.js

Summary

Maintainability
C
1 day
Test Coverage

Function setup has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        setup: function(table, c, wo, v){
            // do nothing for empty tables
            if ($.isEmptyObject(c.cache)) { return; }
            var tbodyIndex, rowIndex, start, end, last, index, rows, val, count,
                len, wLeft, wRight, alignChar, $row,
Severity: Major
Found in media/jquery/tablesorter-master/js/widgets/widget-alignChar.js - About 2 hrs to fix

    Consider simplifying this complex logical expression.
    Open

                        if ( index >= 0 ) {
                            left.push( val.substring(0, index) || '' );
                            right.push( val.substring(index, val.length) || '' );
                        } else {
                            // no align character found!
    Severity: Major
    Found in media/jquery/tablesorter-master/js/widgets/widget-alignChar.js - About 1 hr to fix

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

                      c.$headers.filter('[' + wo.alignChar_charAttrib + ']').each(function(){
                          ts.alignChar.remove(table, c, this.column);
                      });
      media/jquery/tablesorter-master/js/widgets/widget-alignChar.js on lines 140..142

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 61.

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

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

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

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

      Refactorings

      Further Reading

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

                  c.$headers.filter('[' + wo.alignChar_charAttrib + ']').each(function(){
                      ts.alignChar.remove(table, c, this.column);
                  });
      media/jquery/tablesorter-master/js/widgets/widget-alignChar.js on lines 126..128

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 61.

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

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

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

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

      Refactorings

      Further Reading

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

                  wLeft = ($.extend([], left)).sort(function(a, b){ return b.length - a.length; })[0];
      Severity: Minor
      Found in media/jquery/tablesorter-master/js/widgets/widget-alignChar.js and 1 other location - About 45 mins to fix
      media/jquery/tablesorter-master/js/widgets/widget-alignChar.js on lines 74..74

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

      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

                  wRight = ($.extend([], right)).sort(function(a, b){ return b.length - a.length; })[0];
      Severity: Minor
      Found in media/jquery/tablesorter-master/js/widgets/widget-alignChar.js and 1 other location - About 45 mins to fix
      media/jquery/tablesorter-master/js/widgets/widget-alignChar.js on lines 73..73

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

      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

                          $row = rows.row ? rows.row[rowIndex] : rows.normalized[rowIndex][c.columns].$row;
      Severity: Minor
      Found in media/jquery/tablesorter-master/js/widgets/widget-alignChar.js and 1 other location - About 30 mins to fix
      media/jquery/tablesorter-master/js/widgets/widget-alignChar.js on lines 85..85

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

      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

                          $row = rows.row ? rows.row[rowIndex] : rows.normalized[rowIndex][c.columns].$row;
      Severity: Minor
      Found in media/jquery/tablesorter-master/js/widgets/widget-alignChar.js and 1 other location - About 30 mins to fix
      media/jquery/tablesorter-master/js/widgets/widget-alignChar.js on lines 104..104

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

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

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

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

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

      Refactorings

      Further Reading

      There are no issues that match your filters.

      Category
      Status