File mkconfig.rb
has 519 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'pathname'
require 'yaml'
require 'fileutils'
module Roma
Method store_result
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def store_result(results, base, hash, input)
target = base[hash]
return results if !target["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 mkconfig
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def mkconfig(mode)
skip = skip_menu!(mode)
while true
clear_screen
- 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 save_data
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def save_data(res)
if res.key?("storage")
case res["storage"].value
when "Ruby Hash"
req = "rh_storage"
Method save_data
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def save_data(res)
if res.key?("storage")
case res["storage"].value
when "Ruby Hash"
req = "rh_storage"
- 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 correct_in?
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def correct_in?(hash,input)
if END_MSG.include?(input)
return true
end
- 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 skip_menu!
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def skip_menu!(menu)
# in case of "-m" or "--with_menu" option was used
if menu == :with_menu
return Proc.new do
if @next_hash == "server" && @results["fd_server"]
- 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 ch_assign
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def ch_assign(text, exp, sep = " = ", str)
sep = " = " if sep == "="
text = text.gsub(/(\s*#{exp}).*/) do |s|
name = $1
if str.class == String
- 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 too many return
statements within this method. Open
return false
Avoid too many return
statements within this method. Open
return true