Showing 12,631 of 12,631 total issues
Method initialize
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(params = {})
super
self.is_median_z = false
self.is_undefined_z = false # and delta_z is zero, or ignored
Method type_material_catalog_label
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def type_material_catalog_label(type_material, verbose = false) # Possibly parameterize biocurations: true, repository: true, identifiers: true
t = type_material
if t.nil? && verbose # Anticipate rendering in paper
return '[TODO: Add type material]'
Method update
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update
next_id = next_collecting_event_id
ce = current_collecting_event
any_failed = false
Method build_collection_objects
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_collection_objects
@total_data_lines = 0
i = 0
# loop through rows
Method autocomplete
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def autocomplete
t = Time.now
return [] if query_string.blank?
queries = [
[autocomplete_exact_id, nil ],
Similar blocks of code found in 3 locations. Consider refactoring. Open
def create
@preparation_type = PreparationType.new(preparation_type_params)
respond_to do |format|
if @preparation_type.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 54.
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 3 locations. Consider refactoring. Open
def create
@serial = Serial.new(serial_params)
respond_to do |format|
if @serial.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 54.
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 3 locations. Consider refactoring. Open
def create
@namespace = Namespace.new(namespace_params)
respond_to do |format|
if @namespace.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 54.
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 next_object_by_inserted_keyword(object, keyword)
return nil if keyword.nil? || object.nil?
t = object.class.base_class.name.tableize
base = object.class.base_class
.joins(:tags)
- 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 54.
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 previous_object_by_inserted_keyword(object, keyword)
return nil if keyword.nil? || object.nil?
t = object.class.base_class.name.tableize
base = object.class.base_class
.joins(:tags)
- 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 54.
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 initialize_autocomplete
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialize_autocomplete: function (form) {
var autocomplete_input = form.find(".keyword_picker_autocomplete");
autocomplete_input.autocomplete({
source: '/keywords/lookup_keyword',
Function reset
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
reset() {
const boardStore = useBoardStore()
const tagStore = useTagStore()
const noteStore = useNoteStore()
const lock = useLockStore()
Function makeFilterRequest
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const makeFilterRequest = (params = state.parameters) => {
const payload = removeEmptyParameters({
...params
})
Method sv_fix_add_nominotypical_sub
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def sv_fix_add_nominotypical_sub
return false if list_of_coordinated_names.collect{|r| r.id}.include?(parent_id)
rank = rank_string
p = self.parent
prank = p.rank_string
Method source_citation_totals
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def source_citation_totals(sources)
data = {}
max_total = 0
Citation.related_klasses.each do |k|
Method otu
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def otu(columns)
r = BatchLoad::ColumnResolver::Result.new
if columns['otu_id']
begin
Method generate
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.generate(otus, project_members, reference_csv = nil )
::CSV.generate(col_sep: "\t") do |csv|
csv << %w{
nameID
Method create
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
@create_attempted = true
if ready_to_create?
# TODO: DRY
Method generate
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.generate(otus, project_members, reference_csv = nil )
::CSV.generate(col_sep: "\t") do |csv|
# TODO: Biocuration attributes on these two
# sex
Method observation_params
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def observation_params
params.require(:observation).permit(
:character_state_id, :frequency,
:continuous_value, :continuous_unit,
:day_made,