Showing 1,025 of 1,025 total issues
Function imageSwapZoomOut
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function imageSwapZoomOut(curImage, newImage) {
$(curImage).css({'opacity':'1'});
$(newImage).css({'opacity':'0'});
$(newImage).css({'height':'250%', 'marginLeft':'-120px', 'marginTop':'-222px'});
$(curImage).css({'display':'inline'});
Method to_presentation
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_presentation
presentation_attrs = attributes.delete_if { |k, v| !(::Presentation.new.attributes.include?(k))}
Presentation.new(presentation_attrs).tap do |presentation|
DataFile.reflect_on_all_associations.select { |a| [:has_many, :has_and_belongs_to_many, :has_one].include?(a.macro) && !a.through_reflection }.each do |a|
Function tipShow
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
tipShow : function() {
var scrX = Number(this.xCord);
var scrY = Number(this.yCord);
var tp = parseInt(scrY+15);
var lt = parseInt(scrX+10);
Function imageSwapZoomIn
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function imageSwapZoomIn(curImage, newImage) {
$(curImage).css({'opacity':'1'});
$(newImage).css({'opacity':'0'});
$(newImage).css({'height':'25%', 'marginLeft':'200px', 'marginTop':'105px'});
$(curImage).css({'display':'inline'});
Method create_or_update_attributions
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.create_or_update_attributions(resource, attributions_from_params, predicate = Relationship::ATTRIBUTED_TO)
# added this branching on .nil? because of the danger of loosing all attributions for a model (for example) if due to an incomplete post request attributions is nil
# the former code interpreted a nil parameter as an empty list => remove all attributions from an asset
unless attributions_from_params.nil?
Method set_runlet_parameters
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_runlet_parameters
shared_input_values_for_all_runs = params[:sweep].delete(:shared_input_values_for_all_runs)
params[:sweep][:runs_attributes].each_with_index do |(run_id, run_attributes), iteration_index|
run_attributes[:workflow_id] = params[:sweep][:workflow_id]
Method new_object_based_on_existing_one
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def new_object_based_on_existing_one
@existing_sample = Sample.find(params[:id])
@sample = @existing_sample.clone_with_associations
unless @sample.specimen.can_view?
Method create
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
if handle_upload_data
@sop = Sop.new(params[:sop])
@sop.policy.set_attributes_with_sharing params[:sharing], @sop.projects
Method get_compound_annotation
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_compound_annotation compound_name
url=URI.encode(webservice_base_url + "compounds?compoundName=")
compound_name = URI.escape(compound_name, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))
url.concat(compound_name)
doc = get_xml_doc url
Method update_params_for_batch
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_params_for_batch(params)
data = []
data_urls = []
original_filenames = []
make_local_copy = []
Method url_response_code
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def url_response_code asset_url
url = URI.parse(URI.encode(asset_url.strip))
code=""
begin
if (["http","https"].include?(url.scheme))
Method fix_file_extensions
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def fix_file_extensions(run)
Dir.mktmpdir("#{run.id}", Rails.root.join("tmp")) do |tmp_dir|
tmp_zip = File.join(tmp_dir, "all.zip")
Zip::File.open(run.results.path) do |old_zip|
Zip::File.open(tmp_zip, Zip::File::CREATE) do |new_zip|
Method get_contents
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_contents uri,user,password,recursive=false
found=[]
content = propfind uri,user,password,1
Similar blocks of code found in 4 locations. Consider refactoring. Open
this.SetCurrentWidth2 = function(value)
{
value = parseInt(value);
if(isNaN(value))
value = 0;
- 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 56.
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 4 locations. Consider refactoring. Open
this.SetCurrentHeight = function(value)
{
value = parseInt(value);
if(isNaN(value))
value = 0;
- 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 56.
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 4 locations. Consider refactoring. Open
this.SetCurrentHeight = function(value)
{
value = parseInt(value);
if(isNaN(value))
value = 0;
- 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 56.
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 4 locations. Consider refactoring. Open
this.SetCurrentWidth = function(value)
{
value = parseInt(value);
if(isNaN(value))
value = 0;
- 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 56.
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 additionalFieldForItem
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function additionalFieldForItem(form_id, fs_or_ec_id){
var elements = $(form_id).getElements();
var item;
var substance_autocomplete;
for (var i=0;i<elements.length;i++)
Function relativeRows
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function relativeRows(minRow, maxRow, sheetNumber){
var current_page = null;
if (sheetNumber != null)
current_page = currentPage(sheetNumber);
Function check_show_existing_items
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function check_show_existing_items(organism_element_id, existing_items_element_id, url) {
var selected_ids = $F(organism_element_id).join();
if (selected_ids == '0') {
if ($(existing_items_element_id + "_spinner") != null)
Effect.Fade(existing_items_element_id + "_spinner");