Class SystemService
has 46 methods (exceeds 20 allowed). Consider refactoring. Open
class SystemService
extend Forwardable
# Error when a service is not found
class NotFoundError < RuntimeError; end
Method save_start_mode
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def save_start_mode
return unless changed?(:start_mode)
result =
case changes[:start_mode]
- 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 perform_reload
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def perform_reload
return perform_restart unless support_reload?
result = true
- 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 start_modes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def start_modes
@start_modes = [:on_boot, :manual, :on_demand] unless found?
return @start_modes if @start_modes
@start_modes = [:manual]
- 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 perform_action
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def perform_action
return true unless action
result = send("perform_#{action}")
register_error(:active) if result == false
- 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"