Showing 91 of 144 total issues
Method init_classification_path
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def init_classification_path(items)
# ignore non-template links
items["taxonavigation"]&.each do |line|
line.gsub!(/\[\[.*\]\]/, "") # ignore non-template links
next unless template_link = line.match(@re[:template_link])
- 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_vern_name
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_vern_name(n)
sci_name_id = nil
apps = nil
concepts = n["concepts"]
if !concepts.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 collect_names
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def collect_names
@names_index = {}
file = CSV.open(File.join(@download_dir, "data.csv"),
headers: true)
file.each_with_index do |row, i|
- 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 organize_data
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def organize_data
DwcaHunter::logger_write(self.object_id,
"Organizing data")
File.readlines(@download_path).each_with_index do |l, idx|
l_obj = JSON.parse(l)
- 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 download
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def download
f = File.open(@download_path, 'w:utf-8')
headers = { accept: :json}
i = 0
while
- 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_names
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_names
# 0 tsn serial not null
# 1 unit_ind1 char(1)
# 2 unit_name1 char(35) not null
# 3 unit_ind2 char(1)
- 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_template
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def process_template(x)
name = page_title(x).gsub!(@re[:template], "").strip
text = x.xpath("//text").text.strip
parent_name = text.match(@re[:template_link])
if parent_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 classification
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def classification(str)
kingdom = phylum = klass = order = family = genus = ""
return [kingdom, phylum, klass, order, family, genus] if str.nil?
el = str.split("|").map(&:strip)
- 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 collect_names
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def collect_names
@names_index = {}
file = CSV.open(File.join(@download_dir, "data.csv"),
headers: true)
file.each_with_index do |row, _i|
- 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 real_name?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def real_name?(str)
parsed = @parser.parse(str)
return false unless parsed[:parsed]
epithets = parsed[:canonicalName][:simple].split(" ")[1..-1]
return false if epithets.nil? || epithets.empty?
- 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 run_query
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def run_query(q)
count = 0
requests_num = 0
loop do
freebase_url = "http://api.freebase.com/api/service/mqlread?query=%s" %
- 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"