vegantech/sims

View on GitHub

Showing 223 of 433 total issues

Function datePicker has 885 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function datePicker(options) {

        this.defaults          = {};
        for(opt in options) { this[opt] = this.defaults[opt] = options[opt]; };
        
Severity: Major
Found in app/assets/javascripts/datepicker.js - About 4 days to fix

    File datepicker.js has 1113 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
            DatePicker v4.4 by frequency-decoder.com
    
            Released under a creative commons Attribution-ShareAlike 2.5 license (http://creativecommons.org/licenses/by-sa/2.5/)
    
    
    Severity: Major
    Found in app/assets/javascripts/datepicker.js - About 2 days to fix

      File popup.js has 928 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * Copyright (c)2005-2009 Matt Kruse (javascripttoolbox.com)
       * 
       * Dual licensed under the MIT and GPL licenses. 
       * This basically means you can use this code however you want for
      Severity: Major
      Found in app/assets/javascripts/popup.js - About 2 days to fix

        Function Position has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring.
        Open

        var Position = (function() {
            // Resolve a string identifier to an object
            // ========================================
            function resolveObject(s) {
                if (document.getElementById && document.getElementById(s)!=null) {
        Severity: Minor
        Found in app/assets/javascripts/popup.js - About 1 day 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 CSS has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring.
        Open

        var CSS = (function(){
            var css = {};
        
            // Convert an RGB string in the form "rgb (255, 255, 255)" to "#ffffff"
            css.rgb2hex = function(rgbString) {
        Severity: Minor
        Found in app/assets/javascripts/popup.js - About 1 day 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

        File tablesort.js has 616 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*
                TableSort revisited v5.0 by frequency-decoder.com
        
                Released under a creative commons Attribution-ShareAlike 2.5 license (http://creativecommons.org/licenses/by-sa/2.5/)
        
        Severity: Major
        Found in app/assets/javascripts/tablesort.js - About 1 day to fix

          Function DOM has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
          Open

          var DOM = (function() { 
              var dom = {};
              
              // Get a parent tag with a given nodename
              dom.getParentByTagName = function(o,tagNames) {
          Severity: Minor
          Found in app/assets/javascripts/popup.js - About 1 day 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 undo has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
          Open

          function undo() {
              // skip if this is the first word!
              var ti = this.currentTextIndex;
              var wi = this.currentWordIndex
              
          Severity: Minor
          Found in app/assets/javascripts/spellerpages/spellChecker.js - About 1 day 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 undo has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
          Open

          function undo() {
              // skip if this is the first word!
              var ti = this.currentTextIndex;
              var wi = this.currentWordIndex
              
          Severity: Minor
          Found in public/speller/spellChecker.js - About 1 day 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 Screen has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
          Open

          var Screen = (function() {
              var screen = {};
          
              // Get a reference to the body
              // --------------------------------------------------------------------
          Severity: Minor
          Found in app/assets/javascripts/popup.js - About 6 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

          Class Base has 42 methods (exceeds 20 allowed). Consider refactoring.
          Open

            class Base
              attr_reader :messages
              FIELD_DESCRIPTIONS = {}
              def initialize file_name, district
                @district = district
          Severity: Minor
          Found in lib/csv_importer/base.rb - About 5 hrs to fix

            Class District has 39 methods (exceeds 20 allowed). Consider refactoring.
            Open

            class District < ActiveRecord::Base
            
            #  ActiveSupport::Dependencies.load_missing_constant self, :StudentsController
              SETTINGS = [:key, :previous_key, :custom_interventions ]
              BOOLEAN_SETTINGS = [:restrict_free_lunch, :forgot_password, :lock_tier, :email_on_team_consultation_response, :show_team_consultations_if_pending]
            Severity: Minor
            Found in app/models/district.rb - About 5 hrs to fix

              Function init has 126 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      init: function(tableId) {
                              if (!document.getElementsByTagName || !document.createElement || !document.getElementById) return;
              
                              var tables = tableId && document.getElementById(tableId) ? [document.getElementById(tableId)] : document.getElementsByTagName("table");
                              var c, ii, len, colMatch, showOnly, match, showArrow, columnNumSortObj, obj, workArr, headers, thtext, aclone, multi, colCnt, cel, allRowArr, rowArr, sortableTable, celCount, colspan, rowspan, rowLength;
              Severity: Major
              Found in app/assets/javascripts/tablesort.js - About 5 hrs to fix

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

                        o.create = function() {
                                
                                function createTH(details) {
                                        var th = document.createElement('th');
                                        if(details.thClassName) th.className = details.thClassName;
                Severity: Major
                Found in app/assets/javascripts/datepicker.js - About 5 hrs to fix

                  Function CSS has 123 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  var CSS = (function(){
                      var css = {};
                  
                      // Convert an RGB string in the form "rgb (255, 255, 255)" to "#ffffff"
                      css.rgb2hex = function(rgbString) {
                  Severity: Major
                  Found in app/assets/javascripts/popup.js - About 4 hrs to fix

                    Function formatResult has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                    Open

                        formatResult: function(result) {
                            var type = IEConsole.getType(result);
                            try {
                                // DOM Element
                                if (type == 'DOMElement') {
                    Severity: Minor
                    Found in app/assets/javascripts/ie-console.js - About 4 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 Position has 108 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    var Position = (function() {
                        // Resolve a string identifier to an object
                        // ========================================
                        function resolveObject(s) {
                            if (document.getElementById && document.getElementById(s)!=null) {
                    Severity: Major
                    Found in app/assets/javascripts/popup.js - About 4 hrs to fix

                      Function Sort has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                      Open

                      })();var Sort = (function(){
                          var sort = {};
                          sort.AlphaNumeric = function(a,b) {
                              if (a==b) { return 0; }
                              if (a<b) { return -1; }
                      Severity: Minor
                      Found in app/assets/javascripts/popup.js - About 4 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 updateTable has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              o.updateTable = function(noCallback) {
                      
                                      if(o.timerSet) {
                                              var d = new Date(o.date);
                                              d.setDate( Math.min(d.getDate()+o.dayInc, datePicker.getDaysPerMonth(d.getMonth()+o.monthInc,d.getFullYear()+o.yearInc)) );
                      Severity: Major
                      Found in app/assets/javascripts/datepicker.js - About 4 hrs to fix

                        File spellChecker.js has 334 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        ////////////////////////////////////////////////////
                        // spellChecker.js
                        //
                        // spellChecker object
                        //
                        Severity: Minor
                        Found in app/assets/javascripts/spellerpages/spellChecker.js - About 4 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language