burningpony/phd_checker

View on GitHub

Showing 50 of 103 total issues

File jquery.fancybox-1.3.4.js has 844 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * FancyBox - jQuery Plugin
 * Simple and fancy lightbox alternative
 *
 * Examples and documentation at: http://fancybox.net
Severity: Major
Found in public/fancybox/jquery.fancybox-1.3.4.js - About 2 days to fix

    File simple_modal.js has 582 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
     * SimpleModal @VERSION - jQuery Plugin
     * http://simplemodal.com/
     * Copyright (c) 2013 Eric Martin
     * Licensed under MIT and GPL
    Severity: Major
    Found in app/assets/javascripts/simple_modal.js - About 1 day to fix

      File jquery-ui-timepicker-addon.js has 570 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
      * jQuery timepicker addon
      * By: Trent Richardson [http://trentrichardson.com]
      * Version 0.9
      * Last Modified: 11/29/2010
      Severity: Major
      Found in lib/assets/javascripts/jquery-ui-timepicker-addon.js - About 1 day to fix

        File phd.js has 504 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        const PHASE_ONE_ID = 1;
        const PHASE_TWO_ID = 2;
        var TIME_LIMIT_IN_MINUTES = 7;
        var INTERVAL_IN_SECONDS_OF_HOW_OFTEN_TO_SHOW_OTHER_STUDENT_ACTIONS = 60; // one minute
        var TIMEOUT_FOR_OTHER_PARTICIPANTS = 15 * 1000;
        Severity: Major
        Found in app/assets/javascripts/phd.js - About 1 day to fix

          Function _injectTimePicker has 184 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _injectTimePicker: function() {
                  var $dp = this.inst.dpDiv,
                      o = this._defaults,
                      tp_inst = this,
                      // Added by Peter Medeiros:
          Severity: Major
          Found in lib/assets/javascripts/jquery-ui-timepicker-addon.js - About 7 hrs to fix

            Function _start has 160 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    _start = function() {
                        var obj = selectedArray[ selectedIndex ],
                            href, 
                            type, 
                            title,
            Severity: Major
            Found in public/fancybox/jquery.fancybox-1.3.4.js - About 6 hrs to fix

              Function fixIE has 140 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      fixIE: function() {
                          var s = this,
                              p = s.o.position;
              
                          // simulate fixed position - adapted from BlockUI
              Severity: Major
              Found in app/assets/javascripts/simple_modal.js - About 5 hrs to fix

                Function _show has 106 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        _show = function() {
                            var pos, equal;
                
                            loading.hide();
                
                Severity: Major
                Found in public/fancybox/jquery.fancybox-1.3.4.js - About 4 hrs to fix

                  Function diffString has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function diffString(o, n) {
                      o = o.replace(/\s+$/, "");
                      n = n.replace(/\s+$/, "");
                  
                      var out = diff(
                  Severity: Minor
                  Found in app/assets/javascripts/diff.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 generate_box has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          function generate_box(span) {
                              var is_quota = span.className.match(/quota/i) != null
                                  ? true
                                  : false;
                              if (is_quota && window.__show_quota_items) {
                  Severity: Major
                  Found in app/assets/javascripts/phd.js - About 3 hrs to fix

                    Function create has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            create: function(data) {
                                var s = this;
                    
                                // get the window properties
                                s.getDimensions();
                    Severity: Major
                    Found in app/assets/javascripts/simple_modal.js - About 2 hrs to fix

                      Function setContainerDimensions has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              setContainerDimensions: function() {
                                  var s = this,
                                      badIE = browser.ie6 || browser.ie7;
                      
                                  // get the dimensions for the container and data
                      Severity: Major
                      Found in app/assets/javascripts/simple_modal.js - About 2 hrs to fix

                        Function _process_title has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                _process_title = function() {
                                    titleStr = currentOpts.title || '';
                                    titleHeight = 0;
                        
                                    title
                        Severity: Major
                        Found in public/fancybox/jquery.fancybox-1.3.4.js - About 2 hrs to fix

                          Method analyze has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def analyze
                              {
                                id: id,
                                group: group,
                                data_id: participant_id,
                          Severity: Major
                          Found in app/models/user.rb - About 2 hrs to fix

                            Function close has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                $.fancybox.close = function() {
                                    if (busy || wrap.is(':hidden')) {
                                        return;
                                    }
                            
                            Severity: Major
                            Found in public/fancybox/jquery.fancybox-1.3.4.js - About 2 hrs to fix

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

                              function diffString2(o, n) {
                                  o = o.replace(/\s+$/, "");
                                  n = n.replace(/\s+$/, "");
                              
                                  var out = diff(
                              Severity: Minor
                              Found in app/assets/javascripts/diff.js - About 1 hr to fix

                                Function diff has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function diff(o, n) {
                                    var ns = new Object();
                                    var os = new Object();
                                
                                    for (var i = 0; i < n.length; i++) {
                                Severity: Minor
                                Found in app/assets/javascripts/diff.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 init has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    $.fancybox.init = function() {
                                        if ($("#fancybox-wrap").length) {
                                            return;
                                        }
                                
                                Severity: Minor
                                Found in public/fancybox/jquery.fancybox-1.3.4.js - About 1 hr to fix

                                  Function diffString has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function diffString(o, n) {
                                      o = o.replace(/\s+$/, "");
                                      n = n.replace(/\s+$/, "");
                                  
                                      var out = diff(
                                  Severity: Minor
                                  Found in app/assets/javascripts/diff.js - About 1 hr to fix

                                    Function diff has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function diff(o, n) {
                                        var ns = new Object();
                                        var os = new Object();
                                    
                                        for (var i = 0; i < n.length; i++) {
                                    Severity: Minor
                                    Found in app/assets/javascripts/diff.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language