expertiza/expertiza

View on GitHub
app/helpers/mailer_helper.rb

Summary

Maintainability
A
35 mins
Test Coverage
D
66%

Method has too many lines. [14/10]
Open

  def self.send_mail_to_assigned_reviewers(reviewer, participant, mapping)
    Mailer.sync_message(
      {
        to: reviewer.email,
        subject: "Assignment '#{participant.assignment.name}': A submission has been updated since you last reviewed it",
Severity: Minor
Found in app/helpers/mailer_helper.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [11/10]
Open

  def self.send_mail_for_conference_user(user, subject, partial_name, password, conference_variable)
    Mailer.generic_message(
      to: user.email,
      subject: subject,
      body: {
Severity: Minor
Found in app/helpers/mailer_helper.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method send_mail_for_conference_user has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def self.send_mail_for_conference_user(user, subject, partial_name, password, conference_variable)
Severity: Minor
Found in app/helpers/mailer_helper.rb - About 35 mins to fix

    Missing top-level module documentation comment.
    Open

    module MailerHelper
    Severity: Minor
    Found in app/helpers/mailer_helper.rb by rubocop

    This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.

    The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.

    Example:

    # bad
    class Person
      # ...
    end
    
    # good
    # Description/Explanation of Person class
    class Person
      # ...
    end

    Redundant curly braces around a hash parameter.
    Open

          {
            to: reviewer.email,
            subject: "Assignment '#{participant.assignment.name}': A submission has been updated since you last reviewed it",
            cc: participant.assignment.instructor.email,
            body: {
    Severity: Minor
    Found in app/helpers/mailer_helper.rb by rubocop

    This cop checks for braces around the last parameter in a method call if the last parameter is a hash. It supports braces, no_braces and context_dependent styles.

    Example: EnforcedStyle: braces

    # The `braces` style enforces braces around all method
    # parameters that are hashes.
    
    # bad
    some_method(x, y, a: 1, b: 2)
    
    # good
    some_method(x, y, {a: 1, b: 2})

    Example: EnforcedStyle: no_braces (default)

    # The `no_braces` style checks that the last parameter doesn't
    # have braces around it.
    
    # bad
    some_method(x, y, {a: 1, b: 2})
    
    # good
    some_method(x, y, a: 1, b: 2)

    Example: EnforcedStyle: context_dependent

    # The `context_dependent` style checks that the last parameter
    # doesn't have braces around it, but requires braces if the
    # second to last parameter is also a hash literal.
    
    # bad
    some_method(x, y, {a: 1, b: 2})
    some_method(x, y, {a: 1, b: 2}, a: 1, b: 2)
    
    # good
    some_method(x, y, a: 1, b: 2)
    some_method(x, y, {a: 1, b: 2}, {a: 1, b: 2})

    There are no issues that match your filters.

    Category
    Status