SpeciesFileGroup/taxonworks

View on GitHub
lib/export/coldp/files/vernacular_name.rb

Summary

Maintainability
A
1 hr
Test Coverage

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 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
Severity: Minor
Found in lib/export/coldp/files/vernacular_name.rb - About 1 hr to fix

    Method transliteration has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

      def self.transliteration(common_name)
        n = common_name.alternate_values.where(type: 'AlternateValue::Translation', alternate_value_object_attribute: :name).load
        if n.any?
          n.collect{|a| a.language.name == 'English' ? a.language.name : nil}.compact.join('; ')
        else
    Severity: Minor
    Found in lib/export/coldp/files/vernacular_name.rb - About 25 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    TODO found
    Open

      # TODO: Map to biocuration attribute via URI

    TODO found
    Open

      #   Not used internally within CoLDP, for reference only. TODO: confirm.

    TODO found
    Open

          # TODO: Biocuration attributes on these two

    There are no issues that match your filters.

    Category
    Status