Showing 44 of 66 total issues
Method perform
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def perform(genotype_id)
genotype = Genotype.find(genotype_id)
logger.info "Starting preparse"
biggest = ''
- 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 show
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def show
@user = User.find_by_id(params[:id])
@genotype = @user.genotypes.first
# make arrays of positions and ids in case we have several
- 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 perform
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
def perform(genotype_id)
genotype = Genotype.find(genotype_id)
logger.info "Starting preparse"
biggest = ''
Method show
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
def show
@user = User.find_by_id(params[:id])
@genotype = @user.genotypes.first
# make arrays of positions and ids in case we have several
Method make_annotation
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
def make_annotation(result, snp, name)
# TODO: Refactor this. - Helge
result[name] = {}
result[name]['name'] = snp.name
result[name]['chromosome'] = snp.chromosome
Method perform
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def perform(snp_id)
Snp.reset_counters(snp_id, :user_snps)
s = Snp.find(snp_id)
s.allele_frequency ||= { "A" => 0, "T" => 0, "G" => 0, "C" => 0}
s.genotype_frequency ||= {}
- 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 snpApp
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
var snpApp = function () {
var $searchButton = $('[data-js="search-button"]');
var $searchForm = $('[data-js="search-form"]');
var $panelHeader = $('[data-js="panel-header"]');
var $extendButton = $('[data-js="extend-button"]');
Method perform_search
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def perform_search
# return an array of page-titles
pages = client.list("#{snp.name}(")
snpedia_updated = false
(pages || []).each do |page|
- 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
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def create
@phenotype_comment = PicturePhenotypeComment.new(picture_phenotype_comment_params)
if @phenotype_comment.comment_text.index(/\A(\@\#\d*\:)/) == nil
@phenotype_comment.reply_to_id = -1
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
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def create
@phenotype_comment = PhenotypeComment.new(phenotype_comment_params)
if @phenotype_comment.comment_text.index(/\A(\@\#\d*\:)/) == nil
@phenotype_comment.reply_to_id = -1
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
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def create
@snp_comment = SnpComment.new(comment_params)
if @snp_comment.comment_text.index(/\A(\@\#\d*\:)/) == nil
@snp_comment.reply_to_id = -1
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 process_documents
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def process_documents(documents)
if documents.blank?
logger.info("mendeley: No papers found")
return
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 perform
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def perform()
puts "Running PgpAnnotationJob\n"
known_snps = {}
Snp.find_each do |s| known_snps[s.name] = true end
Method create
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
unless @phenotype = PicturePhenotype.find_by_characteristic(params[:picture_phenotype][:characteristic])
puts params[:picture_phenotype]
@phenotype = PicturePhenotype.create(picture_phenotype_params)
Method update
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def update
@user = User.find(params[:id])
if params[:user][:user_phenotypes_attributes].present?
params[:user][:user_phenotypes_attributes].each do |p|
- 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 show
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def show
# showing a single user's page
@user = User.find_by_id(params[:id]) || not_found
@title = @user.name + '\'s page'
@first_name = @user.name.split.first
Method create
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def create
@user_phenotype = current_user.user_picture_phenotypes.new(
phenotype_picture: params[:user_picture_phenotype][:phenotype_picture])
@user_phenotype.phenotype_picture = params[:user_picture_phenotype][:phenotype_picture]
@user_phenotype.user_id = current_user.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 create
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def create
@user_phenotype = UserPhenotype.new(user_phenotype_params)
@user_phenotype.user_id = current_user.id
if params[:js_modal]
- 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 perform
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def perform()
puts "Running PgpAnnotationJob\n"
known_snps = {}
Snp.find_each do |s| known_snps[s.name] = 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"
Further reading
Method create
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def create
unless @phenotype = PicturePhenotype.find_by_characteristic(params[:picture_phenotype][:characteristic])
puts params[:picture_phenotype]
@phenotype = PicturePhenotype.create(picture_phenotype_params)
- 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"