Showing 270 of 302 total issues
File rubbycop.rb
has 490 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'parser'
require 'rainbow'
require 'English'
require 'set'
Class Node
has 54 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Node < Parser::AST::Node # rubbycop:disable Metrics/ClassLength
include RubbyCop::AST::Sexp
COMPARISON_OPERATORS = %i[! == === != <= >= > < <=>].freeze
File conditional_assignment.rb
has 450 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module RubbyCop
module Cop
module Style
# Helper module to provide common methods to classes needed for the
# ConditionalAssignment Cop.
Class Compiler
has 38 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Compiler
RSYM = %r{:(?:[\w+@*/?!<>=~|%^-]+|\[\]=?)}
ID_CHAR = /[a-zA-Z_-]/
META = /\(|\)|\{|\}|\[|\]|\$\.\.\.|\$|!|\^|\.\.\./
NUMBER = /-?\d+(?:\.\d+)?/
Class Config
has 38 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Config
include PathUtil
COMMON_PARAMS = %w[Exclude Include Severity
AutoCorrect StyleGuide Details].freeze
Class SpaceAroundKeyword
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class SpaceAroundKeyword < Cop
MSG_BEFORE = 'Space before keyword `%s` is missing.'.freeze
MSG_AFTER = 'Space after keyword `%s` is missing.'.freeze
DO = 'do'.freeze
File config.rb
has 354 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'pathname'
# rubbycop:disable Metrics/ClassLength
module RubbyCop
File node.rb
has 353 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module RubbyCop
module AST
# `RubbyCop::AST::Node` is a subclass of `Parser::AST::Node`. It provides
# access to parent nodes and an object-oriented way to traverse an AST with
# the power of `Enumerable`.
File node_pattern.rb
has 343 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module RubbyCop
# This class performs a pattern-matching operation on an AST node.
#
# Initialize a new `NodePattern` with `NodePattern.new(pattern_string)`, then
# pass an AST node to `NodePattern#match`. Alternatively, use one of the class
Class Runner
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Runner # rubbycop:disable Metrics/ClassLength
# An exception indicating that the inspection loop got stuck correcting
# offenses back and forth.
class InfiniteCorrectionLoop < RuntimeError
attr_reader :offenses
Class Cop
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Cop
extend RubbyCop::AST::Sexp
extend NodePattern::Macros
include RubbyCop::AST::Sexp
include Util
Class VariableForce
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class VariableForce < Force # rubbycop:disable Metrics/ClassLength
VARIABLE_ASSIGNMENT_TYPE = :lvasgn
REGEXP_NAMED_CAPTURE_TYPE = :match_with_lvasgn
VARIABLE_ASSIGNMENT_TYPES =
[VARIABLE_ASSIGNMENT_TYPE, REGEXP_NAMED_CAPTURE_TYPE].freeze
Class BlockDelimiters
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class BlockDelimiters < Cop
include ConfigurableEnforcedStyle
def on_send(node)
return unless node.arguments?
Class ConditionalAssignment
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class ConditionalAssignment < Cop
include ConditionalAssignmentHelper
include ConfigurableEnforcedStyle
include IgnoredNode
Class IndentationWidth
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class IndentationWidth < Cop # rubbycop:disable Metrics/ClassLength
include EndKeywordAlignment
include AutocorrectAlignment
include OnMethodDef
include CheckAssignment
Class ExtraSpacing
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class ExtraSpacing < Cop
include PrecedingFollowingAlignment
MSG_UNNECESSARY = 'Unnecessary spacing detected.'.freeze
MSG_UNALIGNED_ASGN = '`=` is not aligned with the %s assignment.'.freeze
File options.rb
has 282 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'optparse'
require 'shellwords'
module RubbyCop
# This class handles command line options.
Class TrivialAccessors
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class TrivialAccessors < Cop
MSG = 'Use `attr_%s` to define trivial %s methods.'.freeze
def on_def(node)
return if in_module_or_instance_eval?(node)
Class Next
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Next < Cop
include ConfigurableEnforcedStyle
include MinBodyLength
MSG = 'Use `next` to skip iteration.'.freeze
Class SendNode
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class SendNode < Node
# The receiving node of the method invocation.
#
# @return [Node, nil] the receiver of the invoked method or `nil`
def receiver