concord-consortium/rigse

View on GitHub

Showing 1,200 of 2,138 total issues

Method perform has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
Open

  def perform
    import = Import::Import.find(import_id)
    content_hash = JSON.parse(import.upload_data, :symbolize_names => true)
    total_users_count = content_hash[:users].size
    batch_size = 250
Severity: Minor
Found in rails/app/models/import/import_users.rb - 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 Enumerable has 206 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var Enumerable = (function() {
  function each(iterator, context) {
    try {
      this._each(iterator, context);
    } catch (e) {
Severity: Major
Found in rails/app/assets/javascripts/prototype.js - About 1 day to fix

    Function parseCss has 204 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        parseCss: function( css ) {
            var el = this.targetElement,
                cs = el.currentStyle,
                tokenizer, token, image,
                tok_type = PIE.Tokenizer.Type,
    Severity: Major
    Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 1 day to fix

      Function setOptions has 204 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          setOptions: function(opts){
              var options = {
                  colors: ['#00A8F0', '#C0D800', '#CB4B4B', '#4DA74D', '#9440ED'], //=> The default colorscheme. When there are > 5 series, additional colors are generated.
                  title: null,
                  subtitle: null,
      Severity: Major
      Found in rails/app/assets/javascripts/flotr/flotr_out.js - About 1 day to fix

        Function setOptions has 204 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            setOptions: function(opts){
                var options = {
                    colors: ['#00A8F0', '#C0D800', '#CB4B4B', '#4DA74D', '#9440ED'], //=> The default colorscheme. When there are > 5 series, additional colors are generated.
                    title: null,
                    subtitle: null,
        Severity: Major
        Found in rails/app/assets/javascripts/flotr/flotr.js - About 1 day to fix

          Function extendXRangeIfNeededByBar has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
          Open

              extendXRangeIfNeededByBar: function(axis){
                  if(axis.options.max == null){
                      var newmin = axis.min,
                          newmax = axis.max,
                          i, s, b, c,
          Severity: Minor
          Found in rails/app/assets/javascripts/flotr/flotr_out.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 extendXRangeIfNeededByBar has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
          Open

              extendXRangeIfNeededByBar: function(axis){
                  if(axis.options.max == null){
                      var newmin = axis.min,
                          newmax = axis.max,
                          i, s, b, c,
          Severity: Minor
          Found in rails/app/assets/javascripts/flotr/flotr.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

          Method query_es has 200 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def self.query_es(options, user)
              if user.has_role?('manager','admin','researcher')
                all_access = true
              else
                all_access = false
          Severity: Major
          Found in rails/app/controllers/api/v1/report_learners_es_controller.rb - About 1 day to fix

            Method user_authorized_for? has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
            Open

                def user_authorized_for?(user, params = {}, binding = self.binding)
                  return true unless Array===self.role_requirements
                  self.role_requirements.each{| role_requirement|
                    roles = role_requirement[:roles]
                    options = role_requirement[:options]
            Severity: Minor
            Found in rails/lib/role_requirement_system.rb - About 7 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

            File application_helper.rb has 485 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            module ApplicationHelper
              include Clipboard
              include Pundit
            
              def current_settings
            Severity: Minor
            Found in rails/app/helpers/application_helper.rb - About 7 hrs to fix

              File dhtml_history.js has 474 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*
              Copyright (c) 2007 Brian Dillard and Brad Neuberg:
              Brian Dillard | Project Lead | bdillard@pathf.com | http://blogs.pathf.com/agileajax/
              Brad Neuberg | Original Project Creator | http://codinginparadise.org
              
              
              Severity: Minor
              Found in rails/app/assets/javascripts/active_scaffold/default/dhtml_history.js - About 7 hrs to fix

                Function Tokenizer has 182 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                PIE.Tokenizer = (function() {
                    function Tokenizer( css ) {
                        this.css = css;
                        this.ch = 0;
                        this.tokens = [];
                Severity: Major
                Found in rails/app/assets/javascripts/pie/PIE_uncompressed.js - About 7 hrs to fix

                  File user.rb has 463 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  require 'digest/sha1'
                  
                  class User < ApplicationRecord
                    has_many :authentications, :dependent => :delete_all
                    has_many :access_grants, :dependent => :delete_all
                  Severity: Minor
                  Found in rails/app/models/user.rb - About 7 hrs to fix

                    Function NgssHelper has 175 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const NgssHelper = function () {
                      const PE = "Performance Expectations";
                      const DCI = "Disciplinary Core Ideas";
                      const PRACTICES = "Science and Engineering Practices";
                      const CONCEPTS = "Crosscutting Concepts";
                    Severity: Major
                    Found in rails/react-components/src/library/helpers/standards-helpers.tsx - About 7 hrs to fix

                      Function plotBars has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
                      Open

                          plotBars: function(series, barWidth, offset, fill){
                              var data = series.data;
                              if(data.length < 1) return;
                              
                              var xa = series.xaxis,
                      Severity: Minor
                      Found in rails/app/assets/javascripts/flotr/flotr_out.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

                      Function plotLine has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
                      Open

                          plotLine: function(series, offset){
                              var ctx = this.ctx,
                                  xa = series.xaxis,
                                  ya = series.yaxis,
                                    tHoz = this.tHoz.bind(this),
                      Severity: Minor
                      Found in rails/app/assets/javascripts/flotr/flotr_out.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

                      Function plotBars has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
                      Open

                          plotBars: function(series, barWidth, offset, fill){
                              var data = series.data;
                              if(data.length < 1) return;
                              
                              var xa = series.xaxis,
                      Severity: Minor
                      Found in rails/app/assets/javascripts/flotr/flotr.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

                      Function plotLine has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
                      Open

                          plotLine: function(series, offset){
                              var ctx = this.ctx,
                                  xa = series.xaxis,
                                  ya = series.yaxis,
                                    tHoz = this.tHoz.bind(this),
                      Severity: Minor
                      Found in rails/app/assets/javascripts/flotr/flotr.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

                      Method create has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def create
                          # PUNDIT_REVIEW_AUTHORIZE
                          # PUNDIT_CHECK_AUTHORIZE
                          # authorize Portal::Student
                          @portal_clazz = find_clazz_from_params
                      Severity: Minor
                      Found in rails/app/controllers/portal/students_controller.rb - 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

                      File materials_controller.rb has 454 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      class API::V1::MaterialsController < API::APIController
                        include Materials::DataHelpers
                      
                        #
                        # Default number of related materials to return
                      Severity: Minor
                      Found in rails/app/controllers/api/v1/materials_controller.rb - About 6 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language