Showing 649 of 649 total issues
File rubocop.rb
has 741 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'English'
before_us = $LOADED_FEATURES.dup
require 'rainbow'
require 'forwardable'
Class Base
has 62 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Base # rubocop:disable Metrics/ClassLength
extend RuboCop::AST::Sexp
extend NodePattern::Macros
extend ExcludeLimit
include RuboCop::AST::Sexp
File options.rb
has 519 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'optparse'
require_relative 'arguments_env'
require_relative 'arguments_file'
module RuboCop
File conditional_assignment.rb
has 412 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module RuboCop
module Cop
module Style
# Helper module to provide common methods to classes needed for the
# ConditionalAssignment Cop.
Class SpaceAroundKeyword
has 43 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class SpaceAroundKeyword < Base
extend AutoCorrector
MSG_BEFORE = 'Space before keyword `%<range>s` is missing.'
MSG_AFTER = 'Space after keyword `%<range>s` is missing.'
Class Runner
has 42 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Runner # rubocop:disable Metrics/ClassLength
# An exception indicating that the inspection loop got stuck correcting
# offenses back and forth.
class InfiniteCorrectionLoop < StandardError
attr_reader :offenses
Class Registry
has 40 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Registry
include Enumerable
def self.all
global.without_department(:Test).cops
Class Config
has 37 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Config
include PathUtil
include FileFinder
extend Forwardable
Class BlockDelimiters
has 37 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class BlockDelimiters < Base
include ConfigurableEnforcedStyle
include AllowedMethods
include AllowedPattern
include RangeHelp
File runner.rb
has 356 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require 'parallel'
module RuboCop
# This class handles the processing of files, which includes dealing with
# formatters and letting cops inspect the files.
Class MethodCallWithArgsParentheses
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class MethodCallWithArgsParentheses
# Style omit_parentheses
# rubocop:disable Metrics/ModuleLength, Metrics/CyclomaticComplexity
module OmitParentheses
TRAILING_WHITESPACE_REGEX = /\s+\Z/.freeze
Class RedundantCopDisableDirective
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class RedundantCopDisableDirective < Base # rubocop:todo Metrics/ClassLength
include RangeHelp
extend AutoCorrector
COP_NAME = 'Lint/RedundantCopDisableDirective'
Class IndentationWidth
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class IndentationWidth < Base # rubocop:disable Metrics/ClassLength
include EndKeywordAlignment
include Alignment
include CheckAssignment
include AllowedPattern
Method find_offense_message
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
Open
def find_offense_message(begin_node, node)
return 'a keyword' if keyword_with_redundant_parentheses?(node)
return 'a literal' if disallowed_literal?(begin_node, node)
return 'a variable' if node.variable?
return 'a constant' if node.const_type?
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Class RedundantParentheses
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class RedundantParentheses < Base
include Parentheses
extend AutoCorrector
ALLOWED_NODE_TYPES = %i[and or send splat kwsplat].freeze
Class CopsDocumentationGenerator
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class CopsDocumentationGenerator # rubocop:disable Metrics/ClassLength
include ::RuboCop::Cop::Documentation
# This class will only generate documentation for cops that belong to one of
# the departments given in the `departments` array. E.g. if we only wanted
# documentation for Lint cops:
Class VariableForce
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class VariableForce < Force # rubocop: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 DisabledConfigFormatter
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class DisabledConfigFormatter < BaseFormatter
include PathUtil
HEADING = <<~COMMENTS
# This configuration was generated by
Class HeredocArgumentClosingParenthesis
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class HeredocArgumentClosingParenthesis < Base
include RangeHelp
extend AutoCorrector
MSG = 'Put the closing parenthesis for a method call with a ' \
Class IfUnlessModifier
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class IfUnlessModifier < Base
include StatementModifier
include LineLengthHelp
include AllowedPattern
include RangeHelp