lujanfernaud/prevy

View on GitHub
app/models/topic_comment.rb

Summary

Maintainability
A
0 mins
Test Coverage

Inconsistent indentation detected.
Open

    def set_edited_at
      return unless body_changed?

      self.edited_at = Time.current
    end
Severity: Minor
Found in app/models/topic_comment.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

  belongs_to :edited_by, class_name: "User", optional: true
Severity: Minor
Found in app/models/topic_comment.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"

Inconsistent indentation detected.
Open

    def body_length
      BodyLengthValidator.call(self, length: MINIMUM_BODY_LENGTH)
    end
Severity: Minor
Found in app/models/topic_comment.rb by rubocop

This cops checks for inconsistent indentation.

Example:

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

Missing top-level class documentation comment.
Open

class TopicComment < ApplicationRecord
Severity: Minor
Found in app/models/topic_comment.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

Inconsistent indentation detected.
Open

    def user_group_points
      UserGroupPoints.find_or_create_by!(user: user, group: topic.group)
    end
Severity: Minor
Found in app/models/topic_comment.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 set_default_edited_by
      self.edited_by = user
    end
Severity: Minor
Found in app/models/topic_comment.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 update_topic_last_commented_at_date
      topic.update_attributes(last_commented_at: created_at)
    end
Severity: Minor
Found in app/models/topic_comment.rb by rubocop

This cops checks for inconsistent indentation.

Example:

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

There are no issues that match your filters.

Category
Status