Method process_targets
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
def process_targets(parser, filename, targets_config_dir)
parser.parse_file(filename) do |keyword, parameters|
case keyword
when 'AUTO_DECLARE_TARGETS'
usage = "#{keyword}"
- 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 auto_detect_gem_based_targets
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def auto_detect_gem_based_targets
Bundler.load.specs.each do |spec|
spec_name_split = spec.name.split('-')
if spec_name_split.length > 1 && (spec_name_split[0] == 'cosmos')
# search for multiple targets packaged in a single gem
- 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_configuration
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def save_configuration
configuration = find_configuration(@config.name)
configuration = File.join(@paths['SAVED_CONFIG'], File.build_timestamped_filename([@config.name], '.zip')) unless configuration
unless File.exist?(configuration)
configuration_tmp = File.join(@paths['SAVED_CONFIG'], File.build_timestamped_filename(['tmp_' + @config.name], '.zip.tmp'))
- 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 process_file
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def process_file(filename, targets_config_dir)
parser = ConfigParser.new("https://ballaerospace.github.io/cosmos-website/docs/v5")
# First pass - Everything except targets
parser.parse_file(filename) do |keyword, parameters|
- 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 unzip
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def unzip(zip_file_name)
zip_dir = File.join(@paths['TMP'], File.basename(zip_file_name, ".*"))
# Only unzip if we have to. We assume the unzipped directory structure is
# intact. If not they'll get a popop with the errors encountered when
# loading the configuration.
- 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"