codeforamerica/michigan-benefits

View on GitHub
app/models/snap_application_attributes.rb

Summary

Maintainability
C
1 day
Test Coverage

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

  def attributes
    [
      {
        applying_for_food_assistance: "Yes",
        email: snap_application.email,
Severity: Major
Found in app/models/snap_application_attributes.rb - About 5 hrs to fix

    Class SnapApplicationAttributes has 33 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class SnapApplicationAttributes
      include PdfAttributes
    
      def initialize(snap_application:)
        @snap_application = snap_application
    Severity: Minor
    Found in app/models/snap_application_attributes.rb - About 4 hrs to fix

      File snap_application_attributes.rb has 266 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      class SnapApplicationAttributes
        include PdfAttributes
      
        def initialize(snap_application:)
          @snap_application = snap_application
      Severity: Minor
      Found in app/models/snap_application_attributes.rb - About 2 hrs to fix

        Avoid comma after the last item of a hash.
        Open

                  snap_application.authorized_representative_name,

        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 an array.
        Open

              snap_application.insurance_expense,

        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 an array.
        Open

              yes_no_checkbox("utility_cooling", snap_application.utility_cooling?),

        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