Showing 37 of 77 total issues
File setup.js
has 315 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function() {
var POLL_INTERVAL = 1000;
var PROGRESS_HALF_LIFE = 1000;
var progress_asymptotically,
create_flash_container,
Class OrganizationsController
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class OrganizationsController < Orgs::Controller
before_action :ensure_team_management_flipper_is_enabled, only: [:show_groupings]
before_action :authorize_organization_addition, only: [:create]
before_action :set_users_github_organizations, only: %i[index new create]
Class GroupAssignmentInvitationsController
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class GroupAssignmentInvitationsController < ApplicationController
class InvalidStatusForRouteError < StandardError; end
include InvitationsControllerMethods
Class GitHubRepository
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class GitHubRepository < GitHubResource
depends_on :import
DEFAULT_LABEL_COLOR = "ffffff"
TEMPLATE_REPOS_API_PREVIEW = "application/vnd.github.baptiste-preview"
Class RostersController
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class RostersController < Orgs::Controller
before_action :ensure_current_roster, except: %i[
new
create
import_from_google_classroom
Function initializeSelectMenu
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initializeSelectMenu() {
var select_menu = $(".select-menu");
var select_menu_modal = $(".select-menu-modal-holder");
var select_menu_list = $(".select-menu-list");
var select_menu_list_items = $(".select-menu-item");
Class GitHubOrganization
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class GitHubOrganization < GitHubResource
def accept_membership(user_github_login)
return if organization_member?(user_github_login)
GitHub::Errors.with_error_handling do
Method initialize
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def initialize(client, id_attributes, **options)
resource = options.delete(:classroom_resource)
attributes = {}.tap do |attr|
attr[:client] = client
- 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 to_csv
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def self.to_csv(user_to_group_map = {})
CSV.generate(headers: true, col_sep: ",", force_quotes: true) do |csv|
columns = %i[identifier github_username github_id name]
columns << :group_name unless user_to_group_map.empty?
csv << columns
- 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 perform
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def perform
org_webhook_count = (@all_organizations ? OrganizationWebhook : OrganizationWebhook.where(github_id: nil)).count
progress_bar = ProgressBar.create(
title: "Iterating over OrganizationWebhooks",
- 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 initialize
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(client, id_attributes, **options)
resource = options.delete(:classroom_resource)
attributes = {}.tap do |attr|
attr[:client] = client
Method perform
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def perform
org_webhook_count = (@all_organizations ? OrganizationWebhook : OrganizationWebhook.where(github_id: nil)).count
progress_bar = ProgressBar.create(
title: "Iterating over OrganizationWebhooks",
Method perform
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def perform
start = Time.zone.now
invite_status.creating_repo!
Broadcaster.call(exercise, :create_repo, :text)
Method message_valid?
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def message_valid?(lti_message)
# check for duplicate nonce
return false if nonce_exists?(lti_message.oauth_nonce)
# check if nonce too old
- 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 report
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def report(exception, context_hash)
failbot_context = {}.tap do |ctx|
job = context_hash[:job]
ctx[:queue] = job["queue"]
- 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 report
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def report(exception, context_hash)
failbot_context = {}.tap do |ctx|
job = context_hash[:job]
ctx[:queue] = job["queue"]
Method create_entries
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.create_entries(identifiers:, roster:, lms_user_ids: [])
created_entries = []
RosterEntry.transaction do
identifiers = add_suffix_to_duplicates(
identifiers: identifiers,
- 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 help
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def help
file_name = params[:article_name] ? params[:article_name] : "help"
return not_found unless HELP_DOCUMENTS.include? file_name
@file = File.read(Rails.root.join("docs", "#{file_name}.md"))
- 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 build_error_message
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def build_error_message(error)
return "An error has occurred" if error.errors.blank?
error.errors.map do |err|
error_message = []
- 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 perform
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def perform
recreate_deadline(@options[:deadline]) if deadline_updated_and_valid?
@assignment.update_attributes(@options.except(:deadline))
raise Result::Error, @assignment.errors.full_messages.join("\n") unless @assignment.valid?
- 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"