Showing 307 of 5,713 total issues
Method up
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.up
model = ApiDocs::Service
add_column :api_docs_services, :base_path, :string
docs = model.connection.select_all "SELECT id, body FROM api_docs_services"
- 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 deserialize_argument
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def deserialize_argument(argument)
case argument
when String
argument
when *PERMITTED_TYPES
- 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 assign_to_mail
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def assign_to_mail(mail)
mail[:subject] = @subject if @subject
mail[:bcc] = @bcc if @bcc
mail[:cc] = @cc if @cc
mail[:from] = @from if @from
- 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 debug_message
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def debug_message(target, result)
return if chain_config[:terminator].blank?
conditions = []
conditions.push "if: #{Array.wrap(@if).join(' && ')}" if @if.present?
- 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 assign_to_message
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def assign_to_message(message)
message.subject = @subject if @subject
message.headers['bcc'] = @bcc if @bcc
message.headers['cc'] = @cc if @cc
- 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 help
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def help(assigns)
assigns = Hash[
assigns.map do |name, value|
klass = value.class
klass_name = if klass.respond_to?(:name)
- 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 debug_callback
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def debug_callback(callback)
->(target, *args, &block) do
begin
result = callback.call(target, *args, &block)
rescue => 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"