ece517-p3/expertiza

View on GitHub
app/models/waitlist.rb

Summary

Maintainability
A
0 mins
Test Coverage

Mass assignment is not restricted using attr_accessible
Open

class Waitlist < ActiveRecord::Base
Severity: Critical
Found in app/models/waitlist.rb by brakeman

This warning comes up if a model does not limit what attributes can be set through mass assignment.

In particular, this check looks for attr_accessible inside model definitions. If it is not found, this warning will be issued.

Brakeman also warns on use of attr_protected - especially since it was found to be vulnerable to bypass. Warnings for mass assignment on models using attr_protected will be reported, but at a lower confidence level.

Note that disabling mass assignment globally will suppress these warnings.

Prefer each over for.
Open

      for waitlisted_topic in waitlisted_topics
Severity: Minor
Found in app/models/waitlist.rb by rubocop

This cop looks for uses of the for keyword, or each method. The preferred alternative is set in the EnforcedStyle configuration parameter. An each call with a block on a single line is always allowed, however.

Use a guard clause instead of wrapping the code inside a conditional expression.
Open

    unless waitlisted_topics.nil?
Severity: Minor
Found in app/models/waitlist.rb by rubocop

Use a guard clause instead of wrapping the code inside a conditional expression

Example:

# bad
def test
  if something
    work
  end
end

# good
def test
  return unless something
  work
end

# also good
def test
  work if something
end

# bad
if something
  raise 'exception'
else
  ok
end

# good
raise 'exception' if something
ok

There are no issues that match your filters.

Category
Status