Showing 1,025 of 1,025 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
def self.uri_for_collection(resource_name, *args)
options = args.extract_options!
# defaults:
options.reverse_merge!(:params => nil)
- 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 38.
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
Consider simplifying this complex logical expression. Open
unless res.nil?
permissions.can_view = res["can_view"].to_s==@@expected_true_value && state_allows_manage?(user)
permissions.can_download = res["can_download"].to_s==@@expected_true_value && state_allows_manage?(user)
permissions.can_edit = res["can_edit"].to_s==@@expected_true_value && state_allows_manage?(user)
permissions.can_manage = res["can_manage"].to_s==@@expected_true_value && state_allows_manage?(user)
Similar blocks of code found in 2 locations. Consider refactoring. Open
setTimeout(function(a, b) { return function() { self.hideSection(a, b); } }(id_section, cnt), self.delay.hide);
- 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 48.
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
setTimeout(function(a, b) { return function() { self.showSection(a, b); } } (id_section, cnt), self.delay.show);
- 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 48.
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
Method create_job
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.create_job subscribable_type, subscribable_id, old_project_ids, t=5.seconds.from_now, priority=1
Method create_job
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.create_job subscribable_type, subscribable_id, project_ids, t=5.seconds.from_now, priority=1
Method feedback
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def feedback user,topic,details,send_anonymously,base_host
Function showDataTooltip
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function showDataTooltip(prefix,pagex,pagey,valuex,valuey) {
Function select_cells
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function select_cells(startCol, startRow, endCol, endRow, sheetNumber) {
Function performSearch
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function performSearch(data, regexps, queries, highlighters, state) {
Method associate_organism
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def associate_organism(organism,strain_id=nil,culture_growth_type=nil,tissue_and_cell_type_id="0",tissue_and_cell_type_title=nil)
Method authorized_list
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def authorized_list all_items, attribute, sort=true, max_length=75, count_hidden_items=false
Method node_element
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def node_element id, name, item_info, fave_color, border_color
Method assay_type_select_tag
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def assay_type_select_tag form, is_modelling,element_id, selected_uri,html_options={}
Method list_samples_and_assay_organisms
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def list_samples_and_assay_organisms attribute, assay_samples, assay_organisms, html_options={}, none_text="Not Specified"
Method edge_element
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def edge_element id, name, source, target, fave_color
Method ontology_selection_list
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def ontology_selection_list type, element_name, selected_uri, disabled_uris={}, html_options={}
Method ontology_select_tag
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def ontology_select_tag form,type,element_id,selected_uri,html_options={}
Method assets_list_xml
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def assets_list_xml builder,assets,tag="assets",include_core=true,include_resource=true
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize uri,label=nil,description=nil,subclasses=[],parents=[]