Showing 25 of 25 total issues
Method resolv_file
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.resolv_file
if Os.ubuntu?
return self.ubuntu_resolv_file if Os.ubuntu?
elsif Os.fedora? || Os.arch? || File.exist?(self.common_resolv_file)
return self.common_resolv_file
- 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
Avoid more than 4 levels of block nesting. Open
if Dory::Upgrade.cleanup.success?
puts "New version installed successfully!\n" \
"You may want to upgrade your config file with:\n\n" \
" dory config-file --upgrade".green
else
- Read upRead up
- Exclude checks
This cop checks for excessive nesting of conditional and looping constructs.
You can configure if blocks are considered using the CountBlocks
option. When set to false
(the default) blocks are not counted
towards the nesting level. Set to true
to count blocks as well.
The maximum level of nesting allowed is configurable.
ReDoS based DoS vulnerability in Active Support’s underscore Open
activesupport (7.0.4)
- Read upRead up
- Exclude checks
Advisory: CVE-2023-22796
URL: https://github.com/rails/rails/releases/tag/v7.0.4.1
Solution: upgrade to >= 5.2.8.15, ~> 5.2.8, >= 6.1.7.1, ~> 6.1.7, >= 7.0.4.1
Avoid more than 4 levels of block nesting. Open
if Dory::Dnsmasq.delete
puts "Dnsmasq container successfully deleted".green
else
puts "Dnsmasq container failed to delete".red
end
- Read upRead up
- Exclude checks
This cop checks for excessive nesting of conditional and looping constructs.
You can configure if blocks are considered using the CountBlocks
option. When set to false
(the default) blocks are not counted
towards the nesting level. Set to true
to count blocks as well.
The maximum level of nesting allowed is configurable.
Avoid more than 4 levels of block nesting. Open
if Dory::Proxy.delete
puts "Nginx proxy container successfully deleted".green
else
puts "Nginx proxy container failed to delete".red
end
- Read upRead up
- Exclude checks
This cop checks for excessive nesting of conditional and looping constructs.
You can configure if blocks are considered using the CountBlocks
option. When set to false
(the default) blocks are not counted
towards the nesting level. Set to true
to count blocks as well.
The maximum level of nesting allowed is configurable.