Showing 927 of 927 total issues
Block has too many lines. [188/25] Open
RSpec.describe PiecesController, type: :controller do
let(:white_player) { FactoryGirl.create(:user) }
let(:black_player) { FactoryGirl.create(:user) }
let(:game) { FactoryGirl.create(:game, white_player_id: white_player.id, black_player_id: black_player.id) }
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Block has too many lines. [175/25] Open
describe 'pieces#update action' do
context 'When a piece making a check' do
before(:each) { game.pieces.destroy_all }
let!(:white_bishop) { FactoryGirl.create(:bishop, color: "White", x_pos: 5, y_pos: 3, game_id: game.id) }
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Block has too many lines. [156/25] Open
RSpec.describe Pawn, type: :model do
let(:user) { FactoryGirl.create(:user) }
let(:user2) { FactoryGirl.create(:user) }
let(:game) { FactoryGirl.create(:game, white_player_id: user.id, black_player_id: user2.id) }
before(:each) { game.pieces.destroy_all }
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Class has too many lines. [130/100] Open
class PiecesController < ApplicationController
before_action :require_game_player, only: [:update, :create, :destroy]
def show
render json: current_piece
- Read upRead up
- Exclude checks
This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Block has too many lines. [136/25] Open
RSpec.describe Game, type: :model do
let!(:user) { FactoryGirl.create(:user) }
let(:game) { FactoryGirl.create(:game, white_player_id: user.id)}
describe '.available' do
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Class has too many lines. [106/100] Open
class Pawn < Piece
def icon
'♟'
end
- Read upRead up
- Exclude checks
This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Block has too many lines. [111/25] Open
context 'When both players have joined' do
let!(:white_pawn) { FactoryGirl.create(:pawn, color: "White", x_pos: 4, y_pos: 1, game_id: game.id) }
let!(:black_pawn) { FactoryGirl.create(:pawn, color: "Black", x_pos: 4, y_pos: 6, game_id: game.id) }
before(:each) { game.update_attributes(turn: 0) }
before(:each) { sign_out white_player }
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Block has too many lines. [98/25] Open
RSpec.describe Piece, type: :model do
let(:user) { FactoryGirl.create(:user) }
let(:game) { FactoryGirl.create(:game, black_player_id: user.id)}
before(:each) { game.pieces.destroy_all }
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Block has too many lines. [71/25] Open
describe "#valid_move?" do
subject(:valid_move?) { pawn.valid_move?(to_x, to_y) }
let!(:pawn) { FactoryGirl.create(:pawn, color: "White", x_pos: 3, y_pos: 1, game_id: game.id) }
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Assignment Branch Condition size for move_if_possible is too high. [32.77/15] Open
def move_if_possible
piece = current_piece
if !@game.game_full?
redirect_to game_path(piece.game)
elsif piece.valid_move?(@new_x_pos, @new_y_pos)
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Method has too many lines. [26/10] Open
def move_if_possible
piece = current_piece
if !@game.game_full?
redirect_to game_path(piece.game)
elsif piece.valid_move?(@new_x_pos, @new_y_pos)
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Class PiecesController
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class PiecesController < ApplicationController
before_action :require_game_player, only: [:update, :create, :destroy]
def show
render json: current_piece
Block has too many lines. [59/25] Open
RSpec.describe Piece, type: :model do
let(:user) { FactoryGirl.create(:user) }
let(:game) { FactoryGirl.create(:game, black_player_id: user.id)}
before(:each) { game.pieces.destroy_all }
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Assignment Branch Condition size for update is too high. [27.22/15] Open
def update
piece = current_piece
@new_x_pos = params[:x_pos].to_i
@new_y_pos = params[:y_pos].to_i
@starting_x = current_piece.x_pos
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Block has too many lines. [54/25] Open
describe "#is_obstructed?" do
subject(:is_obstructed?) { piece_to_move.is_obstructed?(destination_x, destination_y) }
let(:piece_to_move) { FactoryGirl.create(:piece, color: "Black", name: name_to_move, x_pos: 3, y_pos: 2, game_id: game.id) }
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Method has too many lines. [16/10] Open
def stalemate?(color)
results_in_check = []
friendly_pieces(color).each do |piece|
start_x = piece.x_pos
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [16/10] Open
def change
create_table :users do |t|
## Database authenticatable
t.string :email, null: false, default: ""
t.string :nickname, null: false, default: ""
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [16/10] Open
def show
@game = current_game
@white_player = User.find(@game.white_player_id)
if @game.black_player_id == nil
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Class Pawn
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Pawn < Piece
def icon
'♟'
end
Block has too many lines. [49/25] Open
ActiveRecord::Schema.define(version: 20170718200142) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.