hpi-swt2/workshop-portal

View on GitHub
app/services/mailer.rb

Summary

Maintainability
A
35 mins
Test Coverage

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

  def self.send_generic_email(hide_recipients, recipients, reply_to, subject, content)
Severity: Minor
Found in app/services/mailer.rb - About 35 mins to fix

    Line is too long. [86/80]
    Open

      def self.send_generic_email(hide_recipients, recipients, reply_to, subject, content)
    Severity: Minor
    Found in app/services/mailer.rb by rubocop

    Line is too long. [137/80]
    Open

      # @param hide_recipients - a boolean. `true` will send an email to the recipients one by one, `false` will send an email to all at once
    Severity: Minor
    Found in app/services/mailer.rb by rubocop

    Line is too long. [125/80]
    Open

      # @param recipients [Array<String>] - email addresses of recipients - can be a string of comma separated email adresses too
    Severity: Minor
    Found in app/services/mailer.rb by rubocop

    Line is too long. [84/80]
    Open

      # @return [ActionMailer::MessageDelivery] a mail object with the given parameters.
    Severity: Minor
    Found in app/services/mailer.rb by rubocop

    Missing top-level class documentation comment.
    Open

    class Mailer
    Severity: Minor
    Found in app/services/mailer.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

    Line is too long. [85/80]
    Open

            PortalMailer.generic_email(recipient, reply_to, subject, content).deliver_now
    Severity: Minor
    Found in app/services/mailer.rb by rubocop

    Extra empty line detected at class body beginning.
    Open

    
      # @param hide_recipients - a boolean. `true` will send an email to the recipients one by one, `false` will send an email to all at once
    Severity: Minor
    Found in app/services/mailer.rb by rubocop

    This cops checks if empty lines around the bodies of classes match the configuration.

    Example: EnforcedStyle: empty_lines

    # good
    
    class Foo
    
      def bar
        # ...
      end
    
    end

    Example: EnforcedStyle: emptylinesexcept_namespace

    # good
    
    class Foo
      class Bar
    
        # ...
    
      end
    end

    Example: EnforcedStyle: emptylinesspecial

    # good
    class Foo
    
      def bar; end
    
    end

    Example: EnforcedStyle: noemptylines (default)

    # good
    
    class Foo
      def bar
        # ...
      end
    end

    Line is too long. [136/80]
    Open

      # @param reply_to [Array<String>] - email addresses of recipient of the answer - can be a string of comma separated email adresses too
    Severity: Minor
    Found in app/services/mailer.rb by rubocop

    Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||.
    Open

          if recipients.is_a? String
    Severity: Minor
    Found in app/services/mailer.rb by rubocop

    Checks for if and unless statements that would fit on one line if written as a modifier if/unless. The maximum line length is configured in the Metrics/LineLength cop.

    Example:

    # bad
    if condition
      do_stuff(bar)
    end
    
    unless qux.empty?
      Foo.do_something
    end
    
    # good
    do_stuff(bar) if condition
    Foo.do_something unless qux.empty?

    Line is too long. [84/80]
    Open

          PortalMailer.generic_email(recipients, reply_to, subject, content).deliver_now
    Severity: Minor
    Found in app/services/mailer.rb by rubocop

    There are no issues that match your filters.

    Category
    Status