webcol/Calima

View on GitHub
public_/plantillas/inspinia/js/plugins/dataTables/dataTables.bootstrap.js

Summary

Maintainability
D
2 days
Test Coverage

Function bootstrap has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
Open

    $.fn.dataTable.ext.renderer.pageButton.bootstrap = function(settings, host, idx, buttons, page, pages) {
        var api = new $.fn.dataTable.Api(settings);
        var classes = settings.oClasses;
        var lang = settings.oLanguage.oPaginate;
        var btnDisplay, btnClass;

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function fnUpdate has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

            "fnUpdate": function(oSettings, fnDraw) {
                var iListLength = 5;
                var oPaging = oSettings.oInstance.fnPagingInfo();
                var an = oSettings.aanFeatures.p;
                var i, ien, j, sClass, iStart, iEnd, iHalf = Math.floor(iListLength / 2);

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function bootstrap has 76 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $.fn.dataTable.ext.renderer.pageButton.bootstrap = function(settings, host, idx, buttons, page, pages) {
        var api = new $.fn.dataTable.Api(settings);
        var classes = settings.oClasses;
        var lang = settings.oLanguage.oPaginate;
        var btnDisplay, btnClass;

    Function attach has 66 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            var attach = function(container, buttons) {
                var i, ien, node, button;
                var clickHandler = function(e) {
                    e.preventDefault();
                    if (e.data.action !== 'ellipsis') {

      Function fnUpdate has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  "fnUpdate": function(oSettings, fnDraw) {
                      var iListLength = 5;
                      var oPaging = oSettings.oInstance.fnPagingInfo();
                      var an = oSettings.aanFeatures.p;
                      var i, ien, j, sClass, iStart, iEnd, iHalf = Math.floor(iListLength / 2);

        Function bootstrap has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            $.fn.dataTable.ext.renderer.pageButton.bootstrap = function(settings, host, idx, buttons, page, pages) {

          There are no issues that match your filters.

          Category
          Status