lib/serverkit/resources/base.rb
Class Base
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Base
class << self
attr_writer :abstract_class
def abstract_class?
Method move_remote_file_keeping_destination_metadata
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def move_remote_file_keeping_destination_metadata(source, destination)
group = run_command_from_identifier(:get_file_owner_group, destination).stdout.rstrip
mode = run_command_from_identifier(:get_file_mode, destination).stdout.rstrip
owner = run_command_from_identifier(:get_file_owner_user, destination).stdout.rstrip
run_command_from_identifier(:change_file_group, source, group) unless group.empty?
- 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 update_remote_file_content
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def update_remote_file_content(content: nil, path: nil)
group = run_command_from_identifier(:get_file_owner_group, path).stdout.rstrip
mode = run_command_from_identifier(:get_file_mode, path).stdout.rstrip
owner = run_command_from_identifier(:get_file_owner_user, path).stdout.rstrip
create_remote_file(content: content, path: path)
- 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"