atzorvas/ccradio

View on GitHub
app/models/stream.rb

Summary

Maintainability
A
0 mins
Test Coverage

Showing 19 of 19 total issues

Use tr instead of gsub.
Open

song.gsub('_', ' ').gsub('-', ' - ')
Severity: Minor
Found in app/models/stream.rb by rubocop

Do not prefix reader method names with get_.
Open

def get_url_status
Severity: Minor
Found in app/models/stream.rb by rubocop

Redundant self detected.
Open

URI.join(self.server, "status.xsl?mount=#{self.mount}").to_s
Severity: Minor
Found in app/models/stream.rb by rubocop

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

message: "should exist once per server" }
Severity: Minor
Found in app/models/stream.rb by rubocop

Redundant self detected.
Open

self.get_url_play
Severity: Minor
Found in app/models/stream.rb by rubocop

Redundant self detected.
Open

self.playlist_items.create(song: @song)
Severity: Minor
Found in app/models/stream.rb by rubocop

Missing top-level class documentation comment.
Open

class Stream < ActiveRecord::Base
Severity: Minor
Found in app/models/stream.rb by rubocop

Redundant self detected.
Open

URI.join(self.server, self.mount).to_s
Severity: Minor
Found in app/models/stream.rb by rubocop

Do not prefix reader method names with get_.
Open

def get_url_play
Severity: Minor
Found in app/models/stream.rb by rubocop

Use def with parentheses when there are parameters.
Open

def get_current_song doc
Severity: Minor
Found in app/models/stream.rb by rubocop

Redundant self detected.
Open

self.get_url_status
Severity: Minor
Found in app/models/stream.rb by rubocop

Do not place comments on the same line as the def keyword.
Open

def url_status # returns full url
Severity: Minor
Found in app/models/stream.rb by rubocop

Use def with parentheses when there are parameters.
Open

def fix_song_title song
Severity: Minor
Found in app/models/stream.rb by rubocop

Use def with parentheses when there are parameters.
Open

def open_url url
Severity: Minor
Found in app/models/stream.rb by rubocop

Redundant self detected.
Open

page = open_url(self.get_url_status)
Severity: Minor
Found in app/models/stream.rb by rubocop

Extra empty line detected at class body end.
Open

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

Line is too long. [82/80]
Open

doc.xpath('//td[contains(text(),"Current Song")]//following-sibling::td').text
Severity: Minor
Found in app/models/stream.rb by rubocop

Redundant self detected.
Open

URI.join(self.server, self.mount).to_s
Severity: Minor
Found in app/models/stream.rb by rubocop

Redundant self detected.
Open

URI.join(self.server, "status.xsl?mount=#{self.mount}").to_s
Severity: Minor
Found in app/models/stream.rb by rubocop
Category
Status