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
- Read upRead up
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) {
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,
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,
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,
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,
- Read upRead up
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,
- Read upRead up
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
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]
- Read upRead up
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
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
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 = [];
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
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";
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,
- Read upRead up
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),
- Read upRead up
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,
- Read upRead up
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),
- Read upRead up
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
- Read upRead up
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