Nevillealee/cs_prepaid_app

View on GitHub
doc/js/app.js

Summary

Maintainability
C
1 day
Test Coverage

Showing 8 of 12 total issues

File app.js has 277 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function() {
 
var localStorage = {}, sessionStorage = {};
try { localStorage = window.localStorage; } catch (e) { }
try { sessionStorage = window.sessionStorage; } catch (e) { }
Severity: Minor
Found in doc/js/app.js - About 2 hrs to fix

    Function generateTOC has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function generateTOC() {
    if ($('#filecontents').length === 0) return;
    var _toc = $('<ol class="top"></ol>');
    var show = false;
    var toc = _toc;
    Severity: Minor
    Found in doc/js/app.js - About 2 hrs to fix

      Function constantSummaryToggle has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function constantSummaryToggle() {
      $('.constants_summary_toggle').click(function(e) {
      e.preventDefault();
      localStorage.summaryCollapsed = $(this).text();
      $('.constants_summary_toggle').each(function() {
      Severity: Minor
      Found in doc/js/app.js - About 1 hr to fix

        Function summaryToggle has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function summaryToggle() {
        $('.summary_toggle').click(function(e) {
        e.preventDefault();
        localStorage.summaryCollapsed = $(this).text();
        $('.summary_toggle').each(function() {
        Severity: Minor
        Found in doc/js/app.js - About 1 hr to fix

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

          if (localStorage.summaryCollapsed == "collapse") {
          $('.constants_summary_toggle').first().click();
          } else { localStorage.summaryCollapsed = "expand"; }
          Severity: Minor
          Found in doc/js/app.js and 1 other location - About 50 mins to fix
          doc/js/app.js on lines 118..120

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

          function() {
          $(this).parent().nextAll('.source_code').slideUp(100);
          $(this).text("View source");
          });
          Severity: Minor
          Found in doc/js/app.js and 1 other location - About 50 mins to fix
          doc/js/app.js on lines 10..13

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

          if (localStorage.summaryCollapsed == "collapse") {
          $('.summary_toggle').first().click();
          } else { localStorage.summaryCollapsed = "expand"; }
          Severity: Minor
          Found in doc/js/app.js and 1 other location - About 50 mins to fix
          doc/js/app.js on lines 161..163

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

          $('.toggleSource').toggle(function() {
          $(this).parent().nextAll('.source_code').slideDown(100);
          $(this).text("Hide source");
          },
          Severity: Minor
          Found in doc/js/app.js and 1 other location - About 50 mins to fix
          doc/js/app.js on lines 14..17

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

          $('#toc .hide_toc').toggle(function() {
          $('#toc .top').slideUp('fast');
          $('#toc').toggleClass('hidden');
          $('#toc .title small').toggle();
          }, function() {
          Severity: Minor
          Found in doc/js/app.js and 1 other location - About 45 mins to fix
          doc/js/app.js on lines 212..216

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

          }, function() {
          $('#toc .top').slideDown('fast');
          $('#toc').toggleClass('hidden');
          $('#toc .title small').toggle();
          });
          Severity: Minor
          Found in doc/js/app.js and 1 other location - About 45 mins to fix
          doc/js/app.js on lines 208..212

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

          $(this).parent().prev().height($(this).parent().height());
          Severity: Minor
          Found in doc/js/app.js and 1 other location - About 35 mins to fix
          doc/js/app.js on lines 42..42

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

          $(this).parent().prev().height($(this).parent().height());
          Severity: Minor
          Found in doc/js/app.js and 1 other location - About 35 mins to fix
          doc/js/app.js on lines 26..26

          There are no issues that match your filters.

          Category
          Status