mangroveorg/datawinners

View on GitHub
datawinners/media/javascript/data_tables/js/dataTables.colVis.js

Summary

Maintainability
F
6 days
Test Coverage

Function factory has 542 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var factory = function( $, DataTable ) {
"use strict";

/**
 * ColVis provides column visibility control for DataTables
Severity: Major
Found in datawinners/media/javascript/data_tables/js/dataTables.colVis.js - About 2 days to fix

    File dataTables.colVis.js has 556 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*! ColVis 1.1.2
     * ©2010-2015 SpryMedia Ltd - datatables.net/license
     */
    
    /**
    Severity: Major
    Found in datawinners/media/javascript/data_tables/js/dataTables.colVis.js - About 1 day to fix

      Function _fnDomColumnButton has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          "_fnDomColumnButton": function ( i )
          {
              var
                  that = this,
                  column = this.s.dt.aoColumns[i],
      Severity: Minor
      Found in datawinners/media/javascript/data_tables/js/dataTables.colVis.js - About 1 hr to fix

        Function _fnCollectionShow has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            "_fnCollectionShow": function ()
            {
                var that = this, i, iLen, iLeft;
                var oPos = $(this.dom.button).offset();
                var nHidden = this.dom.collection;
        Severity: Minor
        Found in datawinners/media/javascript/data_tables/js/dataTables.colVis.js - About 1 hr to fix

          Function _fnAddButtons has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              "_fnAddButtons": function ()
              {
                  var
                      nButton,
                      columns = this.s.dt.aoColumns;
          Severity: Minor
          Found in datawinners/media/javascript/data_tables/js/dataTables.colVis.js - About 1 hr to fix

            Function _fnConstruct has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                "_fnConstruct": function ( init )
                {
                    this._fnApplyCustomisation( init );
            
                    var that = this;
            Severity: Minor
            Found in datawinners/media/javascript/data_tables/js/dataTables.colVis.js - About 1 hr to fix

              Function _fnDrawCallback has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  "_fnDrawCallback": function ()
                  {
                      var columns = this.s.dt.aoColumns;
                      var buttons = this.dom.buttons;
                      var groups = this.s.aoGroups;
              Severity: Minor
              Found in datawinners/media/javascript/data_tables/js/dataTables.colVis.js - About 1 hr to fix

                Function ColVis has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                var ColVis = function( oDTSettings, oInit )
                {
                    /* Santiy check that we are a new instance */
                    if ( !this.CLASS || this.CLASS != "ColVis" )
                    {
                Severity: Minor
                Found in datawinners/media/javascript/data_tables/js/dataTables.colVis.js - About 1 hr to fix

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

                          var allVisible = function ( columnIndeces ) {
                              for ( var k=0, kLen=columnIndeces.length ; k<kLen ; k++ )
                              {
                                  if (  columns[columnIndeces[k]].bVisible === false ) { return false; }
                              }
                  datawinners/media/javascript/data_tables/js/dataTables.colVis.js on lines 376..382

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

                  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 allHidden = function ( columnIndeces ) {
                              for ( var m=0 , mLen=columnIndeces.length ; m<mLen ; m++ )
                              {
                                  if ( columns[columnIndeces[m]].bVisible === true ) { return false; }
                              }
                  datawinners/media/javascript/data_tables/js/dataTables.colVis.js on lines 369..375

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

                  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.s.showAll )
                          {
                              nButton = this._fnDomShowXButton( this.s.showAll, true );
                              nButton.className += " ColVis_ShowAll";
                              this.dom.buttons.push( nButton );
                  datawinners/media/javascript/data_tables/js/dataTables.colVis.js on lines 478..483

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

                  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.s.showNone )
                          {
                              nButton = this._fnDomShowXButton( this.s.showNone, false );
                              nButton.className += " ColVis_ShowNone";
                              this.dom.buttons.push( nButton );
                  datawinners/media/javascript/data_tables/js/dataTables.colVis.js on lines 471..476

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

                  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 ( allVisible(groups[j].aiColumns) )
                              {
                                  $('input', this.dom.groupButtons[j]).prop('checked', true);
                                  $('input', this.dom.groupButtons[j]).prop('indeterminate', false);
                              }
                  datawinners/media/javascript/data_tables/js/dataTables.colVis.js on lines 391..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 62.

                  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

                              else if ( allHidden(groups[j].aiColumns) )
                              {
                                  $('input', this.dom.groupButtons[j]).prop('checked', false);
                                  $('input', this.dom.groupButtons[j]).prop('indeterminate', false);
                              }
                  datawinners/media/javascript/data_tables/js/dataTables.colVis.js on lines 386..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 62.

                  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

                              $(this.dom.background).animate({"opacity": 0}, that.s.iOverlayFade, function (e) {
                                  document.body.removeChild( that.dom.background );
                                  document.body.removeChild( that.dom.catcher );
                              } );
                  datawinners/media/javascript/data_tables/js/jquery.dataTables.min.js on lines 2344..2347

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

                  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