Showing 419 of 572 total issues
Method tango_add_job
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def tango_add_job(course, assessment, upload_file_list, callback_url, job_name, output_file)
Method validate_jwt_signature
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def validate_jwt_signature(id_token)
# use JWK URL over file
if !@lti_config_hash["platform_public_jwks_url"].nil? &&
@lti_config_hash["platform_public_jwks_url"].present?
# fetch JWKS from provided keys URL
- 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 set_search_action
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function set_search_action(instances, tab_name, archived_instances, empty_message, search_content, selected_user_ids) {
Function set_tab_html
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function set_tab_html(is_search, instances, tab_name, archived_instances, empty_message, selected_user_ids) {
Avoid deeply nested control flow statements. Open
if(shift_nums[character] && e.shiftKey) { //Stupid Shift key bug created by using lowercase
character = shift_nums[character];
if(character == k) kp++;
}
Function search_enter_action
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function search_enter_action(query, tab_name, instances, archived_instances, empty_message, selected_user_ids) {
Function showFiles
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function showFiles() {
var fileSelector = $("#handin_show_assessment input[type='file']").get(0);
var file = fileSelector.files[0];
$("#handin-file-name").text(file.name);
- 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 oidc_login
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def oidc_login
unless File.size?("#{Rails.configuration.config_location}/lti_config.yml")
raise LtiError.new("LTI configuration not found on Autolab Server", :internal_server_error)
end
- 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
Avoid deeply nested control flow statements. Open
if ldapResult
@user.first_name = ldapResult[:first_name]
@user.last_name = ldapResult[:last_name]
@user.school = ldapResult[:school]
@user.major = ldapResult[:major]
Method authenticate_for_action
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def authenticate_for_action
controller_whitelist = @@global_whitelist[params[:controller].to_sym]
return if controller_whitelist.nil?
level = controller_whitelist[params[:action].to_sym]
- 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 set_course
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def set_course
course_name = params[:course_name] ||
(params[:controller] == "courses" ? params[:name] : nil)
@course = Course.find_by(name: course_name) if course_name
- 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 get_nth_file
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.get_nth_file(archive_path, n)
archive_type = get_archive_type(archive_path)
archive_extract = get_archive(archive_path, archive_type)
# Parse archive header
- 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 update
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def update
if params[:group]
aud = @assessment.aud_for @cud.id
if @group.is_member(aud) || @cud.instructor
flash[:notice] = "Group was successfully updated." if @group.update(group_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
Method statistics
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def statistics
matrix = GradeMatrix.new @course, @cud
cols = {}
# extract assessment final scores
- 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 course_announcement
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def course_announcement(sender, to, subject, text, cud, course)
Function defaultFormatter
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function defaultFormatter(row, cell, value, columnDef, dataContext) {
Function drawFigures
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function drawFigures(width, height, backgroundColor, figures, context) {
Function getMaxTextTemplate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function getMaxTextTemplate(texts, columnDef, colIndex, data, rowEl) {
Function appendCellHtml
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function appendCellHtml(stringArray, row, cell, colspan, item) {
Function showTopButtons
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function showTopButtons(selectAllCheckbox, resolveButton, contactButton, deleteButton, exportButton) {