piotrpolak/pepiscms

View on GitHub
pepiscms/js/jquery.frontend.js

Summary

Maintainability
D
3 days
Test Coverage

File jquery.frontend.js has 486 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var serverOffsetSec = 0; // This should be computed just once

$(document).on('ready', function () {
    ppLib.fixLayout();
    ppLib.resizeText('#font_resize_bar a');
Severity: Minor
Found in pepiscms/js/jquery.frontend.js - About 7 hrs to fix

    Function makeTablesBeautiful has 135 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        makeTablesBeautiful: function (handler) {
            handler = $(handler);
            $("td", handler).hover(
                function (event) {
                    $(this).parent().children("td").addClass("hovered");
    Severity: Major
    Found in pepiscms/js/jquery.frontend.js - About 5 hrs to fix

      Function makeInterfaceButtonsToWork has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

          makeInterfaceButtonsToWork: function () {
              $('input[type=submit].button:visible').each(function () { // a.button:visible
      
                  var $button = $(this);
      
      
      Severity: Minor
      Found in pepiscms/js/jquery.frontend.js - About 3 hrs to fix

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

          makeInterfaceButtonsToWork: function () {
              $('input[type=submit].button:visible').each(function () { // a.button:visible
      
                  var $button = $(this);
      
      
      Severity: Major
      Found in pepiscms/js/jquery.frontend.js - About 2 hrs to fix

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

            resizeText: function (trigger) {
        
                $('#font_resize_bar a').removeClass('active');
                var fSizeCookie = readCookie('fSize');
        
        
        Severity: Minor
        Found in pepiscms/js/jquery.frontend.js - About 1 hr to fix

          Function helpBubbles has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              helpBubbles: function (trigger, bubbleContentSrc, bubbleColor) {
                  // declarations
                  var hintColorClass;
          
                  if (!bubbleContentSrc) {
          Severity: Minor
          Found in pepiscms/js/jquery.frontend.js - About 1 hr to fix

            Function navFilesTree has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                navFilesTree: function (el, trigger) {
            
                    /* if item has .active, leave it open */
                    $('li', el).each(function () {
                        if ($('ul a', this).hasClass('active')) {
            Severity: Minor
            Found in pepiscms/js/jquery.frontend.js - About 1 hr to fix

              Function navFilesTree has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  navFilesTree: function (el, trigger) {
              
                      /* if item has .active, leave it open */
                      $('li', el).each(function () {
                          if ($('ul a', this).hasClass('active')) {
              Severity: Minor
              Found in pepiscms/js/jquery.frontend.js - About 1 hr to fix

              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 sessionCounter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  sessionCounter: function (sessionTimeoutUTC, serverOffsetSec) {
              
                      var today = new Date();
                      var todaySecsUTC = Math.floor(today.getTime() / 1000 + (today.getTimezoneOffset() * 60));
              
              
              Severity: Minor
              Found in pepiscms/js/jquery.frontend.js - About 25 mins to fix

              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

              There are no issues that match your filters.

              Category
              Status