Showing 5 of 5 total issues
Class User
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class User < Wright::Provider
# Creates or updates the user.
#
# @return [void]
def create
Method safe_constantize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.safe_constantize(camel_cased_word)
return nil if camel_cased_word.nil?
constantize(camel_cased_word)
rescue NameError => e
- 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 to_id
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.to_id(object, type)
raise ArgumentError unless [:group, :user].include?(type)
return nil if object.nil?
return object.to_i unless object.is_a?(String)
type == :user ? Etc.getpwnam(object).uid : Etc.getgrnam(object).gid
- 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 mode=
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def mode=(mode)
if mode.nil?
@mode = nil
return
end
- 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 run_script
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def run_script(arguments)
if commands.empty? && arguments.any?
script = File.expand_path(arguments.shift)
load script
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"