Showing 18 of 18 total issues
Method convert
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
def convert(name = @csv_filename)
rowIndex = 0
excludedCols = []
defaultCol = 0
- 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 csv2base
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def csv2base(classname)
args = options.dup
if options[:fetch]
say "Fetching csv file #{options[:filename]} from Google Drive"
files = download(options[:filename], nil, options[:sheet])
- 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 create_csv_file
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def create_csv_file(keys, strings, comments = nil)
raise "csv_filename must not be nil" unless @csv_filename
CSV.open(@csv_filename, "wb") do |csv|
@headers << "Comments" if !comments.nil? && !comments.empty?
csv << @headers
- 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 convert
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def convert(name = @csv_filename)
rowIndex = 0
excludedCols = []
defaultCol = 0
Method download
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def download(filename, output_filename = nil, worksheet_index = nil)
gd = BabelishRnc::GoogleDoc.new
if output_filename || worksheet_index
file_path = gd.download_spreadsheet filename.to_s, output_filename, worksheet_index
files = [file_path].compact
- 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 csv2base
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def csv2base(classname)
args = options.dup
if options[:fetch]
say "Fetching csv file #{options[:filename]} from Google Drive"
files = download(options[:filename], nil, options[:sheet])
Method initialize
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(filename, langs, args = {})
default_args = {
:excluded_states => [],
:state_column => nil,
:keys_column => 0,
Method load_strings
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def load_strings(strings_filename)
strings = {}
File.open(strings_filename, 'r') do |strings_file|
strings_file.read.each_line do |line|
parsed_line = parse_dotstrings_line(line)
- 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 initialize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def initialize(args = {:filenames => []})
raise ArgumentError.new("No filenames given") unless args[:filenames]
if args[:headers]
raise ArgumentError.new("number of headers and files don't match, don't forget the constant column") unless args[:headers].size == (args[:filenames].size + 1)
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 load_strings
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def load_strings(strings_filename)
strings = {}
comments = {}
# genstrings uses utf16, so that's what we expect. utf8 should not be impact
file = File.open(strings_filename, "r:utf-16:utf-8")
- 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 get_row_format
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_row_format(row_key, row_value, comment = nil, indentation = 0, defaultlang = "")
Method get_row_format
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_row_format(row_key, row_value, comment = nil, indentation = 0, defaultlang = "")
Method get_row_format
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_row_format(row_key, row_value, comment = nil, indentation = 0, defaultlang = "")
Method process
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def process(table, keys, comments = {})
keys.each do |key|
clean_key = key.gsub(' ', '')
clean_key.gsub!(/[[:punct:]]/, '_')
clean_key.gsub!('__', '_')
- 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 keys
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def keys
@languages.each do |lang|
next unless lang
return lang.content.keys unless lang.content.keys.empty?
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 csv_download
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def csv_download
all = options[:sheet] ? false : options[:all]
filename = options['gd_filename']
raise ArgumentError.new("csv_download command : missing file to download") unless filename
if all
- 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 write_content
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def write_content
info = "List of created files:\n"
count = 0
@languages.each do |language|
next if language.nil?
- 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 hash_to_output
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def hash_to_output(content = {})
output = ''
indentation = content.map(&:first).max { |a, b| a.length <=> b.length }.length
if content && content.size > 0
content.each do |key, value|
- 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"