vegantech/sims

View on GitHub

Showing 223 of 433 total issues

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

    Function map has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    function map(func) {
        var i,j,o;
        var results = [];
        if (typeof(func)=="string") {
            func = new Function('$_',func);
    Severity: Minor
    Found in app/assets/javascripts/popup.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 show has a Cognitive Complexity of 12 (exceeds 5 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

    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 import has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def import
         return if append_failure?
         if clean_file
            if confirm_count?
              create_temporary_table
    Severity: Minor
    Found in lib/csv_importer/base.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

    Method setup_ending_reminders has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

      def self.setup_ending_reminders(district = nil)
        errors = []
        users_with_interventions = Hash.new([])
        interventions_ending_this_week.each do |intervention|
          if district.blank? || intervention.participants_with_author.collect(&:user).compact.collect(&:district_id).include?(district.id)
    Severity: Minor
    Found in app/mailers/notifications.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

    Method recommendation_buttons has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

      def recommendation_buttons(form)
      b=Recommendation::RECOMMENDATION.sort
      b[1],b[2] = b[2],b[1]   #No progress at current level should be the second element
       a=b.collect do |k,v|
         opts={}
    Severity: Minor
    Found in app/helpers/checklists_helper.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

    Method parse_range_option has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def parse_range_option(option, direction)
          if option.is_a? Symbol
            case option
            when :today
              range_class = 'today'
    Severity: Minor
    Found in lib/unobtrusive_date_picker/unobtrusive_date_picker.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

    Method make_date_picker_class_options has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def make_date_picker_class_options(options)
          html_classes = []
    
          if options[:highlight_days]
            highlight_days = parse_days_of_week(options[:highlight_days])
    Severity: Minor
    Found in lib/unobtrusive_date_picker/unobtrusive_date_picker.rb - About 1 hr to fix

      Function terminateSpell has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function terminateSpell() {
          // called when we have reached the end of the spell checking.
          var msg = "Spell check complete:\n\n";
          var numrepl = this._getTotalReplaced();
          if( numrepl == 0 ) {
      Severity: Minor
      Found in app/assets/javascripts/spellerpages/spellChecker.js - About 1 hr to fix

        Function terminateSpell has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function terminateSpell() {
            // called when we have reached the end of the spell checking.
            var msg = "Spell check complete:\n\n";
            var numrepl = this._getTotalReplaced();
            if( numrepl == 0 ) {
        Severity: Minor
        Found in public/speller/spellChecker.js - About 1 hr to fix

          Method verify_externally has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def verify_externally(student,district)
          
          #   curl "https://uaapps.dpi.wi.gov/SIMS_Student_Location_Confirm/SIMS/nonsecure"
           #  -d wsn=9000000099 -d district=3456 -H "Accept: text/xml"
          
          
          Severity: Minor
          Found in lib/verify_student_in_district_externally.rb - About 1 hr to fix

            Method setup_from_checklist_or_definition has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

              def setup_from_checklist_or_definition
                if checklist
                  self.recommendation_definition ||= checklist.checklist_definition.recommendation_definition if checklist
                  self.district_id ||= checklist.district_id
                  self.student_id ||= checklist.student_id
            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

            Method update has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

              def update
                params[:user] ||= {}
                @user = current_district.users.find(params[:id])
            
                respond_to do |format|
            Severity: Minor
            Found in app/controllers/district/users_controller.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

            Method referral_report has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

              def referral_report
                csv_string = ''
                CSV.generate(csv_string,:row_sep=>"\r\n") do |csv|
                  csv << ["personID","referral_request","main_concerns","interventions_tried","family_involvement","external_factors","date","schoolyear"]
                  dates_of_sims_data.each do |student|
            Severity: Minor
            Found in lib/referral_report.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

            Method generate_report has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

              def generate_report report_class, base_filename, report_options
                fmt = params[:report_params][:format]
                if report_class.class == Class
                  @report = report_class.send("render_#{fmt}".to_sym, report_options)
                else
            Severity: Minor
            Found in app/controllers/reports_controller.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

            Method chart_page has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def chart_page(page=0)
                  #      probe_scores
                  #       scores, grouped by date?
            
                      low=page.to_i*group_size
            Severity: Minor
            Found in app/models/grouped_progress_entry/aggregate_chart.rb - About 1 hr to fix

              Method process_row has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def process_row line
                  student= check_student(line[:district_student_id]) or return false
                  int_def=check_intervention_definition(line[:intervention_definition_id]) or return false
              
                  intervention=int_def.interventions.build(:student => student, :user => @user, :start_date => line[:start_date],
              Severity: Minor
              Found in lib/automated_intervention.rb - About 1 hr to fix

                Method group_by_cluster_and_objective has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def self.group_by_cluster_and_objective(params ={})
                    #This will work better
                
                    #refactor this to use recommended monitors?
                    probes = find(:all, :order =>"active desc, custom, position", :include => [{:intervention_definitions=>{:intervention_cluster=>:objective_definition}},:intervention_probe_assignments, :recommended_monitors])
                Severity: Minor
                Found in app/models/probe_definition.rb - About 1 hr to fix

                  Function redraw has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          redraw: function(tableid, identical) {
                                  if(!tableid || !(tableid in fdTableSort.tableCache)) { return; };
                                  var dataObj     = fdTableSort.tableCache[tableid];
                                  var data        = dataObj.data;
                                  var len1        = data.length;
                  Severity: Minor
                  Found in app/assets/javascripts/tablesort.js - About 1 hr to fix

                    Method create_with_schools_and_users has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def self.create_with_schools_and_users(abbrev,name)
                        td=District.create!(:abbrev=>abbrev, :name =>name, :forgot_password => true)
                        ActiveRecord::Base.transaction do
                        td.send :create_admin_user
                        #alpha elementary
                    Severity: Minor
                    Found in lib/create_training_district.rb - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language