SpeciesFileGroup/taxonworks

View on GitHub

Showing 12,636 of 12,636 total issues

unexpected token kDO_BLOCK (Using Ruby 2.4 parser; configure using TargetRubyVersion parameter, under AllCops)
Open

json.not_updated do

This is not actually a cop. It does not inspect anything. It just provides methods to repack Parser's diagnostics/errors into RuboCop's offenses.

Tagging a string as html safe may be a security risk.
Open

    link_to(alternate_value_tag(alternate_value).html_safe, alternate_value.annotated_object.metamorphosize)

This cop checks for the use of output safety calls like html_safe, raw, and safe_concat. These methods do not escape content. They simply return a SafeBuffer containing the content as is. Instead, use safe_join to join content and escape it and concat to concatenate content and escape it, ensuring its safety.

Example:

user_content = "hi"

# bad
"

#{user_content}

".html_safe # => ActiveSupport::SafeBuffer "

hi

" # good content_tag(:p, user_content) # => ActiveSupport::SafeBuffer "

<b>hi</b>

" # bad out = "" out << "
  • #{user_content}
  • " out << "
  • #{user_content}
  • " out.html_safe # => ActiveSupport::SafeBuffer "
  • hi
  • hi
  • " # good out = [] out << content_tag(:li, user_content) out << content_tag(:li, user_content) safe_join(out) # => ActiveSupport::SafeBuffer # "
  • <b>hi</b>
  • <b>hi</b>
  • " # bad out = "

    trusted content

    ".html_safe out.safe_concat(user_content) # => ActiveSupport::SafeBuffer "

    trusted_content

    hi" # good out = "

    trusted content

    ".html_safe out.concat(user_content) # => ActiveSupport::SafeBuffer # "

    trusted_content

    <b>hi</b>" # safe, though maybe not good style out = "trusted content" result = out.concat(user_content) # => String "trusted contenthi" # because when rendered in ERB the String will be escaped: # <%= result %> # => trusted content<b>hi</b> # bad (user_content + " " + content_tag(:span, user_content)).html_safe # => ActiveSupport::SafeBuffer "hi <span><b>hi</b></span>" # good safe_join([user_content, " ", content_tag(:span, user_content)]) # => ActiveSupport::SafeBuffer # "<b>hi</b> <span>&lt;b&gt;hi&lt;/b&gt;</span>"

    Prefer the new style validations validates :column, presence: value over validates_presence_of.
    Open

      validates_presence_of :type_type, :protonym, :collection_object
    Severity: Minor
    Found in app/models/type_material.rb by rubocop

    This cop checks for the use of old-style attribute validation macros.

    Example:

    # bad
    validates_acceptance_of :foo
    validates_confirmation_of :foo
    validates_exclusion_of :foo
    validates_format_of :foo
    validates_inclusion_of :foo
    validates_length_of :foo
    validates_numericality_of :foo
    validates_presence_of :foo
    validates_absence_of :foo
    validates_size_of :foo
    validates_uniqueness_of :foo
    
    # good
    validates :foo, acceptance: true
    validates :foo, confirmation: true
    validates :foo, exclusion: true
    validates :foo, format: true
    validates :foo, inclusion: true
    validates :foo, length: true
    validates :foo, numericality: true
    validates :foo, presence: true
    validates :foo, absence: true
    validates :foo, size: true
    validates :foo, uniqueness: true

    unexpected token tCOMMA (Using Ruby 2.4 parser; configure using TargetRubyVersion parameter, under AllCops)
    Open

            email:,
    Severity: Minor
    Found in app/models/user.rb by rubocop

    This is not actually a cop. It does not inspect anything. It just provides methods to repack Parser's diagnostics/errors into RuboCop's offenses.

    unexpected token tRPAREN (Using Ruby 2.4 parser; configure using TargetRubyVersion parameter, under AllCops)
    Open

        json.set!("Past week: New sources", Source.where(created_at: 1.week.ago..).count)

    This is not actually a cop. It does not inspect anything. It just provides methods to repack Parser's diagnostics/errors into RuboCop's offenses.

    unexpected token kEND (Using Ruby 2.4 parser; configure using TargetRubyVersion parameter, under AllCops)
    Open

    end

    This is not actually a cop. It does not inspect anything. It just provides methods to repack Parser's diagnostics/errors into RuboCop's offenses.

    Prefer single-quoted strings when you don't need string interpolation or special symbols.
    Open

      json.error_data dataset_record.metadata["error_data"] if dataset_record.metadata["error_data"]

    Checks if uses of quotes match the configured preference.

    Example: EnforcedStyle: single_quotes (default)

    # bad
    "No special symbols"
    "No string interpolation"
    "Just text"
    
    # good
    'No special symbols'
    'No string interpolation'
    'Just text'
    "Wait! What's #{this}!"

    Example: EnforcedStyle: double_quotes

    # bad
    'Just some text'
    'No special chars or interpolation'
    
    # good
    "Just some text"
    "No special chars or interpolation"
    "Every string in #{project} uses double_quotes"

    Prefer single-quoted strings when you don't need string interpolation or special symbols.
    Open

      json.array! @dataset_records, partial: "dataset_records/dataset_record", as: :dataset_record

    Checks if uses of quotes match the configured preference.

    Example: EnforcedStyle: single_quotes (default)

    # bad
    "No special symbols"
    "No string interpolation"
    "Just text"
    
    # good
    'No special symbols'
    'No string interpolation'
    'Just text'
    "Wait! What's #{this}!"

    Example: EnforcedStyle: double_quotes

    # bad
    'Just some text'
    'No special chars or interpolation'
    
    # good
    "Just some text"
    "No special chars or interpolation"
    "Every string in #{project} uses double_quotes"

    Prefer single-quoted strings when you don't need string interpolation or special symbols.
    Open

    json.partial! "dataset_records/dataset_record", dataset_record: @dataset_record

    Checks if uses of quotes match the configured preference.

    Example: EnforcedStyle: single_quotes (default)

    # bad
    "No special symbols"
    "No string interpolation"
    "Just text"
    
    # good
    'No special symbols'
    'No string interpolation'
    'Just text'
    "Wait! What's #{this}!"

    Example: EnforcedStyle: double_quotes

    # bad
    'Just some text'
    'No special chars or interpolation'
    
    # good
    "Just some text"
    "No special chars or interpolation"
    "Every string in #{project} uses double_quotes"

    Prefer symbols instead of strings as hash keys.
    Open

    'xmlns:nex'          => 'http://www.nexml.org/2009',

    This cop checks for the use of strings as keys in hashes. The use of symbols is preferred instead.

    Example:

    # bad
    { 'one' => 1, 'two' => 2, 'three' => 3 }
    
    # good
    { one: 1, two: 2, three: 3 }

    unexpected token kDO_BLOCK (Using Ruby 2.4 parser; configure using TargetRubyVersion parameter, under AllCops)
    Open

        json.citations do

    This is not actually a cop. It does not inspect anything. It just provides methods to repack Parser's diagnostics/errors into RuboCop's offenses.

    unexpected token kEND (Using Ruby 2.4 parser; configure using TargetRubyVersion parameter, under AllCops)
    Open

      end

    This is not actually a cop. It does not inspect anything. It just provides methods to repack Parser's diagnostics/errors into RuboCop's offenses.

    unexpected token kEND (Using Ruby 2.4 parser; configure using TargetRubyVersion parameter, under AllCops)
    Open

      end

    This is not actually a cop. It does not inspect anything. It just provides methods to repack Parser's diagnostics/errors into RuboCop's offenses.

    unexpected token tRPAREN (Using Ruby 2.4 parser; configure using TargetRubyVersion parameter, under AllCops)
    Open

        pinboard_items.where(project_id:).order('pinned_object_type DESC, position').each do |i|
    Severity: Minor
    Found in app/models/user.rb by rubocop

    This is not actually a cop. It does not inspect anything. It just provides methods to repack Parser's diagnostics/errors into RuboCop's offenses.

    Prefer single-quoted strings when you don't need string interpolation or special symbols.
    Open

    json.partial! "/field_occurrences/attributes", field_occurrence: @field_occurrence

    Checks if uses of quotes match the configured preference.

    Example: EnforcedStyle: single_quotes (default)

    # bad
    "No special symbols"
    "No string interpolation"
    "Just text"
    
    # good
    'No special symbols'
    'No string interpolation'
    'Just text'
    "Wait! What's #{this}!"

    Example: EnforcedStyle: double_quotes

    # bad
    'Just some text'
    'No special chars or interpolation'
    
    # good
    "Just some text"
    "No special chars or interpolation"
    "Every string in #{project} uses double_quotes"

    Prefer symbols instead of strings as hash keys.
    Open

          'isosyntypes' => Lot
    Severity: Minor
    Found in app/models/type_material.rb by rubocop

    This cop checks for the use of strings as keys in hashes. The use of symbols is preferred instead.

    Example:

    # bad
    { 'one' => 1, 'two' => 2, 'three' => 3 }
    
    # good
    { one: 1, two: 2, three: 3 }

    Prefer single-quoted strings when you don't need string interpolation or special symbols.
    Open

    json.partial! "import_datasets/import_dataset", import_dataset: @import_dataset, filters: @filters

    Checks if uses of quotes match the configured preference.

    Example: EnforcedStyle: single_quotes (default)

    # bad
    "No special symbols"
    "No string interpolation"
    "Just text"
    
    # good
    'No special symbols'
    'No string interpolation'
    'Just text'
    "Wait! What's #{this}!"

    Example: EnforcedStyle: double_quotes

    # bad
    'Just some text'
    'No special chars or interpolation'
    
    # good
    "Just some text"
    "No special chars or interpolation"
    "Every string in #{project} uses double_quotes"

    unexpected token tCOMMA (Using Ruby 2.4 parser; configure using TargetRubyVersion parameter, under AllCops)
    Open

      json.partial! '/otus/attributes', otu:, extensions: false
    Severity: Minor
    Found in app/views/leads/otus.json.jbuilder by rubocop

    This is not actually a cop. It does not inspect anything. It just provides methods to repack Parser's diagnostics/errors into RuboCop's offenses.

    unexpected token tCOMMA (Using Ruby 2.4 parser; configure using TargetRubyVersion parameter, under AllCops)
    Open

        json.set!("Past week: New taxon names", TaxonName.where(created_at: 1.week.ago.., project_id: @project_id).count)

    This is not actually a cop. It does not inspect anything. It just provides methods to repack Parser's diagnostics/errors into RuboCop's offenses.

    Prefer symbols instead of strings as hash keys.
    Open

    'xmlns'              => 'http://www.nexml.org/2009',

    This cop checks for the use of strings as keys in hashes. The use of symbols is preferred instead.

    Example:

    # bad
    { 'one' => 1, 'two' => 2, 'three' => 3 }
    
    # good
    { one: 1, two: 2, three: 3 }
    Severity
    Category
    Status
    Source
    Language