mambax7/alumni-26x

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

Summary

Maintainability
C
1 day
Test Coverage

Function bindEvents has 121 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        bindEvents: function( c, wo ) {
            var namespace = tse.namespace;
            c.$table
                .off( ( 'updateComplete pagerComplete '.split( ' ' ).join( namespace + ' ' ) ).replace( /\s+/g, ' ' ) )
                .on( 'updateComplete pagerComplete '.split( ' ' ).join( namespace + ' ' ), function() {
Severity: Major
Found in media/jquery/tablesorter-master/js/widgets/widget-editable.js - About 4 hrs to fix

    File widget-editable.js has 269 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*! Widget: editable - updated 4/4/2017 (v2.28.7) *//*
     * Requires tablesorter v2.8+ and jQuery 1.7+
     * by Rob Garrison
     */
    /*jshint browser:true, jquery:true, unused:false */
    Severity: Minor
    Found in media/jquery/tablesorter-master/js/widgets/widget-editable.js - About 2 hrs to fix

      Function update has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              update: function( c, wo ) {
                  var $t, $cells, cellIndex, cellLen, $editable, editableIndex, editableLen,
                      tmp = $( '<div>' ).wrapInner( wo.editable_wrapContent ).children().length || $.isFunction( wo.editable_wrapContent ),
                      cols = tse.getColumns( c, wo ).join( ',' );
      
      
      Severity: Minor
      Found in media/jquery/tablesorter-master/js/widgets/widget-editable.js - About 1 hr to fix

        Function getColumns has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                getColumns : function( c, wo ) {
                    var list, indx, range, len, tmp,
                        editableColumns = wo.editable_columns,
                        cols = [];
                    if ( typeof editableColumns === 'string' ) {
        Severity: Minor
        Found in media/jquery/tablesorter-master/js/widgets/widget-editable.js - About 1 hr to fix

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

                      c.$table
                          .off( ( 'updateComplete pagerComplete '.split( ' ' ).join( namespace + ' ' ) ).replace( /\s+/g, ' ' ) )
                          .on( 'updateComplete pagerComplete '.split( ' ' ).join( namespace + ' ' ), function() {
                              tse.update( c, c.widgetOptions );
                          })
          Severity: Minor
          Found in media/jquery/tablesorter-master/js/widgets/widget-editable.js and 1 other location - About 35 mins to fix
          media/jquery/tablesorter-master/js/widgets/widget-editable.js on lines 152..188

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

          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

                      c.$tbodies
                          .off( ( 'focus focusout keydown '.split( ' ' ).join( namespace + ' ' ) ).replace( /\s+/g, ' ' ) )
                          .on( 'focus' + namespace, '[contenteditable]', function( e ) {
                              clearTimeout( $( this ).data( 'timer' ) );
                              c.$table.data( 'contentFocused', e.target );
          Severity: Minor
          Found in media/jquery/tablesorter-master/js/widgets/widget-editable.js and 1 other location - About 35 mins to fix
          media/jquery/tablesorter-master/js/widgets/widget-editable.js on lines 134..138

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

          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