Showing 122 of 226 total issues
Method rank_change_icon
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def rank_change_icon(delta)
if delta >= 10
view.image_tag(
"courses/leaderboard/rank-change-up-double.svg",
alt:
Function wrap
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
(i.prototype.wrap = function (r, e, o) {
try {
var n;
if (
((n =
Method execute
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def execute
submission =
TimelineEvent.transaction do
timeline_event_params =
(
Method auth_callback
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def auth_callback
begin
crypt = EncryptorService.new
data =
- 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 delete_content
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def delete_content
quiz_questions =
QuizQuestion.joins(quiz: { assignment: :course }).where(
courses: {
id: @course.id
Function loadFull
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
(i.prototype.loadFull = function (r, e, o, n, t) {
var l = !1,
i = e.createElement("script"),
s = e.getElementsByTagName("script")[0],
d = s.parentNode;
Method student_rows
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def student_rows
rows =
students.map do |student|
user = student.user
Method perform
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def perform(event_type, course, actor, resource)
webhook_endpoint = course.webhook_endpoint
unless event_type.in?(webhook_endpoint.events)
raise "#{event_type} was not one of the requested events in WebhookEndpoint##{webhook_endpoint.id}"
Function Home
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Home() {
const context = useDocusaurusContext();
const { siteConfig = {} } = context;
return (
<Layout description="Description will go into a meta tag in <head />">
Method add_updates_for_coach
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_updates_for_coach(user)
coach = user.faculty
return [] if coach.blank?
Function startRecording
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function startRecording() {
if (
navigator.mediaDevices &&
navigator.mediaDevices.getUserMedia &&
!state.recording
Method targets
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def targets
attributes = %w[id title target_group_id sort_index]
scope =
@course
Method update_email
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_email
user =
Users::ValidateUpdateEmailTokenService.new(
params[:token],
current_school
Function setupShim
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
setupShim: function (r, e) {
if (r) {
var o = e.globalAlias || "Rollbar";
if ("object" == typeof r[o]) return r[o];
(r._rollbarShims = {}), (r._rollbarWrappedError = null);
Consider simplifying this complex logical expression. Open
if (
!r._rollbar_wrapped &&
((r._rollbar_wrapped = function () {
o && "function" == typeof o && o.apply(this, arguments);
try {
Consider simplifying this complex logical expression. Open
if (r) {
"function" == typeof r._rollbarURH &&
r._rollbarURH.belongsToShim &&
r.removeEventListener("unhandledrejection", r._rollbarURH);
var n = function (r) {
Method generate_url
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate_url
signer =
Aws::CloudFront::UrlSigner.new(
key_pair_id: Rails.application.secrets.cloudfront[:key_pair_id],
private_key:
Method execute
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def execute
unless (
target.visibility != Target::VISIBILITY_ARCHIVED &&
@assignment.milestone
)
- 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_branch
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def create_branch(re_run)
# Create a branch with the name submission-<student_id>
branch_name_suffix = re_run ? "-#{Time.now.to_i}" : ""
branch_name = "submission-#{@submission.id}#{branch_name_suffix}"
repo_name = @submission.students.first.github_repository
- 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 execute
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def execute(re_run: false)
unless github_configuration.configured? &&
@submission.target.action_config.present?
return
end