vegantech/sims

View on GitHub

Showing 223 of 433 total issues

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

function ignoreAll() {
    var wi = this.currentWordIndex;
    var ti = this.currentTextIndex;
    if( !this.wordWin ) {
        alert( 'Error: Word frame not available.' );
Severity: Minor
Found in public/speller/spellChecker.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 replaceAll has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

function replaceAll() {
    var ti = this.currentTextIndex;
    var wi = this.currentWordIndex;
    if( !this.wordWin ) {
        alert( 'Error: Word frame not available.' );
Severity: Minor
Found in app/assets/javascripts/spellerpages/spellChecker.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

Method status has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

  def status
    if draft?
      STATUS[:draft]
    elsif promoted? and RECOMMENDATION[recommendation][:show_elig]
      STATUS[:can_refer]
Severity: Minor
Found in app/models/recommendation.rb - 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 ignoreAll has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

function ignoreAll() {
    var wi = this.currentWordIndex;
    var ti = this.currentTextIndex;
    if( !this.wordWin ) {
        alert( 'Error: Word frame not available.' );
Severity: Minor
Found in app/assets/javascripts/spellerpages/spellChecker.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 replaceAll has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

function replaceAll() {
    var ti = this.currentTextIndex;
    var wi = this.currentWordIndex;
    if( !this.wordWin ) {
        alert( 'Error: Word frame not available.' );
Severity: Minor
Found in public/speller/spellChecker.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 onload has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

window.onload = function(evt) {
    if (ieConsoleSavedOnLoad) ieConsoleSavedOnLoad(evt);
    if (typeof console == "undefined") console = {};
    if (typeof console.log == "undefined") {
        console.log = function(msg) {
Severity: Minor
Found in app/assets/javascripts/ie-console.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 createButton has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        o.createButton = function() {
                if(o.staticPos) { return; };
                
                var but;
                
Severity: Minor
Found in app/assets/javascripts/datepicker.js - About 1 hr to fix

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

        dom.resolve = function() {
            var results = new Array();
            var i,j,o;
            for (var i=0; i<arguments.length; i++) {
                var o = arguments[i];
    Severity: Minor
    Found in app/assets/javascripts/popup.js - About 1 hr to fix

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

      Popup.prototype.setPosition = function() {
          if (this.position!=null) {
              var m = this.position.match(/^(\S+)\s+(\S+)/); 
              if (m!=null && m.length==3) {
                  var v = m[1];
      Severity: Minor
      Found in app/assets/javascripts/popup.js - About 1 hr to fix

        Function getType has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            getType: function(value) {
                var self = IEConsole;
                var type = typeof value;
                try {
                    if (type == "undefined") {
        Severity: Minor
        Found in app/assets/javascripts/ie-console.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 destroy has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                o.destroy = function() {
                        // Cleanup for Internet Explorer
                        datePickerController.removeEvent(o.staticPos ? o.table : document, "mousedown", o.events.onmousedown);
                        datePickerController.removeEvent(document, "mouseup",   o.events.clearTimer);
                        o.removeKeyboardEvents();
        Severity: Minor
        Found in app/assets/javascripts/datepicker.js - About 1 hr to fix

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

              getType: function(value) {
                  var self = IEConsole;
                  var type = typeof value;
                  try {
                      if (type == "undefined") {
          Severity: Minor
          Found in app/assets/javascripts/ie-console.js - About 1 hr to fix

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

            function writeBody() {
                var d = window.document;
                var is_html = false;
            
                d.open();
            Severity: Minor
            Found in public/speller/wordWindow.js - About 1 hr to fix

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

                      o.returnFormattedDate = function() {
              
                              var elem = o.getElem();
                              if(!elem) return;
                              
              Severity: Minor
              Found in app/assets/javascripts/datepicker.js - About 1 hr to fix

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

                function writeBody() {
                    var d = window.document;
                    var is_html = false;
                
                    d.open();
                Severity: Minor
                Found in app/assets/javascripts/spellerpages/wordWindow.js - About 1 hr to fix

                  Method index has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def index
                      #TODO test and refactor
                      flash[:notice]=nil
                  
                      @without=params[:without]
                  Severity: Minor
                  Found in app/controllers/stats_controller.rb - About 1 hr to fix

                    Method add_extended_profile has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def self.add_extended_profile(student)
                        FactoryGirl.create :ext_summary, student: student
                        FactoryGirl.create :ext_adult_contact, student: student
                        FactoryGirl.create :ext_sibling, student: student
                        student.ext_test_scores.create!( [
                    Severity: Minor
                    Found in lib/training_district/student.rb - About 1 hr to fix

                      Function show has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      Popup.prototype.show = function(options, modal) {
                          this.modal = this.modal || (typeof(modal)=="boolean" && modal);
                          if (defined(options) && options!=null && typeof(options)=="object") {
                              for (var i in options) {
                                  this[i] = options[i];
                      Severity: Minor
                      Found in app/assets/javascripts/popup.js - About 1 hr to fix

                        Function setDateFromInput has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                o.setDateFromInput = function() {
                                        function m2c(val) {
                                                return String(val).length < 2 ? "00".substring(0, 2 - String(val).length) + String(val) : val;
                                        };
                        
                        
                        Severity: Minor
                        Found in app/assets/javascripts/datepicker.js - About 1 hr to fix

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

                          function spellChecker( textObject ) {
                          
                              // public properties - configurable
                              this.popUpUrl = '/speller/spellchecker.html';
                              this.popUpName = 'spellchecker';
                          Severity: Minor
                          Found in app/assets/javascripts/spellerpages/spellChecker.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language