Showing 45 of 81 total issues
Method to_xml
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def to_xml
launch_string = "" unless @launch
launch_string = " launch='#{CleanParamString.clean(@launch)}'" if @launch
audio_string = "" unless @sound
audio_string = "<audio src='#{CleanParamString.clean(@sound)}'/>" if @sound
- 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 sound=
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sound=(sound)
if sound.is_a?(Hash)
write_attribute(:sound, multi_json_dump(sound))
self.sound_is_json = true if has_attribute?(:sound_is_json)
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"
Further reading
Method read_loop
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def read_loop(socket)
loop do
line = socket.gets
break unless line
- 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 prepare_async_post
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def prepare_async_post(notification)
response = {}
request = build_request(notification)
http_request = @client.prepare_request(:post, request[: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"
Further reading
Method shutdown
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.shutdown
return unless Rpush.config.embedded
Rpush::Daemon.shutdown
@embed_thread.join if @embed_thread
rescue StandardError => 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"