Showing 122 of 193 total issues
Avoid too many return
statements within this method. Open
return records_with_highest_max_phase.first
Avoid too many return
statements within this method. Open
return nil
Avoid too many return
statements within this method. Open
return get_normalized_record_or_drug_for_chembl_id(get_min_chembl_id(chembl_ids_for_records(records_with_trade_name)))
Avoid too many return
statements within this method. Open
return nil
Avoid too many return
statements within this method. Open
return get_normalized_record_or_drug_for_chembl_id(get_min_chembl_id(chembl_ids_for_records(records_with_highest_max_phase)))
Avoid too many return
statements within this method. Open
return records_with_trade_name.first
Avoid too many return
statements within this method. Open
return get_normalized_record_or_drug_for_chembl_id(get_min_chembl_id(chembl_ids_for_records(records_with_highest_max_phase)))
Avoid too many return
statements within this method. Open
return nil
Method attribute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.attribute(name, type = String, opts = {})
unless type == String || type == Array
raise 'Sorry, only string and array types are supported'
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 make_get_request
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.make_get_request(url)
retries = 0
begin
uri = URI(url)
res = Net::HTTP.get_response(uri)
- 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 import!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def import!
File.open(@tsv_path).each_with_index do |line, index|
next if (line.blank? || index == 0)
process_row(EntrezGenePathwayRow.new(line))
if index % 10_000 == 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 chembl_ids_for_records
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def chembl_ids_for_records(records)
chembl_ids = records.each_with_object([]) do |r, ids|
if r['concept_identifier'].start_with?('chembl:') && valid_chembl_id?(r['concept_identifier'])
ids << r['concept_identifier']
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
Function create_request
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_request(self):
self.request = "https://dgidb.org/api/v1/interactions.json?genes=FLT1&drug_types=antineoplastic&interaction_sources=TALC"
self.payload = {}
if(self.genes):
self.payload['genes'] = self.genes
- 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
Function write_log
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def write_log(self):
self.load_versions()
if self.append:
today = datetime.date.today().strftime("%d-%B-%Y")
if self.version is not None:
- 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_gene_claims
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_gene_claims
CSV.foreach(file_path, :headers => true, :col_sep => "\t") do |row|
gene_claim = create_gene_claim(row["Gene"], 'Gene Symbol')
create_gene_claim_alias(gene_claim, row["Ensembl"], 'Ensembl Gene ID')
unless row['Gene synonym'].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 create_entity
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_entity(property_type, val, opts)
if !opts[:unless].call(val)
if property_type == :alias
@importer.send("create_#{@type}_alias", "#{@type}_id".to_sym => @id, alias: val, nomenclature: opts[:nomenclature])
elsif property_type == :attribute
- 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 group_gene_claim
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def group_gene_claim(gene_claim)
if (gene = DataModel::Gene.where('upper(name) = ? or upper(long_name) = ?', gene_claim.name.upcase, gene_claim.name.upcase)).one?
add_gene_claim_to_gene(gene_claim, gene.first)
return gene_claim
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 create_gene_claims
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_gene_claims
CSV.foreach(file_path, :headers => true, :col_sep => "\t") do |row|
if row['tax_id'] == '9606'
gene_claim = create_gene_claim(row['Symbol'], 'Gene Symbol')
create_gene_claim_alias(gene_claim, row['GeneID'], 'Gene ID')
- 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 links
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def links
{}.tap do |links|
links['next'] = if items.last_page?
nil
else
- 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_gene_claim_for_entry
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_gene_claim_for_entry(gene, category)
gene_claim = create_gene_claim(gene['bioentity_label'], 'Gene Symbol')
unless gene['synonym'].nil?
gene['synonym'].each do |synonym|
if synonym.include? 'UniProtKB:'
- 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"