lujanfernaud/prevy

View on GitHub
app/models/announcement_topic.rb

Summary

Maintainability
A
0 mins
Test Coverage

AnnouncementTopic#date doesn't depend on instance state (maybe move it to another class?)
Open

    def date
Severity: Minor
Found in app/models/announcement_topic.rb by reek

A Utility Function is any instance method that has no dependency on the state of the instance.

Inconsistent indentation detected.
Open

    def notify_group_members
      return if group.sample_group?

      NewAnnouncementNotifier.call(self)
    end
Severity: Minor
Found in app/models/announcement_topic.rb by rubocop

This cops checks for inconsistent indentation.

Example:

class A
  def test
    puts 'hello'
     puts 'world'
  end
end

Inconsistent indentation detected.
Open

    def slug_candidates
      [
        :title,
        [:title, :date],
        [:title, :date, :group_id]
Severity: Minor
Found in app/models/announcement_topic.rb by rubocop

This cops checks for inconsistent indentation.

Example:

class A
  def test
    puts 'hello'
     puts 'world'
  end
end

Use %i or %I for an array of symbols.
Open

        [:title, :date],
Severity: Minor
Found in app/models/announcement_topic.rb by rubocop

This cop can check for array literals made up of symbols that are not using the %i() syntax.

Alternatively, it checks for symbol arrays using the %i() syntax on projects which do not want to use that syntax.

Configuration option: MinSize If set, arrays with fewer elements than this value will not trigger the cop. For example, a MinSize of3` will not enforce a style on an array of 2 or fewer elements.

Example: EnforcedStyle: percent (default)

# good
%i[foo bar baz]

# bad
[:foo, :bar, :baz]

Example: EnforcedStyle: brackets

# good
[:foo, :bar, :baz]

# bad
%i[foo bar baz]

Inconsistent indentation detected.
Open

    def date
      Time.zone.now.strftime("%b %d %Y")
    end
Severity: Minor
Found in app/models/announcement_topic.rb by rubocop

This cops checks for inconsistent indentation.

Example:

class A
  def test
    puts 'hello'
     puts 'world'
  end
end

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

      Time.zone.now.strftime("%b %d %Y")
Severity: Minor
Found in app/models/announcement_topic.rb by rubocop

Checks if uses of quotes match the configured preference.

Example: EnforcedStyle: single_quotes (default)

# bad
"No special symbols"
"No string interpolation"
"Just text"

# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"

Example: EnforcedStyle: double_quotes

# bad
'Just some text'
'No special chars or interpolation'

# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"

Use %i or %I for an array of symbols.
Open

        [:title, :date, :group_id]
Severity: Minor
Found in app/models/announcement_topic.rb by rubocop

This cop can check for array literals made up of symbols that are not using the %i() syntax.

Alternatively, it checks for symbol arrays using the %i() syntax on projects which do not want to use that syntax.

Configuration option: MinSize If set, arrays with fewer elements than this value will not trigger the cop. For example, a MinSize of3` will not enforce a style on an array of 2 or fewer elements.

Example: EnforcedStyle: percent (default)

# good
%i[foo bar baz]

# bad
[:foo, :bar, :baz]

Example: EnforcedStyle: brackets

# good
[:foo, :bar, :baz]

# bad
%i[foo bar baz]

Missing top-level class documentation comment.
Open

class AnnouncementTopic < Topic
Severity: Minor
Found in app/models/announcement_topic.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

There are no issues that match your filters.

Category
Status