Showing 419 of 572 total issues
Function composeSMask
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
function composeSMask(layer, mask, properties) {
var width = layer.width, height = layer.height;
if (!smaskCache) {
initSmaskGL();
Function SVGExtraStateClosure
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
var SVGExtraState = (function SVGExtraStateClosure() {
function SVGExtraState() {
this.fontSizeScale = 1;
this.fontWeight = SVG_DEFAULTS.fontWeight;
this.fontSize = 0;
Method shibboleth
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def shibboleth
if user_signed_in?
if (data = request.env["omniauth.auth"]) && current_user.authentications.where(provider: "CMU-Shibboleth",
uid: data["uid"]).empty?
current_user.authentications.create(provider: "CMU-Shibboleth",
Method authorize_user_for_course
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def authorize_user_for_course
redirect_to(root_path) && return if current_user.nil?
uid = current_user.id
# don't allow sudoing across courses
Method tango_upload
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def tango_upload(course, assessment, submission, existing_files)
# first, figure out which files need to get sent
ass_dir = assessment.folder_path
begin
COURSE_LOGGER.log("Dir: #{ass_dir}")
- 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 validated_score_value
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def self.validated_score_value(score, invoked_method_name, allow_nil = false)
message = "Error executing #{invoked_method_name}"
if score
if (score = Float(score) rescue nil)
- 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 request_access_token
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def request_access_token
# get private key from JSON file to sign Autolab's client assertion as a JWK
unless File.size?("#{Rails.configuration.config_location}/lti_tool_jwk.json")
flash[:error] = "Autolab's JWK JSON file was not found"
redirect_to([:users, @course]) && return
- 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 log_submit
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def log_submit
@user = User.find_by(email: params[:user])
@cud = @user ? @course.course_user_data.find_by(user_id: @user.id) : nil
unless @cud
err = "ERROR: invalid username (#{params[:user]}) for class #{@course.id}"
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
def create
require_params([:groups])
if @assessment.group_size <= 1
raise ApiError.new("Group size of assessment is currently 1,"\
- 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 Promise_all
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Promise.all = function Promise_all(promises) {
var resolveAll, rejectAll;
var deferred = new Promise(function (resolve, reject) {
resolveAll = resolve;
rejectAll = reject;
Function navigate
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function navigate(dir) {
if (!options.enableCellNavigation) {
return false;
}
Method deserialize
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def deserialize(s)
unless s["general"]
raise "General section missing in yaml"
end
Function messageHandlerComObjOnMessage
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
comObj.onmessage = function messageHandlerComObjOnMessage(event) {
var data = event.data;
if (data.isReply) {
var callbackId = data.callbackId;
if (data.callbackId in callbacksCapabilities) {
Function makeActiveCellEditable
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function makeActiveCellEditable(editor) {
if (!activeCellNode) {
return;
}
if (!options.editable) {
Method tango_upload
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def tango_upload(course, assessment, submission, existing_files)
# first, figure out which files need to get sent
ass_dir = assessment.folder_path
begin
COURSE_LOGGER.log("Dir: #{ass_dir}")
Function setContainerDimensions
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
setContainerDimensions: function () {
var s = this,
badIE = browser.ie6 || browser.ie7;
// get the dimensions for the container and data
Method sendJob_AddHTMLMessages
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def sendJob_AddHTMLMessages(course, assessment, submissions)
# Check for nil first, since students should know about this
flash[:error] = "Submission could not be autograded due to an error in creation" && return if submissions.blank?
begin
Function SVGGraphics_setGState
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
setGState: function SVGGraphics_setGState(states) {
for (var i = 0, ii = states.length; i < ii; i++) {
var state = states[i];
var key = state[0];
var value = state[1];
Function init
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function( event ){
// sorry, only one touch at a time
if ( drag.touched )
return;
// the drag/drop interaction data
Method populate_directory
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def populate_directory(current_directory, current_url)
directory = Dir.entries(current_directory)
new_url = current_url == '/' ? '' : current_url
@directory = directory.map do |file|
abs_path_str = "#{current_directory}/#{file}"