Method rabbitmq_settings
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
def self.rabbitmq_settings(node, barclamp)
instance = node[barclamp][:rabbitmq_instance] || "default"
# Cache the result for each cookbook in an instance variable hash. This
# cache needs to be invalidated for each chef-client run from chef-client
- Read upRead up
- Create a ticketCreate a ticket
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 rabbitmq_settings
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.rabbitmq_settings(node, barclamp)
instance = node[barclamp][:rabbitmq_instance] || "default"
# Cache the result for each cookbook in an instance variable hash. This
# cache needs to be invalidated for each chef-client run from chef-client
- Create a ticketCreate a ticket
Method database_settings
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def self.database_settings(node, barclamp)
instance = node[barclamp][:database_instance] || "default"
# Cache the result for each cookbook in an instance variable hash. This
# cache needs to be invalidated for each chef-client run from chef-client
- Read upRead up
- Create a ticketCreate a ticket
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 database_settings
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.database_settings(node, barclamp)
instance = node[barclamp][:database_instance] || "default"
# Cache the result for each cookbook in an instance variable hash. This
# cache needs to be invalidated for each chef-client run from chef-client
- Create a ticketCreate a ticket
Method database_connection_string
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.database_connection_string(db_settings, db_auth_attr)
db_auth = db_auth_attr.to_hash
db_conn_scheme = db_settings[:url_scheme]
db_charset = ""
ssl_suffix = ""
- Read upRead up
- Create a ticketCreate a ticket
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 get_node
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.get_node(node, role, barclamp, instance)
result = nil
if node.roles.include?(role) && \
node.key?(barclamp) && \
- Read upRead up
- Create a ticketCreate a ticket
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"