Showing 16 of 16 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 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 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 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 = Babelish::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 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 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 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 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 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 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 convert
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def convert(write_to_file = true)
strings = {}
keys = nil
comments = {}
- 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 language_filepaths
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def language_filepaths(language)
require 'pathname'
output_name = "strings.xml"
output_name = "#{@output_basename}.xml" unless @output_basename.empty?
region = language.region.to_s.empty? ? "" : "-r#{language.region}"
- 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"