SpeciesFileGroup/taxonworks

View on GitHub

Showing 12,631 of 12,631 total issues

Method has too many lines. [30/25]
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

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [30/25]
Open

  def source_citation_totals(sources)
    data = {}
    max_total = 0

    Citation.related_klasses.each do |k|
Severity: Minor
Found in app/helpers/sources_helper.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [30/25]
Open

  def observation_params
    params.require(:observation).permit(
      :character_state_id, :frequency,
      :continuous_value, :continuous_unit,
      :day_made,

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [30/25]
Open

  def field_occurrence_params
    params.require(:field_occurrence).permit(
      :total, :is_absent,
      :ranged_lot_category_id,
      :collecting_event_id,

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [30/25]
Open

  def self.generate(otus, project_members, reference_csv = nil )
    ::CSV.generate(col_sep: "\t") do |csv|

      csv << %w{
        nameID

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [30/25]
Open

    def create
      @create_attempted = true

      if ready_to_create?
        # TODO: DRY
Severity: Minor
Found in lib/batch_load/import.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [30/25]
Open

    def self.generate(otus, project_members, reference_csv = nil )
        ::CSV.generate(col_sep: "\t") do |csv|
    
            csv << %w{
                taxonID

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [30/25]
Open

  def self.generate(otus, project_members, reference_csv = nil )
    ::CSV.generate(col_sep: "\t") do |csv|

      # TODO: Biocuration attributes on these two
      # sex

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [30/25]
Open

  def self.elevation_regex_from_verbatim_label(text)
    text = ' ' + text.downcase.squish + ' '
    elevation = {}

    if (matchdata1 = text.match(/\D(\d*,?\d+)\s?[-–]\s?(\d*,?\d+) ?(m|ft|feet|meters)\.?\W/))
Severity: Minor
Found in lib/utilities/elevation.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [30/25]
Open

  def initialize(
    observation_matrix_id: nil,
    project_id: nil,
    language_id: nil,
    keyword_ids: nil,
Severity: Minor
Found in lib/tools/interactive_key.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

File sources_controller.rb has 260 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class SourcesController < ApplicationController
  include DataControllerConfiguration::SharedDataControllerConfiguration

  before_action :set_source, only: [:show, :edit, :update, :destroy, :clone, :api_show]
  after_action -> { set_pagination_headers(:sources) }, only: [:index, :api_index ], if: :json_request?
Severity: Minor
Found in app/controllers/sources_controller.rb - About 2 hrs to fix

    Method gpx_to_csv has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def self.gpx_to_csv(gpx_file, csv_options = {col_sep: "\t", headers: true, encoding: 'UTF-8', write_headers: true})
        gpx_headers = %w(name geojson start_date end_date minimum_elevation maximum_elevation)
    
        csv_string = CSV.generate(**csv_options) do |csv|
          csv << gpx_headers
    Severity: Major
    Found in lib/vendor/gpx_to_csv.rb - About 2 hrs to fix

      Method degrees_minutes_seconds_to_decimal_degrees has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def self.degrees_minutes_seconds_to_decimal_degrees(dms_in) # rubocop:disable Metrics/PerceivedComplexity !! But this is too complex :)
            match_string = nil
            # no_point     = false
            degrees      = 0.0
            minutes      = 0.0
      Severity: Major
      Found in lib/utilities/geo.rb - About 2 hrs to fix

        Function makeInitialState has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function makeInitialState() {
          return {
            settings: {
              saving: false,
              lock: {
        Severity: Major
        Found in app/javascript/vue/tasks/images/new_image/store/store.js - About 2 hrs to fix

          Method generate has 55 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{
                  ID
          Severity: Major
          Found in lib/export/coldp/files/type_material.rb - About 2 hrs to fix

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

            export default (shape, type = 'Georeference::Leaflet') => ({
              tmpId: Math.random().toString(36).substr(2, 5),
              geographic_item_attributes: { shape: JSON.stringify(shape) },
              error_radius: shape.properties?.radius,
              type: type
            app/javascript/vue/components/Form/FormCollectingEvent/helpers/addGeoreference.js on lines 1..6

            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 79.

            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

            Further Reading

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

            export default (shape, type = 'Georeference::Leaflet') => ({
              tmpId: Math.random().toString(36).substr(2, 5),
              geographic_item_attributes: { shape: JSON.stringify(shape) },
              error_radius: shape.properties?.radius,
              type: type
            app/javascript/vue/tasks/collecting_events/new_collecting_event/helpers/addGeoreference.js on lines 1..6

            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 79.

            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

            Further Reading

            File layouts.js has 257 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import {
              COLLECTING_EVENT_PROPERTIES,
              COLLECTION_OBJECT_PROPERTIES,
              DWC_OCCURRENCE_PROPERTIES,
              REPOSITORY_PROPERTIES,

              Class SequencesController has 21 methods (exceeds 20 allowed). Consider refactoring.
              Open

              class SequencesController < ApplicationController
                include DataControllerConfiguration::ProjectDataControllerConfiguration
                
                before_action :set_sequence, only: [:show, :edit, :update, :destroy]
              
              
              Severity: Minor
              Found in app/controllers/sequences_controller.rb - About 2 hrs to fix

                Class ControlledVocabularyTermsController has 21 methods (exceeds 20 allowed). Consider refactoring.
                Open

                class ControlledVocabularyTermsController < ApplicationController
                  include DataControllerConfiguration::ProjectDataControllerConfiguration
                
                  before_action :set_controlled_vocabulary_term, only: [:show, :edit, :update, :destroy, :depictions, :citations, :confidences, :api_show]
                
                
                Severity: Minor
                Found in app/controllers/controlled_vocabulary_terms_controller.rb - About 2 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language