burningpony/phd_checker

View on GitHub

Showing 103 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

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

                      if (o.showMinute && o.minuteGrid > 0) {
                          html += '<dd class="ui_tpicker_minute ui_tpicker_minute_' + o.minuteGrid + '">' +
                                  '<div id="ui_tpicker_minute_' + dp_id + '"' +
                                  ((o.showMinute) ? '' : noDisplay) + '></div>' +
                                  '<div style="padding-left: 1px"><table><tr>';
          Severity: Major
          Found in lib/assets/javascripts/jquery-ui-timepicker-addon.js and 1 other location - About 7 hrs to fix
          lib/assets/javascripts/jquery-ui-timepicker-addon.js on lines 287..301

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

          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 (o.showSecond && o.secondGrid > 0) {
                          html += '<dd class="ui_tpicker_second ui_tpicker_second_' + o.secondGrid + '">' +
                                  '<div id="ui_tpicker_second_' + dp_id + '"' +
                                  ((o.showSecond) ? '' : noDisplay) + '></div>' +
                                  '<div style="padding-left: 1px"><table><tr>';
          Severity: Major
          Found in lib/assets/javascripts/jquery-ui-timepicker-addon.js and 1 other location - About 7 hrs to fix
          lib/assets/javascripts/jquery-ui-timepicker-addon.js on lines 268..282

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

          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

          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

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

                            $tp.find(".ui_tpicker_second table").css({
                                width: size + "%",
                                marginLeft: (size / (-2 * secondGridSize)) + "%",
                                borderCollapse: 'collapse'
                            }).find("td").each(function(index) {
            Severity: Major
            Found in lib/assets/javascripts/jquery-ui-timepicker-addon.js and 1 other location - About 6 hrs to fix
            lib/assets/javascripts/jquery-ui-timepicker-addon.js on lines 387..401

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

            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

                            $tp.find(".ui_tpicker_minute table").css({
                                width: size + "%",
                                marginLeft: (size / (-2 * minuteGridSize)) + "%",
                                borderCollapse: 'collapse'
                            }).find("td").each(function(index) {
            Severity: Major
            Found in lib/assets/javascripts/jquery-ui-timepicker-addon.js and 1 other location - About 6 hrs to fix
            lib/assets/javascripts/jquery-ui-timepicker-addon.js on lines 405..419

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

            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

            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

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

                                                      le = left.indexOf("%") === -1
                                                          ? left +
                                                                " + (t = " +
                                                                sl +
                                                                " ? " +
                  Severity: Major
                  Found in app/assets/javascripts/simple_modal.js and 1 other location - About 3 hrs to fix
                  app/assets/javascripts/simple_modal.js on lines 524..544

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

                  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

                                                  te = top.indexOf("%") === -1
                                                      ? top +
                                                            " + (t = " +
                                                            st +
                                                            " ? " +
                  Severity: Major
                  Found in app/assets/javascripts/simple_modal.js and 1 other location - About 3 hrs to fix
                  app/assets/javascripts/simple_modal.js on lines 550..570

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

                  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.second_slider = $tp.find('#ui_tpicker_second_'+ dp_id).slider({
                                  orientation: "horizontal",
                                  value: this.second,
                                  min: o.secondMin,
                                  max: secMax,
                  Severity: Major
                  Found in lib/assets/javascripts/jquery-ui-timepicker-addon.js and 1 other location - About 3 hrs to fix
                  lib/assets/javascripts/jquery-ui-timepicker-addon.js on lines 315..325

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

                  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.hour_slider = $tp.find('#ui_tpicker_hour_'+ dp_id).slider({
                                  orientation: "horizontal",
                                  value: this.hour,
                                  min: o.hourMin,
                                  max: hourMax,
                  Severity: Major
                  Found in lib/assets/javascripts/jquery-ui-timepicker-addon.js and 1 other location - About 3 hrs to fix
                  lib/assets/javascripts/jquery-ui-timepicker-addon.js on lines 342..352

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

                  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

                  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

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

                            if (
                                n[i].text != null &&
                                n[i + 1].text == null &&
                                n[i].row + 1 < o.length &&
                                o[n[i].row + 1].text == null &&
                    Severity: Major
                    Found in app/assets/javascripts/diff.js and 1 other location - About 3 hrs to fix
                    app/assets/javascripts/diff.js on lines 185..194

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

                    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 (h.toString().indexOf('%') > -1) {
                                    h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px';
                    
                                } else {
                                    h = h == 'auto' ? 'auto' : h + 'px';    
                    Severity: Major
                    Found in public/fancybox/jquery.fancybox-1.3.4.js and 1 other location - About 3 hrs to fix
                    public/fancybox/jquery.fancybox-1.3.4.js on lines 284..289

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

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language