codeRIT/hackathon_manager

View on GitHub
app/models/questionnaire.rb

Summary

Maintainability
C
7 hrs
Test Coverage

File questionnaire.rb has 437 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class Questionnaire < ApplicationRecord
  audited

  include ActiveModel::Dirty
  include DeletableAttachment
Severity: Minor
Found in app/models/questionnaire.rb - About 6 hrs to fix

    Class Questionnaire has 31 methods (exceeds 20 allowed). Consider refactoring.
    Wontfix

    class Questionnaire < ApplicationRecord
      audited
    
      include ActiveModel::Dirty
      include DeletableAttachment
    Severity: Minor
    Found in app/models/questionnaire.rb - About 3 hrs to fix

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        def portfolio_url=(value)
          value = value.downcase unless value.blank?
          value = "http://" + value if !value.blank? && !value.include?("http://") && !value.include?("https://")
          super value
        end
      Severity: Minor
      Found in app/models/questionnaire.rb and 1 other location - About 20 mins to fix
      app/models/questionnaire.rb on lines 336..340

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 28.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        def vcs_url=(value)
          value = value.downcase unless value.blank?
          value = "https://" + value if !value.blank? && !value.include?("http://") && !value.include?("https://")
          super value
        end
      Severity: Minor
      Found in app/models/questionnaire.rb and 1 other location - About 20 mins to fix
      app/models/questionnaire.rb on lines 330..334

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 28.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Add empty line after guard clause.
      Open

          return unless saved_change_to_checked_in_at && checked_in?
      Severity: Minor
      Found in app/models/questionnaire.rb by rubocop

      This cop enforces empty line after guard clause

      Example:

      # bad
      def foo
        return if need_return?
        bar
      end
      
      # good
      def foo
        return if need_return?
      
        bar
      end
      
      # good
      def foo
        return if something?
        return if something_different?
      
        bar
      end
      
      # also good
      def foo
        if something?
          do_something
          return if need_return?
        end
      end

      Align the elements of a hash literal if they span more than one line.
      Open

          "first"       => "This is my 1st hackathon!",
      Severity: Minor
      Found in app/models/questionnaire.rb by rubocop

      Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration. The configuration options are:

      - key (left align keys, one space before hash rockets and values)
      - separator (align hash rockets and colons, right align keys)
      - table (left align keys, hash rockets, and values)

      The treatment of hashes passed as the last argument to a method call can also be configured. The options are:

      - always_inspect
      - always_ignore
      - ignore_implicit (without curly braces)
      - ignore_explicit (with curly braces)

      Example: EnforcedHashRocketStyle: key (default)

      # bad
      {
        :foo => bar,
         :ba => baz
      }
      {
        :foo => bar,
        :ba  => baz
      }
      
      # good
      {
        :foo => bar,
        :ba => baz
      }

      Example: EnforcedHashRocketStyle: separator

      # bad
      {
        :foo => bar,
        :ba => baz
      }
      {
        :foo => bar,
        :ba  => baz
      }
      
      # good
      {
        :foo => bar,
         :ba => baz
      }

      Example: EnforcedHashRocketStyle: table

      # bad
      {
        :foo => bar,
         :ba => baz
      }
      
      # good
      {
        :foo => bar,
        :ba  => baz
      }

      Example: EnforcedColonStyle: key (default)

      # bad
      {
        foo: bar,
         ba: baz
      }
      {
        foo: bar,
        ba:  baz
      }
      
      # good
      {
        foo: bar,
        ba: baz
      }

      Example: EnforcedColonStyle: separator

      # bad
      {
        foo: bar,
        ba: baz
      }
      
      # good
      {
        foo: bar,
         ba: baz
      }

      Example: EnforcedColonStyle: table

      # bad
      {
        foo: bar,
        ba: baz
      }
      
      # good
      {
        foo: bar,
        ba:  baz
      }

      Example: EnforcedLastArgumentHashStyle: always_inspect (default)

      # Inspect both implicit and explicit hashes.
      
      # bad
      do_something(foo: 1,
        bar: 2)
      
      # bad
      do_something({foo: 1,
        bar: 2})
      
      # good
      do_something(foo: 1,
                   bar: 2)
      
      # good
      do_something(
        foo: 1,
        bar: 2
      )
      
      # good
      do_something({foo: 1,
                    bar: 2})
      
      # good
      do_something({
        foo: 1,
        bar: 2
      })

      Example: EnforcedLastArgumentHashStyle: always_ignore

      # Ignore both implicit and explicit hashes.
      
      # good
      do_something(foo: 1,
        bar: 2)
      
      # good
      do_something({foo: 1,
        bar: 2})

      Example: EnforcedLastArgumentHashStyle: ignore_implicit

      # Ignore only implicit hashes.
      
      # bad
      do_something({foo: 1,
        bar: 2})
      
      # good
      do_something(foo: 1,
        bar: 2)

      Example: EnforcedLastArgumentHashStyle: ignore_explicit

      # Ignore only explicit hashes.
      
      # bad
      do_something(foo: 1,
        bar: 2)
      
      # good
      do_something({foo: 1,
        bar: 2})

      Align the elements of a hash literal if they span more than one line.
      Open

          "late_waitlist"  => "Waitlisted, Late",
      Severity: Minor
      Found in app/models/questionnaire.rb by rubocop

      Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration. The configuration options are:

      - key (left align keys, one space before hash rockets and values)
      - separator (align hash rockets and colons, right align keys)
      - table (left align keys, hash rockets, and values)

      The treatment of hashes passed as the last argument to a method call can also be configured. The options are:

      - always_inspect
      - always_ignore
      - ignore_implicit (without curly braces)
      - ignore_explicit (with curly braces)

      Example: EnforcedHashRocketStyle: key (default)

      # bad
      {
        :foo => bar,
         :ba => baz
      }
      {
        :foo => bar,
        :ba  => baz
      }
      
      # good
      {
        :foo => bar,
        :ba => baz
      }

      Example: EnforcedHashRocketStyle: separator

      # bad
      {
        :foo => bar,
        :ba => baz
      }
      {
        :foo => bar,
        :ba  => baz
      }
      
      # good
      {
        :foo => bar,
         :ba => baz
      }

      Example: EnforcedHashRocketStyle: table

      # bad
      {
        :foo => bar,
         :ba => baz
      }
      
      # good
      {
        :foo => bar,
        :ba  => baz
      }

      Example: EnforcedColonStyle: key (default)

      # bad
      {
        foo: bar,
         ba: baz
      }
      {
        foo: bar,
        ba:  baz
      }
      
      # good
      {
        foo: bar,
        ba: baz
      }

      Example: EnforcedColonStyle: separator

      # bad
      {
        foo: bar,
        ba: baz
      }
      
      # good
      {
        foo: bar,
         ba: baz
      }

      Example: EnforcedColonStyle: table

      # bad
      {
        foo: bar,
        ba: baz
      }
      
      # good
      {
        foo: bar,
        ba:  baz
      }

      Example: EnforcedLastArgumentHashStyle: always_inspect (default)

      # Inspect both implicit and explicit hashes.
      
      # bad
      do_something(foo: 1,
        bar: 2)
      
      # bad
      do_something({foo: 1,
        bar: 2})
      
      # good
      do_something(foo: 1,
                   bar: 2)
      
      # good
      do_something(
        foo: 1,
        bar: 2
      )
      
      # good
      do_something({foo: 1,
                    bar: 2})
      
      # good
      do_something({
        foo: 1,
        bar: 2
      })

      Example: EnforcedLastArgumentHashStyle: always_ignore

      # Ignore both implicit and explicit hashes.
      
      # good
      do_something(foo: 1,
        bar: 2)
      
      # good
      do_something({foo: 1,
        bar: 2})

      Example: EnforcedLastArgumentHashStyle: ignore_implicit

      # Ignore only implicit hashes.
      
      # bad
      do_something({foo: 1,
        bar: 2})
      
      # good
      do_something(foo: 1,
        bar: 2)

      Example: EnforcedLastArgumentHashStyle: ignore_explicit

      # Ignore only explicit hashes.
      
      # bad
      do_something(foo: 1,
        bar: 2)
      
      # good
      do_something({foo: 1,
        bar: 2})

      Add empty line after guard clause.
      Open

          return unless checked_in_by_id.present?
      Severity: Minor
      Found in app/models/questionnaire.rb by rubocop

      This cop enforces empty line after guard clause

      Example:

      # bad
      def foo
        return if need_return?
        bar
      end
      
      # good
      def foo
        return if need_return?
      
        bar
      end
      
      # good
      def foo
        return if something?
        return if something_different?
      
        bar
      end
      
      # also good
      def foo
        if something?
          do_something
          return if need_return?
        end
      end

      Align the elements of a hash literal if they span more than one line.
      Open

          "design"      => "Design",
      Severity: Minor
      Found in app/models/questionnaire.rb by rubocop

      Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration. The configuration options are:

      - key (left align keys, one space before hash rockets and values)
      - separator (align hash rockets and colons, right align keys)
      - table (left align keys, hash rockets, and values)

      The treatment of hashes passed as the last argument to a method call can also be configured. The options are:

      - always_inspect
      - always_ignore
      - ignore_implicit (without curly braces)
      - ignore_explicit (with curly braces)

      Example: EnforcedHashRocketStyle: key (default)

      # bad
      {
        :foo => bar,
         :ba => baz
      }
      {
        :foo => bar,
        :ba  => baz
      }
      
      # good
      {
        :foo => bar,
        :ba => baz
      }

      Example: EnforcedHashRocketStyle: separator

      # bad
      {
        :foo => bar,
        :ba => baz
      }
      {
        :foo => bar,
        :ba  => baz
      }
      
      # good
      {
        :foo => bar,
         :ba => baz
      }

      Example: EnforcedHashRocketStyle: table

      # bad
      {
        :foo => bar,
         :ba => baz
      }
      
      # good
      {
        :foo => bar,
        :ba  => baz
      }

      Example: EnforcedColonStyle: key (default)

      # bad
      {
        foo: bar,
         ba: baz
      }
      {
        foo: bar,
        ba:  baz
      }
      
      # good
      {
        foo: bar,
        ba: baz
      }

      Example: EnforcedColonStyle: separator

      # bad
      {
        foo: bar,
        ba: baz
      }
      
      # good
      {
        foo: bar,
         ba: baz
      }

      Example: EnforcedColonStyle: table

      # bad
      {
        foo: bar,
        ba: baz
      }
      
      # good
      {
        foo: bar,
        ba:  baz
      }

      Example: EnforcedLastArgumentHashStyle: always_inspect (default)

      # Inspect both implicit and explicit hashes.
      
      # bad
      do_something(foo: 1,
        bar: 2)
      
      # bad
      do_something({foo: 1,
        bar: 2})
      
      # good
      do_something(foo: 1,
                   bar: 2)
      
      # good
      do_something(
        foo: 1,
        bar: 2
      )
      
      # good
      do_something({foo: 1,
                    bar: 2})
      
      # good
      do_something({
        foo: 1,
        bar: 2
      })

      Example: EnforcedLastArgumentHashStyle: always_ignore

      # Ignore both implicit and explicit hashes.
      
      # good
      do_something(foo: 1,
        bar: 2)
      
      # good
      do_something({foo: 1,
        bar: 2})

      Example: EnforcedLastArgumentHashStyle: ignore_implicit

      # Ignore only implicit hashes.
      
      # bad
      do_something({foo: 1,
        bar: 2})
      
      # good
      do_something(foo: 1,
        bar: 2)

      Example: EnforcedLastArgumentHashStyle: ignore_explicit

      # Ignore only explicit hashes.
      
      # bad
      do_something(foo: 1,
        bar: 2)
      
      # good
      do_something({foo: 1,
        bar: 2})

      Align the elements of a hash literal if they span more than one line.
      Open

          "software"    => "Software",
      Severity: Minor
      Found in app/models/questionnaire.rb by rubocop

      Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration. The configuration options are:

      - key (left align keys, one space before hash rockets and values)
      - separator (align hash rockets and colons, right align keys)
      - table (left align keys, hash rockets, and values)

      The treatment of hashes passed as the last argument to a method call can also be configured. The options are:

      - always_inspect
      - always_ignore
      - ignore_implicit (without curly braces)
      - ignore_explicit (with curly braces)

      Example: EnforcedHashRocketStyle: key (default)

      # bad
      {
        :foo => bar,
         :ba => baz
      }
      {
        :foo => bar,
        :ba  => baz
      }
      
      # good
      {
        :foo => bar,
        :ba => baz
      }

      Example: EnforcedHashRocketStyle: separator

      # bad
      {
        :foo => bar,
        :ba => baz
      }
      {
        :foo => bar,
        :ba  => baz
      }
      
      # good
      {
        :foo => bar,
         :ba => baz
      }

      Example: EnforcedHashRocketStyle: table

      # bad
      {
        :foo => bar,
         :ba => baz
      }
      
      # good
      {
        :foo => bar,
        :ba  => baz
      }

      Example: EnforcedColonStyle: key (default)

      # bad
      {
        foo: bar,
         ba: baz
      }
      {
        foo: bar,
        ba:  baz
      }
      
      # good
      {
        foo: bar,
        ba: baz
      }

      Example: EnforcedColonStyle: separator

      # bad
      {
        foo: bar,
        ba: baz
      }
      
      # good
      {
        foo: bar,
         ba: baz
      }

      Example: EnforcedColonStyle: table

      # bad
      {
        foo: bar,
        ba: baz
      }
      
      # good
      {
        foo: bar,
        ba:  baz
      }

      Example: EnforcedLastArgumentHashStyle: always_inspect (default)

      # Inspect both implicit and explicit hashes.
      
      # bad
      do_something(foo: 1,
        bar: 2)
      
      # bad
      do_something({foo: 1,
        bar: 2})
      
      # good
      do_something(foo: 1,
                   bar: 2)
      
      # good
      do_something(
        foo: 1,
        bar: 2
      )
      
      # good
      do_something({foo: 1,
                    bar: 2})
      
      # good
      do_something({
        foo: 1,
        bar: 2
      })

      Example: EnforcedLastArgumentHashStyle: always_ignore

      # Ignore both implicit and explicit hashes.
      
      # good
      do_something(foo: 1,
        bar: 2)
      
      # good
      do_something({foo: 1,
        bar: 2})

      Example: EnforcedLastArgumentHashStyle: ignore_implicit

      # Ignore only implicit hashes.
      
      # bad
      do_something({foo: 1,
        bar: 2})
      
      # good
      do_something(foo: 1,
        bar: 2)

      Example: EnforcedLastArgumentHashStyle: ignore_explicit

      # Ignore only explicit hashes.
      
      # bad
      do_something(foo: 1,
        bar: 2)
      
      # good
      do_something({foo: 1,
        bar: 2})

      Align the elements of a hash literal if they span more than one line.
      Open

          "hardware"    => "Hardware",
      Severity: Minor
      Found in app/models/questionnaire.rb by rubocop

      Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration. The configuration options are:

      - key (left align keys, one space before hash rockets and values)
      - separator (align hash rockets and colons, right align keys)
      - table (left align keys, hash rockets, and values)

      The treatment of hashes passed as the last argument to a method call can also be configured. The options are:

      - always_inspect
      - always_ignore
      - ignore_implicit (without curly braces)
      - ignore_explicit (with curly braces)

      Example: EnforcedHashRocketStyle: key (default)

      # bad
      {
        :foo => bar,
         :ba => baz
      }
      {
        :foo => bar,
        :ba  => baz
      }
      
      # good
      {
        :foo => bar,
        :ba => baz
      }

      Example: EnforcedHashRocketStyle: separator

      # bad
      {
        :foo => bar,
        :ba => baz
      }
      {
        :foo => bar,
        :ba  => baz
      }
      
      # good
      {
        :foo => bar,
         :ba => baz
      }

      Example: EnforcedHashRocketStyle: table

      # bad
      {
        :foo => bar,
         :ba => baz
      }
      
      # good
      {
        :foo => bar,
        :ba  => baz
      }

      Example: EnforcedColonStyle: key (default)

      # bad
      {
        foo: bar,
         ba: baz
      }
      {
        foo: bar,
        ba:  baz
      }
      
      # good
      {
        foo: bar,
        ba: baz
      }

      Example: EnforcedColonStyle: separator

      # bad
      {
        foo: bar,
        ba: baz
      }
      
      # good
      {
        foo: bar,
         ba: baz
      }

      Example: EnforcedColonStyle: table

      # bad
      {
        foo: bar,
        ba: baz
      }
      
      # good
      {
        foo: bar,
        ba:  baz
      }

      Example: EnforcedLastArgumentHashStyle: always_inspect (default)

      # Inspect both implicit and explicit hashes.
      
      # bad
      do_something(foo: 1,
        bar: 2)
      
      # bad
      do_something({foo: 1,
        bar: 2})
      
      # good
      do_something(foo: 1,
                   bar: 2)
      
      # good
      do_something(
        foo: 1,
        bar: 2
      )
      
      # good
      do_something({foo: 1,
                    bar: 2})
      
      # good
      do_something({
        foo: 1,
        bar: 2
      })

      Example: EnforcedLastArgumentHashStyle: always_ignore

      # Ignore both implicit and explicit hashes.
      
      # good
      do_something(foo: 1,
        bar: 2)
      
      # good
      do_something({foo: 1,
        bar: 2})

      Example: EnforcedLastArgumentHashStyle: ignore_implicit

      # Ignore only implicit hashes.
      
      # bad
      do_something({foo: 1,
        bar: 2})
      
      # good
      do_something(foo: 1,
        bar: 2)

      Example: EnforcedLastArgumentHashStyle: ignore_explicit

      # Ignore only explicit hashes.
      
      # bad
      do_something(foo: 1,
        bar: 2)
      
      # good
      do_something({foo: 1,
        bar: 2})

      Align the elements of a hash literal if they span more than one line.
      Open

          "accepted"       => "Accepted",
      Severity: Minor
      Found in app/models/questionnaire.rb by rubocop

      Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration. The configuration options are:

      - key (left align keys, one space before hash rockets and values)
      - separator (align hash rockets and colons, right align keys)
      - table (left align keys, hash rockets, and values)

      The treatment of hashes passed as the last argument to a method call can also be configured. The options are:

      - always_inspect
      - always_ignore
      - ignore_implicit (without curly braces)
      - ignore_explicit (with curly braces)

      Example: EnforcedHashRocketStyle: key (default)

      # bad
      {
        :foo => bar,
         :ba => baz
      }
      {
        :foo => bar,
        :ba  => baz
      }
      
      # good
      {
        :foo => bar,
        :ba => baz
      }

      Example: EnforcedHashRocketStyle: separator

      # bad
      {
        :foo => bar,
        :ba => baz
      }
      {
        :foo => bar,
        :ba  => baz
      }
      
      # good
      {
        :foo => bar,
         :ba => baz
      }

      Example: EnforcedHashRocketStyle: table

      # bad
      {
        :foo => bar,
         :ba => baz
      }
      
      # good
      {
        :foo => bar,
        :ba  => baz
      }

      Example: EnforcedColonStyle: key (default)

      # bad
      {
        foo: bar,
         ba: baz
      }
      {
        foo: bar,
        ba:  baz
      }
      
      # good
      {
        foo: bar,
        ba: baz
      }

      Example: EnforcedColonStyle: separator

      # bad
      {
        foo: bar,
        ba: baz
      }
      
      # good
      {
        foo: bar,
         ba: baz
      }

      Example: EnforcedColonStyle: table

      # bad
      {
        foo: bar,
        ba: baz
      }
      
      # good
      {
        foo: bar,
        ba:  baz
      }

      Example: EnforcedLastArgumentHashStyle: always_inspect (default)

      # Inspect both implicit and explicit hashes.
      
      # bad
      do_something(foo: 1,
        bar: 2)
      
      # bad
      do_something({foo: 1,
        bar: 2})
      
      # good
      do_something(foo: 1,
                   bar: 2)
      
      # good
      do_something(
        foo: 1,
        bar: 2
      )
      
      # good
      do_something({foo: 1,
                    bar: 2})
      
      # good
      do_something({
        foo: 1,
        bar: 2
      })

      Example: EnforcedLastArgumentHashStyle: always_ignore

      # Ignore both implicit and explicit hashes.
      
      # good
      do_something(foo: 1,
        bar: 2)
      
      # good
      do_something({foo: 1,
        bar: 2})

      Example: EnforcedLastArgumentHashStyle: ignore_implicit

      # Ignore only implicit hashes.
      
      # bad
      do_something({foo: 1,
        bar: 2})
      
      # good
      do_something(foo: 1,
        bar: 2)

      Example: EnforcedLastArgumentHashStyle: ignore_explicit

      # Ignore only explicit hashes.
      
      # bad
      do_something(foo: 1,
        bar: 2)
      
      # good
      do_something({foo: 1,
        bar: 2})

      Align the elements of a hash literal if they span more than one line.
      Open

          "waitlist"       => "Waitlisted",
      Severity: Minor
      Found in app/models/questionnaire.rb by rubocop

      Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration. The configuration options are:

      - key (left align keys, one space before hash rockets and values)
      - separator (align hash rockets and colons, right align keys)
      - table (left align keys, hash rockets, and values)

      The treatment of hashes passed as the last argument to a method call can also be configured. The options are:

      - always_inspect
      - always_ignore
      - ignore_implicit (without curly braces)
      - ignore_explicit (with curly braces)

      Example: EnforcedHashRocketStyle: key (default)

      # bad
      {
        :foo => bar,
         :ba => baz
      }
      {
        :foo => bar,
        :ba  => baz
      }
      
      # good
      {
        :foo => bar,
        :ba => baz
      }

      Example: EnforcedHashRocketStyle: separator

      # bad
      {
        :foo => bar,
        :ba => baz
      }
      {
        :foo => bar,
        :ba  => baz
      }
      
      # good
      {
        :foo => bar,
         :ba => baz
      }

      Example: EnforcedHashRocketStyle: table

      # bad
      {
        :foo => bar,
         :ba => baz
      }
      
      # good
      {
        :foo => bar,
        :ba  => baz
      }

      Example: EnforcedColonStyle: key (default)

      # bad
      {
        foo: bar,
         ba: baz
      }
      {
        foo: bar,
        ba:  baz
      }
      
      # good
      {
        foo: bar,
        ba: baz
      }

      Example: EnforcedColonStyle: separator

      # bad
      {
        foo: bar,
        ba: baz
      }
      
      # good
      {
        foo: bar,
         ba: baz
      }

      Example: EnforcedColonStyle: table

      # bad
      {
        foo: bar,
        ba: baz
      }
      
      # good
      {
        foo: bar,
        ba:  baz
      }

      Example: EnforcedLastArgumentHashStyle: always_inspect (default)

      # Inspect both implicit and explicit hashes.
      
      # bad
      do_something(foo: 1,
        bar: 2)
      
      # bad
      do_something({foo: 1,
        bar: 2})
      
      # good
      do_something(foo: 1,
                   bar: 2)
      
      # good
      do_something(
        foo: 1,
        bar: 2
      )
      
      # good
      do_something({foo: 1,
                    bar: 2})
      
      # good
      do_something({
        foo: 1,
        bar: 2
      })

      Example: EnforcedLastArgumentHashStyle: always_ignore

      # Ignore both implicit and explicit hashes.
      
      # good
      do_something(foo: 1,
        bar: 2)
      
      # good
      do_something({foo: 1,
        bar: 2})

      Example: EnforcedLastArgumentHashStyle: ignore_implicit

      # Ignore only implicit hashes.
      
      # bad
      do_something({foo: 1,
        bar: 2})
      
      # good
      do_something(foo: 1,
        bar: 2)

      Example: EnforcedLastArgumentHashStyle: ignore_explicit

      # Ignore only explicit hashes.
      
      # bad
      do_something(foo: 1,
        bar: 2)
      
      # good
      do_something({foo: 1,
        bar: 2})

      Align the elements of a hash literal if they span more than one line.
      Open

          "expert"      => "I'm a veteran hacker. (6+ hackathons)"
      Severity: Minor
      Found in app/models/questionnaire.rb by rubocop

      Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration. The configuration options are:

      - key (left align keys, one space before hash rockets and values)
      - separator (align hash rockets and colons, right align keys)
      - table (left align keys, hash rockets, and values)

      The treatment of hashes passed as the last argument to a method call can also be configured. The options are:

      - always_inspect
      - always_ignore
      - ignore_implicit (without curly braces)
      - ignore_explicit (with curly braces)

      Example: EnforcedHashRocketStyle: key (default)

      # bad
      {
        :foo => bar,
         :ba => baz
      }
      {
        :foo => bar,
        :ba  => baz
      }
      
      # good
      {
        :foo => bar,
        :ba => baz
      }

      Example: EnforcedHashRocketStyle: separator

      # bad
      {
        :foo => bar,
        :ba => baz
      }
      {
        :foo => bar,
        :ba  => baz
      }
      
      # good
      {
        :foo => bar,
         :ba => baz
      }

      Example: EnforcedHashRocketStyle: table

      # bad
      {
        :foo => bar,
         :ba => baz
      }
      
      # good
      {
        :foo => bar,
        :ba  => baz
      }

      Example: EnforcedColonStyle: key (default)

      # bad
      {
        foo: bar,
         ba: baz
      }
      {
        foo: bar,
        ba:  baz
      }
      
      # good
      {
        foo: bar,
        ba: baz
      }

      Example: EnforcedColonStyle: separator

      # bad
      {
        foo: bar,
        ba: baz
      }
      
      # good
      {
        foo: bar,
         ba: baz
      }

      Example: EnforcedColonStyle: table

      # bad
      {
        foo: bar,
        ba: baz
      }
      
      # good
      {
        foo: bar,
        ba:  baz
      }

      Example: EnforcedLastArgumentHashStyle: always_inspect (default)

      # Inspect both implicit and explicit hashes.
      
      # bad
      do_something(foo: 1,
        bar: 2)
      
      # bad
      do_something({foo: 1,
        bar: 2})
      
      # good
      do_something(foo: 1,
                   bar: 2)
      
      # good
      do_something(
        foo: 1,
        bar: 2
      )
      
      # good
      do_something({foo: 1,
                    bar: 2})
      
      # good
      do_something({
        foo: 1,
        bar: 2
      })

      Example: EnforcedLastArgumentHashStyle: always_ignore

      # Ignore both implicit and explicit hashes.
      
      # good
      do_something(foo: 1,
        bar: 2)
      
      # good
      do_something({foo: 1,
        bar: 2})

      Example: EnforcedLastArgumentHashStyle: ignore_implicit

      # Ignore only implicit hashes.
      
      # bad
      do_something({foo: 1,
        bar: 2})
      
      # good
      do_something(foo: 1,
        bar: 2)

      Example: EnforcedLastArgumentHashStyle: ignore_explicit

      # Ignore only explicit hashes.
      
      # bad
      do_something(foo: 1,
        bar: 2)
      
      # good
      do_something({foo: 1,
        bar: 2})

      Align the elements of a hash literal if they span more than one line.
      Open

          "denied"         => "Denied",
      Severity: Minor
      Found in app/models/questionnaire.rb by rubocop

      Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration. The configuration options are:

      - key (left align keys, one space before hash rockets and values)
      - separator (align hash rockets and colons, right align keys)
      - table (left align keys, hash rockets, and values)

      The treatment of hashes passed as the last argument to a method call can also be configured. The options are:

      - always_inspect
      - always_ignore
      - ignore_implicit (without curly braces)
      - ignore_explicit (with curly braces)

      Example: EnforcedHashRocketStyle: key (default)

      # bad
      {
        :foo => bar,
         :ba => baz
      }
      {
        :foo => bar,
        :ba  => baz
      }
      
      # good
      {
        :foo => bar,
        :ba => baz
      }

      Example: EnforcedHashRocketStyle: separator

      # bad
      {
        :foo => bar,
        :ba => baz
      }
      {
        :foo => bar,
        :ba  => baz
      }
      
      # good
      {
        :foo => bar,
         :ba => baz
      }

      Example: EnforcedHashRocketStyle: table

      # bad
      {
        :foo => bar,
         :ba => baz
      }
      
      # good
      {
        :foo => bar,
        :ba  => baz
      }

      Example: EnforcedColonStyle: key (default)

      # bad
      {
        foo: bar,
         ba: baz
      }
      {
        foo: bar,
        ba:  baz
      }
      
      # good
      {
        foo: bar,
        ba: baz
      }

      Example: EnforcedColonStyle: separator

      # bad
      {
        foo: bar,
        ba: baz
      }
      
      # good
      {
        foo: bar,
         ba: baz
      }

      Example: EnforcedColonStyle: table

      # bad
      {
        foo: bar,
        ba: baz
      }
      
      # good
      {
        foo: bar,
        ba:  baz
      }

      Example: EnforcedLastArgumentHashStyle: always_inspect (default)

      # Inspect both implicit and explicit hashes.
      
      # bad
      do_something(foo: 1,
        bar: 2)
      
      # bad
      do_something({foo: 1,
        bar: 2})
      
      # good
      do_something(foo: 1,
                   bar: 2)
      
      # good
      do_something(
        foo: 1,
        bar: 2
      )
      
      # good
      do_something({foo: 1,
                    bar: 2})
      
      # good
      do_something({
        foo: 1,
        bar: 2
      })

      Example: EnforcedLastArgumentHashStyle: always_ignore

      # Ignore both implicit and explicit hashes.
      
      # good
      do_something(foo: 1,
        bar: 2)
      
      # good
      do_something({foo: 1,
        bar: 2})

      Example: EnforcedLastArgumentHashStyle: ignore_implicit

      # Ignore only implicit hashes.
      
      # bad
      do_something({foo: 1,
        bar: 2})
      
      # good
      do_something(foo: 1,
        bar: 2)

      Example: EnforcedLastArgumentHashStyle: ignore_explicit

      # Ignore only explicit hashes.
      
      # bad
      do_something(foo: 1,
        bar: 2)
      
      # good
      do_something({foo: 1,
        bar: 2})

      Align the elements of a hash literal if they span more than one line.
      Open

          "rsvp_denied"    => "RSVP Denied"
      Severity: Minor
      Found in app/models/questionnaire.rb by rubocop

      Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration. The configuration options are:

      - key (left align keys, one space before hash rockets and values)
      - separator (align hash rockets and colons, right align keys)
      - table (left align keys, hash rockets, and values)

      The treatment of hashes passed as the last argument to a method call can also be configured. The options are:

      - always_inspect
      - always_ignore
      - ignore_implicit (without curly braces)
      - ignore_explicit (with curly braces)

      Example: EnforcedHashRocketStyle: key (default)

      # bad
      {
        :foo => bar,
         :ba => baz
      }
      {
        :foo => bar,
        :ba  => baz
      }
      
      # good
      {
        :foo => bar,
        :ba => baz
      }

      Example: EnforcedHashRocketStyle: separator

      # bad
      {
        :foo => bar,
        :ba => baz
      }
      {
        :foo => bar,
        :ba  => baz
      }
      
      # good
      {
        :foo => bar,
         :ba => baz
      }

      Example: EnforcedHashRocketStyle: table

      # bad
      {
        :foo => bar,
         :ba => baz
      }
      
      # good
      {
        :foo => bar,
        :ba  => baz
      }

      Example: EnforcedColonStyle: key (default)

      # bad
      {
        foo: bar,
         ba: baz
      }
      {
        foo: bar,
        ba:  baz
      }
      
      # good
      {
        foo: bar,
        ba: baz
      }

      Example: EnforcedColonStyle: separator

      # bad
      {
        foo: bar,
        ba: baz
      }
      
      # good
      {
        foo: bar,
         ba: baz
      }

      Example: EnforcedColonStyle: table

      # bad
      {
        foo: bar,
        ba: baz
      }
      
      # good
      {
        foo: bar,
        ba:  baz
      }

      Example: EnforcedLastArgumentHashStyle: always_inspect (default)

      # Inspect both implicit and explicit hashes.
      
      # bad
      do_something(foo: 1,
        bar: 2)
      
      # bad
      do_something({foo: 1,
        bar: 2})
      
      # good
      do_something(foo: 1,
                   bar: 2)
      
      # good
      do_something(
        foo: 1,
        bar: 2
      )
      
      # good
      do_something({foo: 1,
                    bar: 2})
      
      # good
      do_something({
        foo: 1,
        bar: 2
      })

      Example: EnforcedLastArgumentHashStyle: always_ignore

      # Ignore both implicit and explicit hashes.
      
      # good
      do_something(foo: 1,
        bar: 2)
      
      # good
      do_something({foo: 1,
        bar: 2})

      Example: EnforcedLastArgumentHashStyle: ignore_implicit

      # Ignore only implicit hashes.
      
      # bad
      do_something({foo: 1,
        bar: 2})
      
      # good
      do_something(foo: 1,
        bar: 2)

      Example: EnforcedLastArgumentHashStyle: ignore_explicit

      # Ignore only explicit hashes.
      
      # bad
      do_something(foo: 1,
        bar: 2)
      
      # good
      do_something({foo: 1,
        bar: 2})

      Add empty line after guard clause.
      Open

          return if school.blank?
      Severity: Minor
      Found in app/models/questionnaire.rb by rubocop

      This cop enforces empty line after guard clause

      Example:

      # bad
      def foo
        return if need_return?
        bar
      end
      
      # good
      def foo
        return if need_return?
      
        bar
      end
      
      # good
      def foo
        return if something?
        return if something_different?
      
        bar
      end
      
      # also good
      def foo
        if something?
          do_something
          return if need_return?
        end
      end

      Add empty line after guard clause.
      Open

          return unless acc_status_author_id.present?
      Severity: Minor
      Found in app/models/questionnaire.rb by rubocop

      This cop enforces empty line after guard clause

      Example:

      # bad
      def foo
        return if need_return?
        bar
      end
      
      # good
      def foo
        return if need_return?
      
        bar
      end
      
      # good
      def foo
        return if something?
        return if something_different?
      
        bar
      end
      
      # also good
      def foo
        if something?
          do_something
          return if need_return?
        end
      end

      Align the elements of a hash literal if they span more than one line.
      Open

          "pending"        => "Pending Review",
      Severity: Minor
      Found in app/models/questionnaire.rb by rubocop

      Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration. The configuration options are:

      - key (left align keys, one space before hash rockets and values)
      - separator (align hash rockets and colons, right align keys)
      - table (left align keys, hash rockets, and values)

      The treatment of hashes passed as the last argument to a method call can also be configured. The options are:

      - always_inspect
      - always_ignore
      - ignore_implicit (without curly braces)
      - ignore_explicit (with curly braces)

      Example: EnforcedHashRocketStyle: key (default)

      # bad
      {
        :foo => bar,
         :ba => baz
      }
      {
        :foo => bar,
        :ba  => baz
      }
      
      # good
      {
        :foo => bar,
        :ba => baz
      }

      Example: EnforcedHashRocketStyle: separator

      # bad
      {
        :foo => bar,
        :ba => baz
      }
      {
        :foo => bar,
        :ba  => baz
      }
      
      # good
      {
        :foo => bar,
         :ba => baz
      }

      Example: EnforcedHashRocketStyle: table

      # bad
      {
        :foo => bar,
         :ba => baz
      }
      
      # good
      {
        :foo => bar,
        :ba  => baz
      }

      Example: EnforcedColonStyle: key (default)

      # bad
      {
        foo: bar,
         ba: baz
      }
      {
        foo: bar,
        ba:  baz
      }
      
      # good
      {
        foo: bar,
        ba: baz
      }

      Example: EnforcedColonStyle: separator

      # bad
      {
        foo: bar,
        ba: baz
      }
      
      # good
      {
        foo: bar,
         ba: baz
      }

      Example: EnforcedColonStyle: table

      # bad
      {
        foo: bar,
        ba: baz
      }
      
      # good
      {
        foo: bar,
        ba:  baz
      }

      Example: EnforcedLastArgumentHashStyle: always_inspect (default)

      # Inspect both implicit and explicit hashes.
      
      # bad
      do_something(foo: 1,
        bar: 2)
      
      # bad
      do_something({foo: 1,
        bar: 2})
      
      # good
      do_something(foo: 1,
                   bar: 2)
      
      # good
      do_something(
        foo: 1,
        bar: 2
      )
      
      # good
      do_something({foo: 1,
                    bar: 2})
      
      # good
      do_something({
        foo: 1,
        bar: 2
      })

      Example: EnforcedLastArgumentHashStyle: always_ignore

      # Ignore both implicit and explicit hashes.
      
      # good
      do_something(foo: 1,
        bar: 2)
      
      # good
      do_something({foo: 1,
        bar: 2})

      Example: EnforcedLastArgumentHashStyle: ignore_implicit

      # Ignore only implicit hashes.
      
      # bad
      do_something({foo: 1,
        bar: 2})
      
      # good
      do_something(foo: 1,
        bar: 2)

      Example: EnforcedLastArgumentHashStyle: ignore_explicit

      # Ignore only explicit hashes.
      
      # bad
      do_something(foo: 1,
        bar: 2)
      
      # good
      do_something({foo: 1,
        bar: 2})

      Add empty line after guard clause.
      Open

          return if duplicate.blank?
      Severity: Minor
      Found in app/models/questionnaire.rb by rubocop

      This cop enforces empty line after guard clause

      Example:

      # bad
      def foo
        return if need_return?
        bar
      end
      
      # good
      def foo
        return if need_return?
      
        bar
      end
      
      # good
      def foo
        return if something?
        return if something_different?
      
        bar
      end
      
      # also good
      def foo
        if something?
          do_something
          return if need_return?
        end
      end

      There are no issues that match your filters.

      Category
      Status