codeforamerica/michigan-benefits

View on GitHub
app/models/snap_application_member_attributes.rb

Summary

Maintainability
A
1 hr
Test Coverage

Method attributes has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def attributes
    [
      {
        "#{position}_member_full_name" => member.display_name,
        "#{position}_member_sex_male" => bool_to_checkbox(member.sex == "male"),
Severity: Minor
Found in app/models/snap_application_member_attributes.rb - About 1 hr to fix

    Avoid comma after the last item of an array.
    Open

          yes_no_checkbox("#{position}_member_in_college", member.in_college?),

    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
    ]

    Avoid comma after the last item of a hash.
    Open

              bool_to_checkbox(member.requesting_food_assistance?),

    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