lib/cheripic/cmd.rb
Method argument_parser
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def argument_parser
cmds = self
Trollop::Parser.new do
version Cheripic::VERSION
banner cmds.help_message
Method check_input_files
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
Open
def check_input_files(inputfiles)
inputfiles.each_key do | type |
inputfiles[type].flatten!
check = 0
inputfiles[type].each do | symbol |
- 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
File cmd.rb
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module Cheripic
# A command line option and processing object to handle input options
#
# @!attribute [rw] options
Method check_input_files
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def check_input_files(inputfiles)
inputfiles.each_key do | type |
inputfiles[type].flatten!
check = 0
inputfiles[type].each do | symbol |
Method convert_boolean_strings
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def convert_boolean_strings
%i{ambiguous_ref_bases use_all_contigs include_low_hmes polyploidy}.each do | symbol |
if @options.key?(symbol)
@options[symbol] = @options[symbol] == 'false' ? false : 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"