Showing 253 of 368 total issues
Method add_intervals
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def add_intervals
(@timelines + [self]).flatten.each do |timeline|
timeline.timeline_events.each_with_index do |event, idx|
interval =
if idx < (timeline.timeline_events.size - 1)
Method relation
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def relation
types_of_match = ['SELF']
types_of_match << 'SYNONYM' if @match_synonyms
types_of_match << 'COMMON_NAME' if @match_common_names
types_of_match << 'SUBSPECIES' if @match_subspecies
Function queryResults
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function queryResults () {
var href, values, params, $link;
if (queryResults.ajax) {
getResultsCount(getParamsFromInputs()).then( function (res) {
if (res.total > res.csv_limit){
Method initialize_internal_query
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize_internal_query
if @report_type == :raw
# includes would override the select clause
@query = @query.preload(:reported_taxon_concept)
end
Method eu_decision_select_attrs
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def eu_decision_select_attrs
string = %{
eu_decisions.notes,
eu_decisions.start_date,
v.original_start_date_formatted,
Method summary
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def summary
res = []
rank_name = @output.new_rank.try(:name) || @output.taxon_concept.try(:rank).try(:name)
full_name = @output.display_full_name
name_status = @output.new_name_status || @output.taxon_concept.try(:name_status)
Method update_species_downloads
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.update_species_downloads
puts "Updating Species+ downloads"
Designation.dict.each do |d|
elapsed_time = Benchmark.realtime do
Species::ListingsExportFactory.new(:designation => d).export
Method to_csv
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.to_csv(file_path, filters)
limit = 1000
offset = 0
csv_separator_char =
case filters[:csv_separator]
Method initialize
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(params)
sanitized_params = {
# possible taxonomies are cms and cites_eu
taxonomy: whitelist_param(
sanitise_symbol(params[:taxonomy]),
Method download
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def download
set_csv_separator
@filters = filter_params.merge({
:csv_separator => cookies['speciesplus.csv_separator'].try(:to_sym)
Method initialize_query
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize_query
@taxon_concepts_rel = MTaxonConcept.all.
by_cites_eu_taxonomy
if @cites_regions.empty? && @countries.empty? && !@cites_appendices.empty?
Method show
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def show
builder = NomenclatureChange::Split::Constructor.new(@nomenclature_change)
case step
when :inputs
set_events
Method sanitized_shipments_scope
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def sanitized_shipments_scope
res = {}
sanitized_sandbox_scope.each do |scope_column, scope_def|
case scope_column
when 'taxon_name', 'rank'
Method generate_mapping_table_rows
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def generate_mapping_table_rows(rule)
formatted_input = input_flattening(rule)
formatted_input.delete_if { |_, v| v.empty? }
output = rule['output']
modifier = output['quantity_modifier'] ? "'#{output['quantity_modifier']}'" : 'NULL'
Method higher_taxa_headers
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def higher_taxa_headers(prev_item, curr_item)
ranks =
if prev_item.nil?
@header_ranks
else
Method format_values
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def format_values(key, values)
case key
when 'sources', 'purposes'
values.map do |value|
value = JSON.parse(value['data'])
Method initialize
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(shipments_rel)
@query = shipments_rel.except(:select).select([
'trade_shipments.id', :legacy_shipment_number, :year,
'trade_shipments.taxon_concept_id', 'trade_shipments.appendix',
'm.appendix AS auto_appendix'
Method countries_reported
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def countries_reported(year)
sql = <<-SQL
SELECT COUNT(*) AS cnt
FROM(
(
Method escape_latex
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.escape_latex(text)
# :stopdoc:
unless @latex_escaper
if defined?(RedCloth::Formatters::LATEX)
class << (@latex_escaper = RedCloth.new(''))
Method columns_with_type
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def columns_with_type
super() + [
['SigTradePhase', 'TEXT'],
['SigTradeProcessStage', 'TEXT'],
['SigTradeDocumentNumber', 'TEXT'],