rails-girls-summer-of-code/rgsoc-teams

View on GitHub
app/models/mentor/application.rb

Summary

Maintainability
A
2 hrs
Test Coverage

Class Application has 25 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Application
    include ActiveModel::Model

    attr_accessor :id,
                  :team_name,
Severity: Minor
Found in app/models/mentor/application.rb - About 2 hrs to fix

    Use each_key instead of keys.each.
    Open

          attrs.tap { |a| a.keys.each { |k| a[k.sub(/student(0|1)_application_/, '')] = a.delete(k) } }
    Severity: Minor
    Found in app/models/mentor/application.rb by rubocop

    This cop checks for uses of each_key and each_value Hash methods.

    Note: If you have an array of two-element arrays, you can put parentheses around the block arguments to indicate that you're not working with a hash, and suppress RuboCop offenses.

    Example:

    # bad
    hash.keys.each { |k| p k }
    hash.values.each { |v| p v }
    hash.each { |k, _v| p k }
    hash.each { |_k, v| p v }
    
    # good
    hash.each_key { |k| p k }
    hash.each_value { |v| p v }

    Avoid comma after the last item of a hash.
    Open

              mentor_fav:           "mentor_fav_project#{choice}",
    Severity: Minor
    Found in app/models/mentor/application.rb by rubocop

    This cop checks for trailing comma in array and hash literals.

    Example: EnforcedStyleForMultiline: consistent_comma

    # bad
    a = [1, 2,]
    
    # good
    a = [
      1, 2,
      3,
    ]
    
    # good
    a = [
      1,
      2,
    ]

    Example: EnforcedStyleForMultiline: comma

    # bad
    a = [1, 2,]
    
    # good
    a = [
      1,
      2,
    ]

    Example: EnforcedStyleForMultiline: no_comma (default)

    # bad
    a = [1, 2,]
    
    # good
    a = [
      1,
      2
    ]

    There are no issues that match your filters.

    Category
    Status