hovancik/BSDSec

View on GitHub
app/models/article.rb

Summary

Maintainability
A
0 mins
Test Coverage
B
84%

Showing 21 of 21 total issues

Article has no descriptive comment
Open

class Article < ApplicationRecord
Severity: Minor
Found in app/models/article.rb by reek

Article#tag_list= has the variable name 's'
Open

tag_names = tags_string.split(",").collect{|s| s.strip.downcase}.uniq
Severity: Minor
Found in app/models/article.rb by reek

Extra empty line detected at class body beginning.
Open

 
extend FriendlyId
Severity: Minor
Found in app/models/article.rb by rubocop

Extra empty line detected at class body end.
Open

 
end
Severity: Minor
Found in app/models/article.rb by rubocop

Use 2 (not 4) spaces for indentation.
Open

friendly_id :title, use: :slugged
Severity: Minor
Found in app/models/article.rb by rubocop

Use 2 (not 4) spaces for indentation.
Open

has_many :tags, through: :taggings
Severity: Minor
Found in app/models/article.rb by rubocop

Use 2 (not 4) spaces for indentation.
Open

paginates_per 10
Severity: Minor
Found in app/models/article.rb by rubocop

Use 2 (not 4) spaces for indentation.
Open

def tag_list=(tags_string)
Severity: Minor
Found in app/models/article.rb by rubocop

Space between { and | missing.
Open

tag_names = tags_string.split(",").collect{|s| s.strip.downcase}.uniq
Severity: Minor
Found in app/models/article.rb by rubocop

Redundant self detected.
Open

self.tags.collect do |tag|
Severity: Minor
Found in app/models/article.rb by rubocop

Missing top-level documentation comment for class Article.
Open

class Article < ApplicationRecord
Severity: Minor
Found in app/models/article.rb by rubocop

Pass &:name as an argument to collect instead of a block.
Open

self.tags.collect do |tag|
tag.name
end.join(", ")
Severity: Minor
Found in app/models/article.rb by rubocop

Space missing to the left of {.
Open

tag_names = tags_string.split(",").collect{|s| s.strip.downcase}.uniq
Severity: Minor
Found in app/models/article.rb by rubocop

Use 2 (not 4) spaces for indentation.
Open

has_many :taggings, dependent: :destroy
Severity: Minor
Found in app/models/article.rb by rubocop

Space missing inside }.
Open

tag_names = tags_string.split(",").collect{|s| s.strip.downcase}.uniq
Severity: Minor
Found in app/models/article.rb by rubocop

Omit the hash value.
Open

new_or_found_tags = tag_names.collect { |name| Tag.find_or_create_by(name: name) }
Severity: Minor
Found in app/models/article.rb by rubocop

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

tag_names = tags_string.split(",").collect{|s| s.strip.downcase}.uniq
Severity: Minor
Found in app/models/article.rb by rubocop

Use 2 (not 4) spaces for indentation.
Open

extend FriendlyId
Severity: Minor
Found in app/models/article.rb by rubocop

Missing frozen string literal comment.
Open

class Article < ApplicationRecord
Severity: Minor
Found in app/models/article.rb by rubocop

Use 2 (not 4) spaces for indentation.
Open

def tag_list
Severity: Minor
Found in app/models/article.rb by rubocop

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

end.join(", ")
Severity: Minor
Found in app/models/article.rb by rubocop
Category
Status