TheCorrespondingSquares/chess-app

View on GitHub

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) }

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) }

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 }
Severity: Minor
Found in spec/models/pawn_spec.rb by rubocop

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

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
Severity: Minor
Found in spec/models/game_spec.rb by rubocop

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
    '&#9823;'
  end
Severity: Minor
Found in app/models/pawn.rb by rubocop

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 }

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 }

Severity: Minor
Found in spec/models/piece_spec.rb by rubocop

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) }

Severity: Minor
Found in spec/models/pawn_spec.rb by rubocop

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)

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)

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
Severity: Minor
Found in app/controllers/pieces_controller.rb - About 3 hrs to fix

    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 }
    

    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

    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) }
    

    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
    Severity: Minor
    Found in app/models/game.rb by rubocop

    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: ""

    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
    Severity: Minor
    Found in app/controllers/games_controller.rb by rubocop

    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
        '&#9823;'
      end
    Severity: Minor
    Found in app/models/pawn.rb - About 2 hrs to fix

      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"
      
      
      Severity: Minor
      Found in db/schema.rb by rubocop

      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.

      Severity
      Category
      Status
      Source
      Language