SpeciesFileGroup/taxonworks

View on GitHub
lib/export/coldp/files/taxon_concept_relation.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|
    
            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 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{
                taxonID
Severity: Minor
Found in lib/export/coldp/files/taxon_concept_relation.rb - About 1 hr to fix

    TODO found
    Open

            "OtuRelationship::Intersecting" => "intersecting",  # TODO: not included in CLB? http://api.checklistbank.org/vocab/TaxonConceptRelType

    Use 2 (not 4) spaces for indentation.
    Open

        MAP_TYPES = {

    This cop checks for indentation that doesn't use the specified number of spaces.

    See also the IndentationConsistency cop which is the companion to this one.

    Example:

    # bad
    class A
     def test
      puts 'hello'
     end
    end
    
    # good
    class A
      def test
        puts 'hello'
      end
    end

    Example: IgnoredPatterns: ['^\s*module']

    # bad
    module A
    class B
      def test
      puts 'hello'
      end
    end
    end
    
    # good
    module A
    class B
      def test
        puts 'hello'
      end
    end
    end

    Use 2 (not 4) spaces for indentation.
    Open

                csv << %w{

    This cop checks for indentation that doesn't use the specified number of spaces.

    See also the IndentationConsistency cop which is the companion to this one.

    Example:

    # bad
    class A
     def test
      puts 'hello'
     end
    end
    
    # good
    class A
      def test
        puts 'hello'
      end
    end

    Example: IgnoredPatterns: ['^\s*module']

    # bad
    module A
    class B
      def test
      puts 'hello'
      end
    end
    end
    
    # good
    module A
    class B
      def test
        puts 'hello'
      end
    end
    end

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

            "OtuRelationship::PartiallyOverlapping" => "overlaps",

    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"

    Use 2 (not 4) spaces for indentation.
    Open

                    o.otu_relationships.each do |orel|

    This cop checks for indentation that doesn't use the specified number of spaces.

    See also the IndentationConsistency cop which is the companion to this one.

    Example:

    # bad
    class A
     def test
      puts 'hello'
     end
    end
    
    # good
    class A
      def test
        puts 'hello'
      end
    end

    Example: IgnoredPatterns: ['^\s*module']

    # bad
    module A
    class B
      def test
      puts 'hello'
      end
    end
    end
    
    # good
    module A
    class B
      def test
        puts 'hello'
      end
    end
    end

    Prefer symbols instead of strings as hash keys.
    Open

            "OtuRelationship::PartiallyOverlapping" => "overlaps",

    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

            "OtuRelationship::Intersecting" => "intersecting",  # TODO: not included in CLB? http://api.checklistbank.org/vocab/TaxonConceptRelType

    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

            "OtuRelationship::ProperPartInverse" => "includes",

    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

            "OtuRelationship::PartiallyOverlapping" => "overlaps",

    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"

    Use 2 (not 4) spaces for indentation.
    Open

            ::CSV.generate(col_sep: "\t") do |csv|

    This cop checks for indentation that doesn't use the specified number of spaces.

    See also the IndentationConsistency cop which is the companion to this one.

    Example:

    # bad
    class A
     def test
      puts 'hello'
     end
    end
    
    # good
    class A
      def test
        puts 'hello'
      end
    end

    Example: IgnoredPatterns: ['^\s*module']

    # bad
    module A
    class B
      def test
      puts 'hello'
      end
    end
    end
    
    # good
    module A
    class B
      def test
        puts 'hello'
      end
    end
    end

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

            "OtuRelationship::ProperPartInverse" => "includes",

    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

            "OtuRelationship::Equal" => "equals",

    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

            "OtuRelationship::ProperPart" => "included in",

    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

            "OtuRelationship::Equal" => "equals",

    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

            "OtuRelationship::Disjoint" => "excludes",

    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

            "OtuRelationship::ProperPart" => "included in",

    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"

    Use 2 (not 4) spaces for indentation.
    Open

        def self.generate(otus, project_members, reference_csv = nil )

    This cop checks for indentation that doesn't use the specified number of spaces.

    See also the IndentationConsistency cop which is the companion to this one.

    Example:

    # bad
    class A
     def test
      puts 'hello'
     end
    end
    
    # good
    class A
      def test
        puts 'hello'
      end
    end

    Example: IgnoredPatterns: ['^\s*module']

    # bad
    module A
    class B
      def test
      puts 'hello'
      end
    end
    end
    
    # good
    module A
    class B
      def test
        puts 'hello'
      end
    end
    end

    Use 2 (not 4) spaces for indentation.
    Open

                        sources = orel.sources.load

    This cop checks for indentation that doesn't use the specified number of spaces.

    See also the IndentationConsistency cop which is the companion to this one.

    Example:

    # bad
    class A
     def test
      puts 'hello'
     end
    end
    
    # good
    class A
      def test
        puts 'hello'
      end
    end

    Example: IgnoredPatterns: ['^\s*module']

    # bad
    module A
    class B
      def test
      puts 'hello'
      end
    end
    end
    
    # good
    module A
    class B
      def test
        puts 'hello'
      end
    end
    end

    Prefer symbols instead of strings as hash keys.
    Open

            "OtuRelationship::Disjoint" => "excludes",

    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

            "OtuRelationship::Intersecting" => "intersecting",  # TODO: not included in CLB? http://api.checklistbank.org/vocab/TaxonConceptRelType

    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

            "OtuRelationship::Equal" => "equals",

    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"

    Freeze mutable objects assigned to constants.
    Open

        MAP_TYPES = {
            "OtuRelationship::Intersecting" => "intersecting",  # TODO: not included in CLB? http://api.checklistbank.org/vocab/TaxonConceptRelType
            "OtuRelationship::Disjoint" => "excludes",
            "OtuRelationship::Equal" => "equals",
            "OtuRelationship::ProperPartInverse" => "includes",

    This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).

    Strict mode can be used to freeze all constants, rather than just literals. Strict mode is considered an experimental feature. It has not been updated with an exhaustive list of all methods that will produce frozen objects so there is a decent chance of getting some false positives. Luckily, there is no harm in freezing an already frozen object.

    Example: EnforcedStyle: literals (default)

    # bad
    CONST = [1, 2, 3]
    
    # good
    CONST = [1, 2, 3].freeze
    
    # good
    CONST = <<~TESTING.freeze
      This is a heredoc
    TESTING
    
    # good
    CONST = Something.new

    Example: EnforcedStyle: strict

    # bad
    CONST = Something.new
    
    # bad
    CONST = Struct.new do
      def foo
        puts 1
      end
    end
    
    # good
    CONST = Something.new.freeze
    
    # good
    CONST = Struct.new do
      def foo
        puts 1
      end
    end.freeze

    Prefer symbols instead of strings as hash keys.
    Open

            "OtuRelationship::Intersecting" => "intersecting",  # TODO: not included in CLB? http://api.checklistbank.org/vocab/TaxonConceptRelType

    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 }

    Use 2 (not 4) spaces for indentation.
    Open

        def self.type(orel)

    This cop checks for indentation that doesn't use the specified number of spaces.

    See also the IndentationConsistency cop which is the companion to this one.

    Example:

    # bad
    class A
     def test
      puts 'hello'
     end
    end
    
    # good
    class A
      def test
        puts 'hello'
      end
    end

    Example: IgnoredPatterns: ['^\s*module']

    # bad
    module A
    class B
      def test
      puts 'hello'
      end
    end
    end
    
    # good
    module A
    class B
      def test
        puts 'hello'
      end
    end
    end

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

            "OtuRelationship::Disjoint" => "excludes",

    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

            "OtuRelationship::ProperPartInverse" => "includes",

    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 symbols instead of strings as hash keys.
    Open

            "OtuRelationship::ProperPart" => "included in",

    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 }

    There are no issues that match your filters.

    Category
    Status