Showing 1,025 of 1,025 total issues
Method index
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def index
if (params[:discipline_id])
@discipline=Discipline.find(params[:discipline_id])
#FIXME: strips out the disciplines that don't match
@people=Person.where(["disciplines.id=?",@discipline.id]).includes(:disciplines)
Method builder
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def builder
saved_file=params[:saved_file]
error=nil
supported=false
begin
Method handle_download_zip
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def handle_download_zip asset
#get the list of filename and filepath, {:filename => filepath}
files_to_download = {}
#store content_type for the case of 1 file
content_type = nil
Method create_from_existing
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_from_existing
experimental_condition_ids = []
new_experimental_conditions = []
#retrieve the selected FSes
params.each do |key, value|
Method add_breadcrumbs
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_breadcrumbs
#Home
add_breadcrumb "Home", :root_path
#process for nested attributes
if controller_name == 'studied_factors'
Similar blocks of code found in 2 locations. Consider refactoring. Open
def create
@group = WorkGroup.new(params[:group])
respond_to do |format|
if @group.save
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 53.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if @specimen.save
if @specimen.from_biosamples=='true'
#reload to get updated nested attributes,e.g. genotypes/phenotypes
@specimen.reload
render :partial => "biosamples/back_to_biosamples", :locals => {:action => 'create', :object => @specimen}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 53.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
def create
@institution = Institution.new(params[:institution])
respond_to do |format|
if @institution.save
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 53.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if @specimen.save
if @specimen.from_biosamples=='true'
#reload to get updated nested attributes,e.g. genotypes/phenotypes
@specimen.reload
render :partial => "biosamples/back_to_biosamples", :locals => {:action => 'update', :object => @specimen}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 53.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function select_cells
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function select_cells(startCol, startRow, endCol, endRow, sheetNumber) {
var minRow = startRow;
var minCol = startCol;
var maxRow = endRow;
var maxCol = endCol;
Method authorized_list
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def authorized_list all_items, attribute, sort=true, max_length=75, count_hidden_items=false
items = all_items.select &:can_view?
if Seek::Config.is_virtualliver
title_only_items = (all_items - items).select &:title_is_public?
else
Method create
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
if handle_upload_data
@model = Model.new(params[:model])
@model.policy.set_attributes_with_sharing params[:sharing], @model.projects
Method existing_specimens
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def existing_specimens
specimens_of_strains = []
strains = []
specimens_with_default_strain =[]
if params[:strain_ids]
Method preview_permissions
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def preview_permissions
policy = sharing_params_to_policy
current_person = User.current_user.try(:person)
contributor_person = (params['is_new_file'] == 'false') ? User.find_by_id(params['contributor_id'].to_i).try(:person) : current_person
creators = (params["creators"].blank? ? [] : ActiveSupport::JSON.decode(params["creators"])).uniq
Method resource_in_tab
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def resource_in_tab
resource_type = params[:resource_type]
view_type = params[:view_type]
scale_title = params[:scale_title] || ''
Method included
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.included klass
klass.class_eval do
searchable do
text :title do
if self.respond_to?(:title)
Method populate
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def populate
begin
@translucent_id = @node.find_first("id").content unless @node.find_first("id").nil?
@author_seek_id = @node.find_first("submitter").content unless @node.find_first("submitter").nil?
if @type=="Model"
Similar blocks of code found in 2 locations. Consider refactoring. Open
slider.maxThreshold = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 58.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
slider.minThreshold = (slider.settings.minSlides * slider.settings.slideWidth) + ((slider.settings.minSlides - 1) * slider.settings.slideMargin);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 58.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if cls.nil?
flash.now[:error] = "Unrecognised assay type"
elsif !params[:label].blank? && params[:label].downcase != cls.label.downcase
flash.now[:notice] = "Undefined assay type with label <b> #{params[:label]} </b>. Did you mean #{view_context.link_to(cls.label, assay_types_path(:uri=>uri, :label=> cls.label),{:style=> "font-style:italic;font-weight:bold;"})}?".html_safe
else
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 52.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76