Method configured_audience
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Wontfix
def configured_audience
auds = api_key_role.access_policy.statements.flat_map do |s|
next unless s.effect == "allow"
s.conditions.flat_map do |c|
- 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 view_template
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def view_template
self.title = t(".title")
return if not_configured
- 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 not_configured
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Wontfix
def not_configured
is_github = api_key_role.provider.github_actions?
is_push = api_key_role.api_key_permissions.scopes.include?("push_rubygem")
return if is_github && is_push
div(class: "t-body") do
- 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"