Showing 5 of 5 total issues
Class GitRepository
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class GitRepository
def initialize(env, options={})
@env = env
@status_factory = options.fetch(:status_factory, Status)
end
Class Environment
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Environment
DEFAULT_GIT_COMMAND = '/usr/bin/env git'.freeze
DEFAULT_CONFIG_DIRECTORY = '/usr/local/etc/gitsh'.freeze
attr_reader :input_stream, :output_stream, :error_stream, :config_directory
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def initialize(line_editor, prior_words, input, automaton, escaper)
Method delete_text
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def self.delete_text(*args)
return if line_buffer.nil?
if args.length.zero?
beg = 0
- 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
Method read_command
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def read_command
command = line_editor.readline(prompt, true)
if command && command.match(BLANK_LINE_REGEX)
env.fetch('gitsh.defaultCommand') { 'status' }
else
- 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"