atzorvas/ccradio

View on GitHub
app/controllers/streams_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage

Showing 19 of 19 total issues

Method has too many lines. [15/10]
Open

def subscription
hijack do |sock|
redis_thread = Thread.new do
Redis.new.subscribe "songs" do |on|
on.message do |_channel, song|

Align the parameters of a method call if they span more than one line.
Open

except: [:show, :index, :playlist, :current_song, :subscription]

Line is too long. [87/80]
Open

format.html { redirect_to @stream, notice: 'Stream was successfully updated.' }

Align the parameters of a method call if they span more than one line.
Open

only: [:show, :edit, :update, :destroy, :playlist, :current_song]

Line is too long. [83/80]
Open

format.json { render json: { song: item.song, created_at: item.created_at } }

Line is too long. [91/80]
Open

format.html { redirect_to streams_url, notice: 'Stream was successfully destroyed.' }

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

Redis.new.publish "songs", m

Keep a blank line before and after private.
Open

private

Line is too long. [82/80]
Open

format.json { render json: @stream.errors, status: :unprocessable_entity }

Missing top-level class documentation comment.
Open

class StreamsController < ApplicationController

Put empty method definitions on a single line.
Open

def show
end

Line is too long. [87/80]
Open

format.html { redirect_to @stream, notice: 'Stream was successfully created.' }

Put empty method definitions on a single line.
Open

def edit
end

Line is too long. [82/80]
Open

format.json { render json: @stream.errors, status: :unprocessable_entity }

Avoid using {...} for multi-line blocks.
Open

format.json {

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

Redis.new.subscribe "songs" do |on|

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

except: [:show, :index, :playlist, :current_song, :subscription]

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

history: @stream.playlist_items.order("created_at DESC")

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

only: [:show, :edit, :update, :destroy, :playlist, :current_song]
Category
Status