lawrencechanyewlong/wherewolfpro

View on GitHub
app/controllers/event_controller.rb

Summary

Maintainability
D
2 days
Test Coverage

Class has too many lines. [341/100]
Open

class EventController < ApplicationController
  attr_accessor :latlng
  attr_accessor :formatted_address
  #attr_accessor :latitud
  #attr_accessor :longitud
Severity: Minor
Found in app/controllers/event_controller.rb by rubocop

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Assignment Branch Condition size for user_map is too high. [79.71/15]
Open

  def user_map
    
    def parseDurationToCheckCondition(d)
      # return true if condition is met and stop tracking, else return false if keep tracking
      if d == 'arrive'
Severity: Minor
Found in app/controllers/event_controller.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Assignment Branch Condition size for select_contacts is too high. [69.06/15]
Open

  def select_contacts
    user = User.where(:id => session[:id]).take
    if user
      @receiver_all = []
      @receiver_name_all = []
Severity: Minor
Found in app/controllers/event_controller.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Method has too many lines. [53/10]
Open

  def select_contacts
    user = User.where(:id => session[:id]).take
    if user
      @receiver_all = []
      @receiver_name_all = []
Severity: Minor
Found in app/controllers/event_controller.rb by rubocop

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 has too many lines. [47/10]
Open

  def user_map
    
    def parseDurationToCheckCondition(d)
      # return true if condition is met and stop tracking, else return false if keep tracking
      if d == 'arrive'
Severity: Minor
Found in app/controllers/event_controller.rb by rubocop

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.

Assignment Branch Condition size for summary is too high. [52.56/15]
Open

  def summary
    
    def parseDuration(d)
      if d
        if d == 'arrive'
Severity: Minor
Found in app/controllers/event_controller.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Assignment Branch Condition size for send_mail is too high. [50.26/15]
Open

  def send_mail
    gmail = Gmail.new('woofwhere', 'battle431101')
    if session[:id]
      user = User.find_by id: session[:id]
      if user
Severity: Minor
Found in app/controllers/event_controller.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Assignment Branch Condition size for parseDurationToCheckCondition is too high. [48.76/15]
Open

    def parseDurationToCheckCondition(d)
      # return true if condition is met and stop tracking, else return false if keep tracking
      if d == 'arrive'
        # print "\n Inside d=='arrive' \n"
        # print @event.current_lat, @event.current_lng
Severity: Minor
Found in app/controllers/event_controller.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Method select_contacts has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

  def select_contacts
    user = User.where(:id => session[:id]).take
    if user
      @receiver_all = []
      @receiver_name_all = []
Severity: Minor
Found in app/controllers/event_controller.rb - About 5 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method has too many lines. [39/10]
Open

  def send_mail
    gmail = Gmail.new('woofwhere', 'battle431101')
    if session[:id]
      user = User.find_by id: session[:id]
      if user
Severity: Minor
Found in app/controllers/event_controller.rb by rubocop

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.

File event_controller.rb has 343 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class EventController < ApplicationController
  attr_accessor :latlng
  attr_accessor :formatted_address
  #attr_accessor :latitud
  #attr_accessor :longitud
Severity: Minor
Found in app/controllers/event_controller.rb - About 4 hrs to fix

    Assignment Branch Condition size for store_event is too high. [34.73/15]
    Open

      def store_event
        if params[:eid]
          @eid = params[:eid]
          @event = Event.where(id: @eid.to_i).first
          logger.debug "event: #{@event.inspect}"
    Severity: Minor
    Found in app/controllers/event_controller.rb by rubocop

    This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

    Method has too many lines. [28/10]
    Open

      def summary
        
        def parseDuration(d)
          if d
            if d == 'arrive'
    Severity: Minor
    Found in app/controllers/event_controller.rb by rubocop

    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.

    Assignment Branch Condition size for store_duration is too high. [32.34/15]
    Open

      def store_duration
        logger.debug params.inspect
        if params[:arrive]
          @duration = 'arrive'
        elsif params[:until_this_time] != '0'
    Severity: Minor
    Found in app/controllers/event_controller.rb by rubocop

    This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

    Assignment Branch Condition size for store_contacts is too high. [31.46/15]
    Open

      def store_contacts
        logger.debug "In store_contacts"
        logger.debug params.inspect
        puts "HELLO"
        @receiver = ''
    Severity: Minor
    Found in app/controllers/event_controller.rb by rubocop

    This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

    Method has too many lines. [24/10]
    Open

      def store_duration
        logger.debug params.inspect
        if params[:arrive]
          @duration = 'arrive'
        elsif params[:until_this_time] != '0'
    Severity: Minor
    Found in app/controllers/event_controller.rb by rubocop

    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.

    Perceived complexity for select_contacts is too high. [20/7]
    Open

      def select_contacts
        user = User.where(:id => session[:id]).take
        if user
          @receiver_all = []
          @receiver_name_all = []
    Severity: Minor
    Found in app/controllers/event_controller.rb by rubocop

    This cop tries to produce a complexity score that's a measure of the complexity the reader experiences when looking at a method. For that reason it considers when nodes as something that doesn't add as much complexity as an if or a &&. Except if it's one of those special case/when constructs where there's no expression after case. Then the cop treats it as an if/elsif/elsif... and lets all the when nodes count. In contrast to the CyclomaticComplexity cop, this cop considers else nodes as adding complexity.

    Example:

    def my_method                   # 1
      if cond                       # 1
        case var                    # 2 (0.8 + 4 * 0.2, rounded)
        when 1 then func_one
        when 2 then func_two
        when 3 then func_three
        when 4..10 then func_other
        end
      else                          # 1
        do_something until a && b   # 2
      end                           # ===
    end                             # 7 complexity points

    Assignment Branch Condition size for create_event is too high. [26.08/15]
    Open

      def create_event
        @event = Event.create!(
            :uid => session[:uid],
            :address_lat => session[:address_lat],
            :address_lng => session[:address_lng],
    Severity: Minor
    Found in app/controllers/event_controller.rb by rubocop

    This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

    Method has too many lines. [20/10]
    Open

      def store_contacts
        logger.debug "In store_contacts"
        logger.debug params.inspect
        puts "HELLO"
        @receiver = ''
    Severity: Minor
    Found in app/controllers/event_controller.rb by rubocop

    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 has too many lines. [20/10]
    Open

        def parseDurationToCheckCondition(d)
          # return true if condition is met and stop tracking, else return false if keep tracking
          if d == 'arrive'
            # print "\n Inside d=='arrive' \n"
            # print @event.current_lat, @event.current_lng
    Severity: Minor
    Found in app/controllers/event_controller.rb by rubocop

    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.

    Perceived complexity for user_map is too high. [16/7]
    Open

      def user_map
        
        def parseDurationToCheckCondition(d)
          # return true if condition is met and stop tracking, else return false if keep tracking
          if d == 'arrive'
    Severity: Minor
    Found in app/controllers/event_controller.rb by rubocop

    This cop tries to produce a complexity score that's a measure of the complexity the reader experiences when looking at a method. For that reason it considers when nodes as something that doesn't add as much complexity as an if or a &&. Except if it's one of those special case/when constructs where there's no expression after case. Then the cop treats it as an if/elsif/elsif... and lets all the when nodes count. In contrast to the CyclomaticComplexity cop, this cop considers else nodes as adding complexity.

    Example:

    def my_method                   # 1
      if cond                       # 1
        case var                    # 2 (0.8 + 4 * 0.2, rounded)
        when 1 then func_one
        when 2 then func_two
        when 3 then func_three
        when 4..10 then func_other
        end
      else                          # 1
        do_something until a && b   # 2
      end                           # ===
    end                             # 7 complexity points

    Cyclomatic complexity for select_contacts is too high. [13/6]
    Open

      def select_contacts
        user = User.where(:id => session[:id]).take
        if user
          @receiver_all = []
          @receiver_name_all = []
    Severity: Minor
    Found in app/controllers/event_controller.rb by rubocop

    This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

    An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

    Perceived complexity for summary is too high. [14/7]
    Open

      def summary
        
        def parseDuration(d)
          if d
            if d == 'arrive'
    Severity: Minor
    Found in app/controllers/event_controller.rb by rubocop

    This cop tries to produce a complexity score that's a measure of the complexity the reader experiences when looking at a method. For that reason it considers when nodes as something that doesn't add as much complexity as an if or a &&. Except if it's one of those special case/when constructs where there's no expression after case. Then the cop treats it as an if/elsif/elsif... and lets all the when nodes count. In contrast to the CyclomaticComplexity cop, this cop considers else nodes as adding complexity.

    Example:

    def my_method                   # 1
      if cond                       # 1
        case var                    # 2 (0.8 + 4 * 0.2, rounded)
        when 1 then func_one
        when 2 then func_two
        when 3 then func_three
        when 4..10 then func_other
        end
      else                          # 1
        do_something until a && b   # 2
      end                           # ===
    end                             # 7 complexity points

    Cyclomatic complexity for user_map is too high. [11/6]
    Open

      def user_map
        
        def parseDurationToCheckCondition(d)
          # return true if condition is met and stop tracking, else return false if keep tracking
          if d == 'arrive'
    Severity: Minor
    Found in app/controllers/event_controller.rb by rubocop

    This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

    An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

    Assignment Branch Condition size for message is too high. [20.49/15]
    Open

      def message
        @messagehistory = []
        Event.all.each do |e|
          if not e.message.to_s.empty?
            logger.debug "message: #{e.message}"
    Severity: Minor
    Found in app/controllers/event_controller.rb by rubocop

    This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

    Method has too many lines. [15/10]
    Open

      def create_event
        @event = Event.create!(
            :uid => session[:uid],
            :address_lat => session[:address_lat],
            :address_lng => session[:address_lng],
    Severity: Minor
    Found in app/controllers/event_controller.rb by rubocop

    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.

    Cyclomatic complexity for summary is too high. [10/6]
    Open

      def summary
        
        def parseDuration(d)
          if d
            if d == 'arrive'
    Severity: Minor
    Found in app/controllers/event_controller.rb by rubocop

    This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

    An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

    Method has too many lines. [14/10]
    Open

      def message
        @messagehistory = []
        Event.all.each do |e|
          if not e.message.to_s.empty?
            logger.debug "message: #{e.message}"
    Severity: Minor
    Found in app/controllers/event_controller.rb by rubocop

    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 has too many lines. [14/10]
    Open

      def store_event
        if params[:eid]
          @eid = params[:eid]
          @event = Event.where(id: @eid.to_i).first
          logger.debug "event: #{@event.inspect}"
    Severity: Minor
    Found in app/controllers/event_controller.rb by rubocop

    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 select_contacts has 53 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def select_contacts
        user = User.where(:id => session[:id]).take
        if user
          @receiver_all = []
          @receiver_name_all = []
    Severity: Major
    Found in app/controllers/event_controller.rb - About 2 hrs to fix

      Perceived complexity for store_duration is too high. [10/7]
      Open

        def store_duration
          logger.debug params.inspect
          if params[:arrive]
            @duration = 'arrive'
          elsif params[:until_this_time] != '0'
      Severity: Minor
      Found in app/controllers/event_controller.rb by rubocop

      This cop tries to produce a complexity score that's a measure of the complexity the reader experiences when looking at a method. For that reason it considers when nodes as something that doesn't add as much complexity as an if or a &&. Except if it's one of those special case/when constructs where there's no expression after case. Then the cop treats it as an if/elsif/elsif... and lets all the when nodes count. In contrast to the CyclomaticComplexity cop, this cop considers else nodes as adding complexity.

      Example:

      def my_method                   # 1
        if cond                       # 1
          case var                    # 2 (0.8 + 4 * 0.2, rounded)
          when 1 then func_one
          when 2 then func_two
          when 3 then func_three
          when 4..10 then func_other
          end
        else                          # 1
          do_something until a && b   # 2
        end                           # ===
      end                             # 7 complexity points

      Method has too many lines. [13/10]
      Open

          def parseDuration(d)
            if d
              if d == 'arrive'
                return 'Until I arrive'
              elsif d[d.size-1] == 'm'
      Severity: Minor
      Found in app/controllers/event_controller.rb by rubocop

      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 user_map has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def user_map
          
          def parseDurationToCheckCondition(d)
            # return true if condition is met and stop tracking, else return false if keep tracking
            if d == 'arrive'
      Severity: Minor
      Found in app/controllers/event_controller.rb - About 1 hr to fix

        Method has too many lines. [11/10]
        Open

          def receiver_map
            #@sess = session[:latlong]
            #logger.debug "sess = #{session[:latlong]}"
            id = params[:id]
            if Event.exists?(id: id)
        Severity: Minor
        Found in app/controllers/event_controller.rb by rubocop

        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.

        Perceived complexity for parseDuration is too high. [8/7]
        Open

            def parseDuration(d)
              if d
                if d == 'arrive'
                  return 'Until I arrive'
                elsif d[d.size-1] == 'm'
        Severity: Minor
        Found in app/controllers/event_controller.rb by rubocop

        This cop tries to produce a complexity score that's a measure of the complexity the reader experiences when looking at a method. For that reason it considers when nodes as something that doesn't add as much complexity as an if or a &&. Except if it's one of those special case/when constructs where there's no expression after case. Then the cop treats it as an if/elsif/elsif... and lets all the when nodes count. In contrast to the CyclomaticComplexity cop, this cop considers else nodes as adding complexity.

        Example:

        def my_method                   # 1
          if cond                       # 1
            case var                    # 2 (0.8 + 4 * 0.2, rounded)
            when 1 then func_one
            when 2 then func_two
            when 3 then func_three
            when 4..10 then func_other
            end
          else                          # 1
            do_something until a && b   # 2
          end                           # ===
        end                             # 7 complexity points

        Cyclomatic complexity for store_duration is too high. [7/6]
        Open

          def store_duration
            logger.debug params.inspect
            if params[:arrive]
              @duration = 'arrive'
            elsif params[:until_this_time] != '0'
        Severity: Minor
        Found in app/controllers/event_controller.rb by rubocop

        This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

        An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

        Perceived complexity for send_mail is too high. [8/7]
        Open

          def send_mail
            gmail = Gmail.new('woofwhere', 'battle431101')
            if session[:id]
              user = User.find_by id: session[:id]
              if user
        Severity: Minor
        Found in app/controllers/event_controller.rb by rubocop

        This cop tries to produce a complexity score that's a measure of the complexity the reader experiences when looking at a method. For that reason it considers when nodes as something that doesn't add as much complexity as an if or a &&. Except if it's one of those special case/when constructs where there's no expression after case. Then the cop treats it as an if/elsif/elsif... and lets all the when nodes count. In contrast to the CyclomaticComplexity cop, this cop considers else nodes as adding complexity.

        Example:

        def my_method                   # 1
          if cond                       # 1
            case var                    # 2 (0.8 + 4 * 0.2, rounded)
            when 1 then func_one
            when 2 then func_two
            when 3 then func_three
            when 4..10 then func_other
            end
          else                          # 1
            do_something until a && b   # 2
          end                           # ===
        end                             # 7 complexity points

        Perceived complexity for parseDurationToCheckCondition is too high. [8/7]
        Open

            def parseDurationToCheckCondition(d)
              # return true if condition is met and stop tracking, else return false if keep tracking
              if d == 'arrive'
                # print "\n Inside d=='arrive' \n"
                # print @event.current_lat, @event.current_lng
        Severity: Minor
        Found in app/controllers/event_controller.rb by rubocop

        This cop tries to produce a complexity score that's a measure of the complexity the reader experiences when looking at a method. For that reason it considers when nodes as something that doesn't add as much complexity as an if or a &&. Except if it's one of those special case/when constructs where there's no expression after case. Then the cop treats it as an if/elsif/elsif... and lets all the when nodes count. In contrast to the CyclomaticComplexity cop, this cop considers else nodes as adding complexity.

        Example:

        def my_method                   # 1
          if cond                       # 1
            case var                    # 2 (0.8 + 4 * 0.2, rounded)
            when 1 then func_one
            when 2 then func_two
            when 3 then func_three
            when 4..10 then func_other
            end
          else                          # 1
            do_something until a && b   # 2
          end                           # ===
        end                             # 7 complexity points

        Assignment Branch Condition size for parseDuration is too high. [15.81/15]
        Open

            def parseDuration(d)
              if d
                if d == 'arrive'
                  return 'Until I arrive'
                elsif d[d.size-1] == 'm'
        Severity: Minor
        Found in app/controllers/event_controller.rb by rubocop

        This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

        Assignment Branch Condition size for store_message is too high. [15.17/15]
        Open

          def store_message
            logger.debug params.inspect
            if params[:message]
              session[:message] = params[:message]
            else
        Severity: Minor
        Found in app/controllers/event_controller.rb by rubocop

        This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

        Method send_mail has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def send_mail
            gmail = Gmail.new('woofwhere', 'battle431101')
            if session[:id]
              user = User.find_by id: session[:id]
              if user
        Severity: Minor
        Found in app/controllers/event_controller.rb - About 1 hr to fix

          Method user_map has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

            def user_map
              
              def parseDurationToCheckCondition(d)
                # return true if condition is met and stop tracking, else return false if keep tracking
                if d == 'arrive'
          Severity: Minor
          Found in app/controllers/event_controller.rb - About 1 hr to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Method summary has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def summary
              
              def parseDuration(d)
                if d
                  if d == 'arrive'
          Severity: Minor
          Found in app/controllers/event_controller.rb - About 1 hr to fix

            Method store_duration has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

              def store_duration
                logger.debug params.inspect
                if params[:arrive]
                  @duration = 'arrive'
                elsif params[:until_this_time] != '0'
            Severity: Minor
            Found in app/controllers/event_controller.rb - About 1 hr to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Method send_mail has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def send_mail
                gmail = Gmail.new('woofwhere', 'battle431101')
                if session[:id]
                  user = User.find_by id: session[:id]
                  if user
            Severity: Minor
            Found in app/controllers/event_controller.rb - About 55 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Method parseDurationToCheckCondition has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def parseDurationToCheckCondition(d)
                  # return true if condition is met and stop tracking, else return false if keep tracking
                  if d == 'arrive'
                    # print "\n Inside d=='arrive' \n"
                    # print @event.current_lat, @event.current_lng
            Severity: Minor
            Found in app/controllers/event_controller.rb - About 45 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Method parseDuration has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def parseDuration(d)
                  if d
                    if d == 'arrive'
                      return 'Until I arrive'
                    elsif d[d.size-1] == 'm'
            Severity: Minor
            Found in app/controllers/event_controller.rb - About 45 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Method summary has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

              def summary
                
                def parseDuration(d)
                  if d
                    if d == 'arrive'
            Severity: Minor
            Found in app/controllers/event_controller.rb - About 35 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Avoid too many return statements within this method.
            Open

                    return nil
            Severity: Major
            Found in app/controllers/event_controller.rb - About 30 mins to fix

              Avoid more than 3 levels of block nesting.
              Open

                        if @receiver_all
                          @receiver_all = [params['email']] + @receiver_all
                        else
                          @receiver_all = [params['email']]
                        end
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for excessive nesting of conditional and looping constructs.

              You can configure if blocks are considered using the CountBlocks option. When set to false (the default) blocks are not counted towards the nesting level. Set to true to count blocks as well.

              The maximum level of nesting allowed is configurable.

              Avoid more than 3 levels of block nesting.
              Open

                        if @receiver_name_all
                          @receiver_name_all = [params['name']] + @receiver_name_all
                        else
                          @receiver_name_all = [params['name']]
                        end
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for excessive nesting of conditional and looping constructs.

              You can configure if blocks are considered using the CountBlocks option. When set to false (the default) blocks are not counted towards the nesting level. Set to true to count blocks as well.

              The maximum level of nesting allowed is configurable.

              Space missing after comma.
              Open

                        reachHour = (d.slice(0,d.size-3)).to_i
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Checks for comma (,) not followed by some kind of space.

              Example:

              # bad
              [1,2]
              { foo:bar,}
              
              # good
              [1, 2]
              { foo:bar, }

              Extra empty line detected at class body end.
              Open

              
              end
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cops checks if empty lines around the bodies of classes match the configuration.

              Example: EnforcedStyle: empty_lines

              # good
              
              class Foo
              
                def bar
                  # ...
                end
              
              end

              Example: EnforcedStyle: emptylinesexcept_namespace

              # good
              
              class Foo
                class Bar
              
                  # ...
              
                end
              end

              Example: EnforcedStyle: emptylinesspecial

              # good
              class Foo
              
                def bar; end
              
              end

              Example: EnforcedStyle: noemptylines (default)

              # good
              
              class Foo
                def bar
                  # ...
                end
              end

              Missing space after #.
              Open

                      #check condition for this many hours
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

              Example:

              # bad
              #Some comment
              
              # good
              # Some comment

              Missing space after #.
              Open

                      #logger.debug "latlong = #{session[:latlong]}"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

              Example:

              # bad
              #Some comment
              
              # good
              # Some comment

              Indent the first parameter one step more than the start of the previous line.
              Open

                      :uid => session[:uid],
                      :address_lat => session[:address_lat],
                      :address_lng => session[:address_lng],
                      :receiver => session[:receiver],
                      :datetime_sent => session[:datetime_sent],
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks the indentation of the first parameter in a method call. Parameters after the first one are checked by Style/AlignParameters, not by this cop.

              Example:

              # bad
              some_method(
              first_param,
              second_param)
              
              # good
              some_method(
                first_param,
              second_param)

              Missing space after #.
              Open

                #attr_accessor :longitud
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

              Example:

              # bad
              #Some comment
              
              # good
              # Some comment

              Surrounding space missing for operator -.
              Open

                      elsif d[d.size-1] == 'm'
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Checks that operators have space around them, except for ** which should not have surrounding space.

              Example:

              # bad
              total = 3*4
              "apple"+"juice"
              my_number = 38/4
              a ** b
              
              # good
              total = 3 * 4
              "apple" + "juice"
              my_number = 38 / 4
              a**b

              Extra empty line detected at method body end.
              Open

              
                end
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cops checks if empty lines exist around the bodies of methods.

              Example:

              # good
              
              def foo
                # ...
              end
              
              # bad
              
              def bar
              
                # ...
              
              end

              Space missing after comma.
              Open

                  @messagehistory.sort!{ |x,y| y[:created_at] <=> x[:created_at] }
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Checks for comma (,) not followed by some kind of space.

              Example:

              # bad
              [1,2]
              { foo:bar,}
              
              # good
              [1, 2]
              { foo:bar, }

              Indent ) the same as the start of the line where ( is.
              Open

                    )
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cops checks the indentation of hanging closing parentheses in method calls, method definitions, and grouped expressions. A hanging closing parenthesis means ) preceded by a line break.

              Example:

              # good: when x is on its own line, indent this way
              func(
                x,
                y
              )
              
              # good: when x follows opening parenthesis, align parentheses
              a = b * (x +
                       y
                      )
              
              # bad
              def func(
                x,
                y
                )
              end

              Incorrect indentation detected (column 4 instead of 8).
              Open

                  #logger.debug "longi = #{@longi}"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cops checks the indentation of comments.

              Example:

              # bad
                # comment here
              def method_name
              end
              
                # comment here
              a = 'hello'
              
              # yet another comment
                if true
                  true
                end
              
              # good
              # comment here
              def method_name
              end
              
              # comment here
              a = 'hello'
              
              # yet another comment
              if true
                true
              end

              Space missing after comma.
              Open

                      current_distance = Geocoder::Calculations.distance_between([@event.current_lat,@event.current_lng], [@event.address_lat,@event.address_lng])
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Checks for comma (,) not followed by some kind of space.

              Example:

              # bad
              [1,2]
              { foo:bar,}
              
              # good
              [1, 2]
              { foo:bar, }

              Space missing after comma.
              Open

                        reachHour = (d.slice(0,d.size-3)).to_i + 12
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Checks for comma (,) not followed by some kind of space.

              Example:

              # bad
              [1,2]
              { foo:bar,}
              
              # good
              [1, 2]
              { foo:bar, }

              Missing space after #.
              Open

                      #@latlong = {lat: params[:latitude], lng: params[:longitude]}
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

              Example:

              # bad
              #Some comment
              
              # good
              # Some comment

              Missing space after #.
              Open

                      #not allowed to start at the exact same hour and minute as the end time
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

              Example:

              # bad
              #Some comment
              
              # good
              # Some comment

              Missing space after #.
              Open

                      #session[:latlong] = @latlong
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

              Example:

              # bad
              #Some comment
              
              # good
              # Some comment

              Missing space after #.
              Open

                  #logger.debug "lati = #{@lati}"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

              Example:

              # bad
              #Some comment
              
              # good
              # Some comment

              Missing space after #.
              Open

                      #logger.debug "lat = #{$latitud}"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

              Example:

              # bad
              #Some comment
              
              # good
              # Some comment

              Missing space after #.
              Open

                      #logger.debug "lat = #{params[:latitude]}"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

              Example:

              # bad
              #Some comment
              
              # good
              # Some comment

              Missing space after #.
              Open

                  #@sess = session[:latlong]
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

              Example:

              # bad
              #Some comment
              
              # good
              # Some comment

              Missing space after #.
              Open

                  #logger.debug "longi = #{@longi}"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

              Example:

              # bad
              #Some comment
              
              # good
              # Some comment

              Space missing after comma.
              Open

                      current_distance = Geocoder::Calculations.distance_between([@event.current_lat,@event.current_lng], [@event.address_lat,@event.address_lng])
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Checks for comma (,) not followed by some kind of space.

              Example:

              # bad
              [1,2]
              { foo:bar,}
              
              # good
              [1, 2]
              { foo:bar, }

              Surrounding space missing for operator +.
              Open

                        return 'Until '+d
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Checks that operators have space around them, except for ** which should not have surrounding space.

              Example:

              # bad
              total = 3*4
              "apple"+"juice"
              my_number = 38/4
              a ** b
              
              # good
              total = 3 * 4
              "apple" + "juice"
              my_number = 38 / 4
              a**b

              Extra blank line detected.
              Open

              
                def message
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cops checks for two or more consecutive blank lines.

              Example:

              # bad - It has two empty lines.
              some_method
              # one empty line
              # two empty lines
              some_method
              
              # good
              some_method
              # one empty line
              some_method

              Missing space after #.
              Open

                  #@longi = $longitud
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

              Example:

              # bad
              #Some comment
              
              # good
              # Some comment

              Trailing whitespace detected.
              Open

                
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use && instead of and.
              Open

                      return (hour == reachHour and minutes == 0)
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for uses of and and or, and suggests using && and || instead. It can be configured to check only in conditions, or in all contexts.

              Example: EnforcedStyle: always (default)

              # bad
              foo.save and return
              
              # bad
              if foo and bar
              end
              
              # good
              foo.save && return
              
              # good
              if foo && bar
              end

              Example: EnforcedStyle: conditionals

              # bad
              if foo and bar
              end
              
              # good
              foo.save && return
              
              # good
              foo.save and return
              
              # good
              if foo && bar
              end

              Use the return of the conditional for variable assignment and comparison.
              Open

                        if @receiver_name_all
                          @receiver_name_all = [params['name']] + @receiver_name_all
                        else
                          @receiver_name_all = [params['name']]
                        end
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use the return of the conditional for variable assignment and comparison.
              Open

                    if user
                      name = user.name
                    else
                      name = ""
                    end
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use a guard clause instead of wrapping the code inside a conditional expression.
              Open

                  if Event.exists?(id: id)
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use a guard clause instead of wrapping the code inside a conditional expression

              Example:

              # bad
              def test
                if something
                  work
                end
              end
              
              # good
              def test
                return unless something
                work
              end
              
              # also good
              def test
                work if something
              end
              
              # bad
              if something
                raise 'exception'
              else
                ok
              end
              
              # good
              raise 'exception' if something
              ok

              Use a guard clause instead of wrapping the code inside a conditional expression.
              Open

                  if params[:eid]
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use a guard clause instead of wrapping the code inside a conditional expression

              Example:

              # bad
              def test
                if something
                  work
                end
              end
              
              # good
              def test
                return unless something
                work
              end
              
              # also good
              def test
                work if something
              end
              
              # bad
              if something
                raise 'exception'
              else
                ok
              end
              
              # good
              raise 'exception' if something
              ok

              Use the new Ruby 1.9 hash syntax.
              Open

                      :address_lat => session[:address_lat],
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks hash literal syntax.

              It can enforce either the use of the class hash rocket syntax or the use of the newer Ruby 1.9 syntax (when applicable).

              A separate offense is registered for each problematic pair.

              The supported styles are:

              • ruby19 - forces use of the 1.9 syntax (e.g. {a: 1}) when hashes have all symbols for keys
              • hash_rockets - forces use of hash rockets for all hashes
              • nomixedkeys - simply checks for hashes with mixed syntaxes
              • ruby19nomixed_keys - forces use of ruby 1.9 syntax and forbids mixed syntax hashes

              Example: EnforcedStyle: ruby19 (default)

              # bad
              {:a => 2}
              {b: 1, :c => 2}
              
              # good
              {a: 2, b: 1}
              {:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol
              {d: 1, 'e' => 2} # technically not forbidden

              Example: EnforcedStyle: hash_rockets

              # bad
              {a: 1, b: 2}
              {c: 1, 'd' => 5}
              
              # good
              {:a => 1, :b => 2}

              Example: EnforcedStyle: nomixedkeys

              # bad
              {:a => 1, b: 2}
              {c: 1, 'd' => 2}
              
              # good
              {:a => 1, :b => 2}
              {c: 1, d: 2}

              Example: EnforcedStyle: ruby19nomixed_keys

              # bad
              {:a => 1, :b => 2}
              {c: 2, 'd' => 3} # should just use hash rockets
              
              # good
              {a: 1, b: 2}
              {:c => 3, 'd' => 4}

              Use the new Ruby 1.9 hash syntax.
              Open

                      :receiver => session[:receiver],
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks hash literal syntax.

              It can enforce either the use of the class hash rocket syntax or the use of the newer Ruby 1.9 syntax (when applicable).

              A separate offense is registered for each problematic pair.

              The supported styles are:

              • ruby19 - forces use of the 1.9 syntax (e.g. {a: 1}) when hashes have all symbols for keys
              • hash_rockets - forces use of hash rockets for all hashes
              • nomixedkeys - simply checks for hashes with mixed syntaxes
              • ruby19nomixed_keys - forces use of ruby 1.9 syntax and forbids mixed syntax hashes

              Example: EnforcedStyle: ruby19 (default)

              # bad
              {:a => 2}
              {b: 1, :c => 2}
              
              # good
              {a: 2, b: 1}
              {:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol
              {d: 1, 'e' => 2} # technically not forbidden

              Example: EnforcedStyle: hash_rockets

              # bad
              {a: 1, b: 2}
              {c: 1, 'd' => 5}
              
              # good
              {:a => 1, :b => 2}

              Example: EnforcedStyle: nomixedkeys

              # bad
              {:a => 1, b: 2}
              {c: 1, 'd' => 2}
              
              # good
              {:a => 1, :b => 2}
              {c: 1, d: 2}

              Example: EnforcedStyle: ruby19nomixed_keys

              # bad
              {:a => 1, :b => 2}
              {c: 2, 'd' => 3} # should just use hash rockets
              
              # good
              {a: 1, b: 2}
              {:c => 3, 'd' => 4}

              Use the new Ruby 1.9 hash syntax.
              Open

                      :datetime_sent => session[:datetime_sent],
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks hash literal syntax.

              It can enforce either the use of the class hash rocket syntax or the use of the newer Ruby 1.9 syntax (when applicable).

              A separate offense is registered for each problematic pair.

              The supported styles are:

              • ruby19 - forces use of the 1.9 syntax (e.g. {a: 1}) when hashes have all symbols for keys
              • hash_rockets - forces use of hash rockets for all hashes
              • nomixedkeys - simply checks for hashes with mixed syntaxes
              • ruby19nomixed_keys - forces use of ruby 1.9 syntax and forbids mixed syntax hashes

              Example: EnforcedStyle: ruby19 (default)

              # bad
              {:a => 2}
              {b: 1, :c => 2}
              
              # good
              {a: 2, b: 1}
              {:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol
              {d: 1, 'e' => 2} # technically not forbidden

              Example: EnforcedStyle: hash_rockets

              # bad
              {a: 1, b: 2}
              {c: 1, 'd' => 5}
              
              # good
              {:a => 1, :b => 2}

              Example: EnforcedStyle: nomixedkeys

              # bad
              {:a => 1, b: 2}
              {c: 1, 'd' => 2}
              
              # good
              {:a => 1, :b => 2}
              {c: 1, d: 2}

              Example: EnforcedStyle: ruby19nomixed_keys

              # bad
              {:a => 1, :b => 2}
              {c: 2, 'd' => 3} # should just use hash rockets
              
              # good
              {a: 1, b: 2}
              {:c => 3, 'd' => 4}

              Surrounding space missing for operator -.
              Open

                      num_hours = d[0, d.size-6].to_i
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Checks that operators have space around them, except for ** which should not have surrounding space.

              Example:

              # bad
              total = 3*4
              "apple"+"juice"
              my_number = 38/4
              a ** b
              
              # good
              total = 3 * 4
              "apple" + "juice"
              my_number = 38 / 4
              a**b

              Trailing whitespace detected.
              Open

               
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Trailing whitespace detected.
              Open

                
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use a guard clause instead of wrapping the code inside a conditional expression.
              Open

                      if d == 'arrive'
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use a guard clause instead of wrapping the code inside a conditional expression

              Example:

              # bad
              def test
                if something
                  work
                end
              end
              
              # good
              def test
                return unless something
                work
              end
              
              # also good
              def test
                work if something
              end
              
              # bad
              if something
                raise 'exception'
              else
                ok
              end
              
              # good
              raise 'exception' if something
              ok

              Use the new Ruby 1.9 hash syntax.
              Open

                      :address_string => session[:address_string],
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks hash literal syntax.

              It can enforce either the use of the class hash rocket syntax or the use of the newer Ruby 1.9 syntax (when applicable).

              A separate offense is registered for each problematic pair.

              The supported styles are:

              • ruby19 - forces use of the 1.9 syntax (e.g. {a: 1}) when hashes have all symbols for keys
              • hash_rockets - forces use of hash rockets for all hashes
              • nomixedkeys - simply checks for hashes with mixed syntaxes
              • ruby19nomixed_keys - forces use of ruby 1.9 syntax and forbids mixed syntax hashes

              Example: EnforcedStyle: ruby19 (default)

              # bad
              {:a => 2}
              {b: 1, :c => 2}
              
              # good
              {a: 2, b: 1}
              {:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol
              {d: 1, 'e' => 2} # technically not forbidden

              Example: EnforcedStyle: hash_rockets

              # bad
              {a: 1, b: 2}
              {c: 1, 'd' => 5}
              
              # good
              {:a => 1, :b => 2}

              Example: EnforcedStyle: nomixedkeys

              # bad
              {:a => 1, b: 2}
              {c: 1, 'd' => 2}
              
              # good
              {:a => 1, :b => 2}
              {c: 1, d: 2}

              Example: EnforcedStyle: ruby19nomixed_keys

              # bad
              {:a => 1, :b => 2}
              {c: 2, 'd' => 3} # should just use hash rockets
              
              # good
              {a: 1, b: 2}
              {:c => 3, 'd' => 4}

              Use params['email'].length.zero? instead of params['email'].length == 0.
              Open

                      if params['email'].length == 0 or params['name'].length == 0
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for usage of comparison operators (==, >, <) to test numbers as zero, positive, or negative. These can be replaced by their respective predicate methods. The cop can also be configured to do the reverse.

              The cop disregards #nonzero? as it its value is truthy or falsey, but not true and false, and thus not always interchangeable with != 0.

              The cop ignores comparisons to global variables, since they are often populated with objects which can be compared with integers, but are not themselves Interger polymorphic.

              Example: EnforcedStyle: predicate (default)

              # bad
              
              foo == 0
              0 > foo
              bar.baz > 0
              
              # good
              
              foo.zero?
              foo.negative?
              bar.baz.positive?

              Example: EnforcedStyle: comparison

              # bad
              
              foo.zero?
              foo.negative?
              bar.baz.positive?
              
              # good
              
              foo == 0
              0 > foo
              bar.baz > 0

              Surrounding space missing for operator -.
              Open

                    elsif d[d.size-1] == 'm'
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Checks that operators have space around them, except for ** which should not have surrounding space.

              Example:

              # bad
              total = 3*4
              "apple"+"juice"
              my_number = 38/4
              a ** b
              
              # good
              total = 3 * 4
              "apple" + "juice"
              my_number = 38 / 4
              a**b

              Surrounding space missing for operator -.
              Open

                    elsif d[d.size-1] == 's'
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Checks that operators have space around them, except for ** which should not have surrounding space.

              Example:

              # bad
              total = 3*4
              "apple"+"juice"
              my_number = 38/4
              a ** b
              
              # good
              total = 3 * 4
              "apple" + "juice"
              my_number = 38 / 4
              a**b

              Space missing to the left of {.
              Open

                  @messagehistory.sort!{ |x,y| y[:created_at] <=> x[:created_at] }
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Checks that block braces have or don't have a space before the opening brace depending on configuration.

              Example:

              # bad
              foo.map{ |a|
                a.bar.to_s
              }
              
              # good
              foo.map { |a|
                a.bar.to_s
              }

              Trailing whitespace detected.
              Open

                  
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Trailing whitespace detected.
              Open

                  
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Trailing whitespace detected.
              Open

                  
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use snake_case for variable names.
              Open

                        reachHour = (d.slice(0,d.size-3)).to_i
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

              Example: EnforcedStyle: snake_case (default)

              # bad
              fooBar = 1
              
              # good
              foo_bar = 1

              Example: EnforcedStyle: camelCase

              # bad
              foo_bar = 1
              
              # good
              fooBar = 1

              Use the return of the conditional for variable assignment and comparison.
              Open

                        if @receiver_all
                          @receiver_all = [params['email']] + @receiver_all
                        else
                          @receiver_all = [params['email']]
                        end
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use the new Ruby 1.9 hash syntax.
              Open

                      :address_lng => session[:address_lng],
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks hash literal syntax.

              It can enforce either the use of the class hash rocket syntax or the use of the newer Ruby 1.9 syntax (when applicable).

              A separate offense is registered for each problematic pair.

              The supported styles are:

              • ruby19 - forces use of the 1.9 syntax (e.g. {a: 1}) when hashes have all symbols for keys
              • hash_rockets - forces use of hash rockets for all hashes
              • nomixedkeys - simply checks for hashes with mixed syntaxes
              • ruby19nomixed_keys - forces use of ruby 1.9 syntax and forbids mixed syntax hashes

              Example: EnforcedStyle: ruby19 (default)

              # bad
              {:a => 2}
              {b: 1, :c => 2}
              
              # good
              {a: 2, b: 1}
              {:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol
              {d: 1, 'e' => 2} # technically not forbidden

              Example: EnforcedStyle: hash_rockets

              # bad
              {a: 1, b: 2}
              {c: 1, 'd' => 5}
              
              # good
              {:a => 1, :b => 2}

              Example: EnforcedStyle: nomixedkeys

              # bad
              {:a => 1, b: 2}
              {c: 1, 'd' => 2}
              
              # good
              {:a => 1, :b => 2}
              {c: 1, d: 2}

              Example: EnforcedStyle: ruby19nomixed_keys

              # bad
              {:a => 1, :b => 2}
              {c: 2, 'd' => 3} # should just use hash rockets
              
              # good
              {a: 1, b: 2}
              {:c => 3, 'd' => 4}

              Use the new Ruby 1.9 hash syntax.
              Open

                      :receiver_name => session[:receiver_name],
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks hash literal syntax.

              It can enforce either the use of the class hash rocket syntax or the use of the newer Ruby 1.9 syntax (when applicable).

              A separate offense is registered for each problematic pair.

              The supported styles are:

              • ruby19 - forces use of the 1.9 syntax (e.g. {a: 1}) when hashes have all symbols for keys
              • hash_rockets - forces use of hash rockets for all hashes
              • nomixedkeys - simply checks for hashes with mixed syntaxes
              • ruby19nomixed_keys - forces use of ruby 1.9 syntax and forbids mixed syntax hashes

              Example: EnforcedStyle: ruby19 (default)

              # bad
              {:a => 2}
              {b: 1, :c => 2}
              
              # good
              {a: 2, b: 1}
              {:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol
              {d: 1, 'e' => 2} # technically not forbidden

              Example: EnforcedStyle: hash_rockets

              # bad
              {a: 1, b: 2}
              {c: 1, 'd' => 5}
              
              # good
              {:a => 1, :b => 2}

              Example: EnforcedStyle: nomixedkeys

              # bad
              {:a => 1, b: 2}
              {c: 1, 'd' => 2}
              
              # good
              {:a => 1, :b => 2}
              {c: 1, d: 2}

              Example: EnforcedStyle: ruby19nomixed_keys

              # bad
              {:a => 1, :b => 2}
              {c: 2, 'd' => 3} # should just use hash rockets
              
              # good
              {a: 1, b: 2}
              {:c => 3, 'd' => 4}

              Use params['email'].length.zero? instead of params['email'].length == 0.
              Open

                      if params['email'].length == 0 or params['name'].length == 0
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for usage of comparison operators (==, >, <) to test numbers as zero, positive, or negative. These can be replaced by their respective predicate methods. The cop can also be configured to do the reverse.

              The cop disregards #nonzero? as it its value is truthy or falsey, but not true and false, and thus not always interchangeable with != 0.

              The cop ignores comparisons to global variables, since they are often populated with objects which can be compared with integers, but are not themselves Interger polymorphic.

              Example: EnforcedStyle: predicate (default)

              # bad
              
              foo == 0
              0 > foo
              bar.baz > 0
              
              # good
              
              foo.zero?
              foo.negative?
              bar.baz.positive?

              Example: EnforcedStyle: comparison

              # bad
              
              foo.zero?
              foo.negative?
              bar.baz.positive?
              
              # good
              
              foo == 0
              0 > foo
              bar.baz > 0

              Use minutes.zero? instead of minutes == 0.
              Open

                      return (hour == reachHour and minutes == 0)
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for usage of comparison operators (==, >, <) to test numbers as zero, positive, or negative. These can be replaced by their respective predicate methods. The cop can also be configured to do the reverse.

              The cop disregards #nonzero? as it its value is truthy or falsey, but not true and false, and thus not always interchangeable with != 0.

              The cop ignores comparisons to global variables, since they are often populated with objects which can be compared with integers, but are not themselves Interger polymorphic.

              Example: EnforcedStyle: predicate (default)

              # bad
              
              foo == 0
              0 > foo
              bar.baz > 0
              
              # good
              
              foo.zero?
              foo.negative?
              bar.baz.positive?

              Example: EnforcedStyle: comparison

              # bad
              
              foo.zero?
              foo.negative?
              bar.baz.positive?
              
              # good
              
              foo == 0
              0 > foo
              bar.baz > 0

              Trailing whitespace detected.
              Open

                    # @receiver_all = user.contacts 
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Line is too long. [93/80]
              Open

                  # render text: "<script>window.location = '#{event_summary_path}';</script>", status: 200
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Line is too long. [95/80]
              Open

                    # render text: "<script>window.location = '#{event_summary_path}';</script>", status: 200
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use && instead of and.
              Open

                  if session[:address_lat] and session[:address_lng]
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for uses of and and or, and suggests using && and || instead. It can be configured to check only in conditions, or in all contexts.

              Example: EnforcedStyle: always (default)

              # bad
              foo.save and return
              
              # bad
              if foo and bar
              end
              
              # good
              foo.save && return
              
              # good
              if foo && bar
              end

              Example: EnforcedStyle: conditionals

              # bad
              if foo and bar
              end
              
              # good
              foo.save && return
              
              # good
              foo.save and return
              
              # good
              if foo && bar
              end

              Use the return of the conditional for variable assignment and comparison.
              Open

                    if params[:am]
                      @duration = "#{params[:until_this_time]} am"
                    elsif params[:pm]
                      @duration = "#{params[:until_this_time]} pm"
                    else
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use the new Ruby 1.9 hash syntax.
              Open

                        render :js => "window.location = '/'" 
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks hash literal syntax.

              It can enforce either the use of the class hash rocket syntax or the use of the newer Ruby 1.9 syntax (when applicable).

              A separate offense is registered for each problematic pair.

              The supported styles are:

              • ruby19 - forces use of the 1.9 syntax (e.g. {a: 1}) when hashes have all symbols for keys
              • hash_rockets - forces use of hash rockets for all hashes
              • nomixedkeys - simply checks for hashes with mixed syntaxes
              • ruby19nomixed_keys - forces use of ruby 1.9 syntax and forbids mixed syntax hashes

              Example: EnforcedStyle: ruby19 (default)

              # bad
              {:a => 2}
              {b: 1, :c => 2}
              
              # good
              {a: 2, b: 1}
              {:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol
              {d: 1, 'e' => 2} # technically not forbidden

              Example: EnforcedStyle: hash_rockets

              # bad
              {a: 1, b: 2}
              {c: 1, 'd' => 5}
              
              # good
              {:a => 1, :b => 2}

              Example: EnforcedStyle: nomixedkeys

              # bad
              {:a => 1, b: 2}
              {c: 1, 'd' => 2}
              
              # good
              {:a => 1, :b => 2}
              {c: 1, d: 2}

              Example: EnforcedStyle: ruby19nomixed_keys

              # bad
              {:a => 1, :b => 2}
              {c: 2, 'd' => 3} # should just use hash rockets
              
              # good
              {a: 1, b: 2}
              {:c => 3, 'd' => 4}

              Space inside } missing.
              Open

                      return {lat: @lati, lng: @longi}
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

              Example: EnforcedStyle: space

              # The `space` style enforces that hash literals have
              # surrounding space.
              
              # bad
              h = {a: 1, b: 2}
              
              # good
              h = { a: 1, b: 2 }

              Example: EnforcedStyle: no_space

              # The `no_space` style enforces that hash literals have
              # no surrounding space.
              
              # bad
              h = { a: 1, b: 2 }
              
              # good
              h = {a: 1, b: 2}

              Example: EnforcedStyle: compact

              # The `compact` style normally requires a space inside
              # hash braces, with the exception that successive left
              # braces or right braces are collapsed together in nested hashes.
              
              # bad
              h = { a: { b: 2 } }
              
              # good
              h = { a: { b: 2 }}

              Trailing whitespace detected.
              Open

                  
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Line is too long. [95/80]
              Open

                    # render text: "<script>window.location = '#{event_message_path}';</script>", status: 200
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Surrounding space missing for operator -.
              Open

                        reachHour = (d.slice(0,d.size-3)).to_i + 12
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Checks that operators have space around them, except for ** which should not have surrounding space.

              Example:

              # bad
              total = 3*4
              "apple"+"juice"
              my_number = 38/4
              a ** b
              
              # good
              total = 3 * 4
              "apple" + "juice"
              my_number = 38 / 4
              a**b

              Trailing whitespace detected.
              Open

                  
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Trailing whitespace detected.
              Open

                
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Trailing whitespace detected.
              Open

                      
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Trailing whitespace detected.
              Open

                  
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Line is too long. [82/80]
              Open

                      # check if location matches destination within a radius of about 50 metres
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use the new Ruby 1.9 hash syntax.
              Open

                  user = User.where(:id => session[:id]).take
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks hash literal syntax.

              It can enforce either the use of the class hash rocket syntax or the use of the newer Ruby 1.9 syntax (when applicable).

              A separate offense is registered for each problematic pair.

              The supported styles are:

              • ruby19 - forces use of the 1.9 syntax (e.g. {a: 1}) when hashes have all symbols for keys
              • hash_rockets - forces use of hash rockets for all hashes
              • nomixedkeys - simply checks for hashes with mixed syntaxes
              • ruby19nomixed_keys - forces use of ruby 1.9 syntax and forbids mixed syntax hashes

              Example: EnforcedStyle: ruby19 (default)

              # bad
              {:a => 2}
              {b: 1, :c => 2}
              
              # good
              {a: 2, b: 1}
              {:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol
              {d: 1, 'e' => 2} # technically not forbidden

              Example: EnforcedStyle: hash_rockets

              # bad
              {a: 1, b: 2}
              {c: 1, 'd' => 5}
              
              # good
              {:a => 1, :b => 2}

              Example: EnforcedStyle: nomixedkeys

              # bad
              {:a => 1, b: 2}
              {c: 1, 'd' => 2}
              
              # good
              {:a => 1, :b => 2}
              {c: 1, d: 2}

              Example: EnforcedStyle: ruby19nomixed_keys

              # bad
              {:a => 1, :b => 2}
              {c: 2, 'd' => 3} # should just use hash rockets
              
              # good
              {a: 1, b: 2}
              {:c => 3, 'd' => 4}

              Surrounding space missing for operator -.
              Open

                      if d[d.size-2] == 'p'
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Checks that operators have space around them, except for ** which should not have surrounding space.

              Example:

              # bad
              total = 3*4
              "apple"+"juice"
              my_number = 38/4
              a ** b
              
              # good
              total = 3 * 4
              "apple" + "juice"
              my_number = 38 / 4
              a**b

              Trailing whitespace detected.
              Open

                        render :js => "window.location = '/'" 
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Trailing whitespace detected.
              Open

                
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Trailing whitespace detected.
              Open

                  end 
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Trailing whitespace detected.
              Open

                        subject "Welcome to wherewoof" 
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Unreachable code detected.
              Open

                      logger.debug "lat = #{@lati}"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for unreachable code. The check are based on the presence of flow of control statement in non-final position in begin(implicit) blocks.

              Example:

              # bad
              
              def some_method
                return
                do_something
              end
              
              # bad
              
              def some_method
                if cond
                  return
                else
                  return
                end
                do_something
              end

              Example:

              # good
              
              def some_method
                do_something
              end

              Line is too long. [148/80]
              Open

                      current_distance = Geocoder::Calculations.distance_between([@event.current_lat,@event.current_lng], [@event.address_lat,@event.address_lng])
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Line is too long. [141/80]
              Open

                          body "Wherewoof is forwarding a message from " + name +  ".The message is " + message + " Track " + receiver + " at " + url + "!"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use || instead of or.
              Open

                      if params['email'].length == 0 or params['name'].length == 0
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for uses of and and or, and suggests using && and || instead. It can be configured to check only in conditions, or in all contexts.

              Example: EnforcedStyle: always (default)

              # bad
              foo.save and return
              
              # bad
              if foo and bar
              end
              
              # good
              foo.save && return
              
              # good
              if foo && bar
              end

              Example: EnforcedStyle: conditionals

              # bad
              if foo and bar
              end
              
              # good
              foo.save && return
              
              # good
              foo.save and return
              
              # good
              if foo && bar
              end

              Use && instead of and.
              Open

                  if @address_lat == "37.7749" and @address_lat == "-122.4194"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for uses of and and or, and suggests using && and || instead. It can be configured to check only in conditions, or in all contexts.

              Example: EnforcedStyle: always (default)

              # bad
              foo.save and return
              
              # bad
              if foo and bar
              end
              
              # good
              foo.save && return
              
              # good
              if foo && bar
              end

              Example: EnforcedStyle: conditionals

              # bad
              if foo and bar
              end
              
              # good
              foo.save && return
              
              # good
              foo.save and return
              
              # good
              if foo && bar
              end

              Use a guard clause instead of wrapping the code inside a conditional expression.
              Open

                  if session[:receiver]
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use a guard clause instead of wrapping the code inside a conditional expression

              Example:

              # bad
              def test
                if something
                  work
                end
              end
              
              # good
              def test
                return unless something
                work
              end
              
              # also good
              def test
                work if something
              end
              
              # bad
              if something
                raise 'exception'
              else
                ok
              end
              
              # good
              raise 'exception' if something
              ok

              Use the new Ruby 1.9 hash syntax.
              Open

                      :message => session[:message],
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks hash literal syntax.

              It can enforce either the use of the class hash rocket syntax or the use of the newer Ruby 1.9 syntax (when applicable).

              A separate offense is registered for each problematic pair.

              The supported styles are:

              • ruby19 - forces use of the 1.9 syntax (e.g. {a: 1}) when hashes have all symbols for keys
              • hash_rockets - forces use of hash rockets for all hashes
              • nomixedkeys - simply checks for hashes with mixed syntaxes
              • ruby19nomixed_keys - forces use of ruby 1.9 syntax and forbids mixed syntax hashes

              Example: EnforcedStyle: ruby19 (default)

              # bad
              {:a => 2}
              {b: 1, :c => 2}
              
              # good
              {a: 2, b: 1}
              {:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol
              {d: 1, 'e' => 2} # technically not forbidden

              Example: EnforcedStyle: hash_rockets

              # bad
              {a: 1, b: 2}
              {c: 1, 'd' => 5}
              
              # good
              {:a => 1, :b => 2}

              Example: EnforcedStyle: nomixedkeys

              # bad
              {:a => 1, b: 2}
              {c: 1, 'd' => 2}
              
              # good
              {:a => 1, :b => 2}
              {c: 1, d: 2}

              Example: EnforcedStyle: ruby19nomixed_keys

              # bad
              {:a => 1, :b => 2}
              {c: 2, 'd' => 3} # should just use hash rockets
              
              # good
              {a: 1, b: 2}
              {:c => 3, 'd' => 4}

              Use next to skip iteration.
              Open

                    if k =~ /^info_.*$/
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use next to skip iteration instead of a condition at the end.

              Example: EnforcedStyle: skipmodifierifs (default)

              # bad
              [1, 2].each do |a|
                if a == 1
                  puts a
                end
              end
              
              # good
              [1, 2].each do |a|
                next unless a == 1
                puts a
              end
              
              # good
              [1, 2].each do |o|
                puts o unless o == 1
              end

              Example: EnforcedStyle: always

              # With `always` all conditions at the end of an iteration needs to be
              # replaced by next - with `skip_modifier_ifs` the modifier if like
              # this one are ignored: `[1, 2].each { |a| return 'yes' if a == 1 }`
              
              # bad
              [1, 2].each do |o|
                puts o unless o == 1
              end
              
              # bad
              [1, 2].each do |a|
                if a == 1
                  puts a
                end
              end
              
              # good
              [1, 2].each do |a|
                next unless a == 1
                puts a
              end

              Use empty lines between method definitions.
              Open

                def message
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks whether method definitions are separated by one empty line.

              NumberOfEmptyLines can be and integer (e.g. 1 by default) or an array (e.g. [1, 2]) to specificy a minimum and a maximum of empty lines.

              AllowAdjacentOneLineDefs can be used to configure is adjacent one line methods definitions are an offense

              Example:

              # bad
              def a
              end
              def b
              end

              Example:

              # good
              def a
              end
              
              def b
              end

              Missing space after #.
              Open

                      #check the time each time he posts
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

              Example:

              # bad
              #Some comment
              
              # good
              # Some comment

              Missing space after #.
              Open

                  #logger.debug "sess = #{session[:latlong]}"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

              Example:

              # bad
              #Some comment
              
              # good
              # Some comment

              Use && instead of and.
              Open

                  if @receiver.length > 0 and @receiver_name.length > 0
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for uses of and and or, and suggests using && and || instead. It can be configured to check only in conditions, or in all contexts.

              Example: EnforcedStyle: always (default)

              # bad
              foo.save and return
              
              # bad
              if foo and bar
              end
              
              # good
              foo.save && return
              
              # good
              if foo && bar
              end

              Example: EnforcedStyle: conditionals

              # bad
              if foo and bar
              end
              
              # good
              foo.save && return
              
              # good
              foo.save and return
              
              # good
              if foo && bar
              end

              Use || instead of or.
              Open

                      elsif d[d.size-1] == 's' or d[d.size-1] == 'r'
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for uses of and and or, and suggests using && and || instead. It can be configured to check only in conditions, or in all contexts.

              Example: EnforcedStyle: always (default)

              # bad
              foo.save and return
              
              # bad
              if foo and bar
              end
              
              # good
              foo.save && return
              
              # good
              if foo && bar
              end

              Example: EnforcedStyle: conditionals

              # bad
              if foo and bar
              end
              
              # good
              foo.save && return
              
              # good
              foo.save and return
              
              # good
              if foo && bar
              end

              Line is too long. [90/80]
              Open

                  session['url'] = "http://wherewoof.herokuapp.com/event/receiver_map/" + @event.id.to_s
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use snake_case for method names.
              Open

                  def parseDuration(d)
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop makes sure that all methods use the configured style, snake_case or camelCase, for their names.

              Example: EnforcedStyle: snake_case (default)

              # bad
              def fooBar; end
              
              # good
              def foo_bar; end

              Example: EnforcedStyle: camelCase

              # bad
              def foo_bar; end
              
              # good
              def fooBar; end

              Use snake_case for variable names.
              Open

                        reachHour = (d.slice(0,d.size-3)).to_i + 12
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

              Example: EnforcedStyle: snake_case (default)

              # bad
              fooBar = 1
              
              # good
              foo_bar = 1

              Example: EnforcedStyle: camelCase

              # bad
              foo_bar = 1
              
              # good
              fooBar = 1

              Missing top-level class documentation comment.
              Open

              class EventController < ApplicationController
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.

              The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.

              Example:

              # bad
              class Person
                # ...
              end
              
              # good
              # Description/Explanation of Person class
              class Person
                # ...
              end

              Use the new Ruby 1.9 hash syntax.
              Open

                      :duration_setting => session[:duration_setting],
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks hash literal syntax.

              It can enforce either the use of the class hash rocket syntax or the use of the newer Ruby 1.9 syntax (when applicable).

              A separate offense is registered for each problematic pair.

              The supported styles are:

              • ruby19 - forces use of the 1.9 syntax (e.g. {a: 1}) when hashes have all symbols for keys
              • hash_rockets - forces use of hash rockets for all hashes
              • nomixedkeys - simply checks for hashes with mixed syntaxes
              • ruby19nomixed_keys - forces use of ruby 1.9 syntax and forbids mixed syntax hashes

              Example: EnforcedStyle: ruby19 (default)

              # bad
              {:a => 2}
              {b: 1, :c => 2}
              
              # good
              {a: 2, b: 1}
              {:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol
              {d: 1, 'e' => 2} # technically not forbidden

              Example: EnforcedStyle: hash_rockets

              # bad
              {a: 1, b: 2}
              {c: 1, 'd' => 5}
              
              # good
              {:a => 1, :b => 2}

              Example: EnforcedStyle: nomixedkeys

              # bad
              {:a => 1, b: 2}
              {c: 1, 'd' => 2}
              
              # good
              {:a => 1, :b => 2}
              {c: 1, d: 2}

              Example: EnforcedStyle: ruby19nomixed_keys

              # bad
              {:a => 1, :b => 2}
              {c: 2, 'd' => 3} # should just use hash rockets
              
              # good
              {a: 1, b: 2}
              {:c => 3, 'd' => 4}

              Surrounding space missing for operator -.
              Open

                      elsif d[d.size-1] == 's' or d[d.size-1] == 'r'
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Checks that operators have space around them, except for ** which should not have surrounding space.

              Example:

              # bad
              total = 3*4
              "apple"+"juice"
              my_number = 38/4
              a ** b
              
              # good
              total = 3 * 4
              "apple" + "juice"
              my_number = 38 / 4
              a**b

              Space inside } missing.
              Open

                    @data = {:lat => @lati, :lng => @longi}
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

              Example: EnforcedStyle: space

              # The `space` style enforces that hash literals have
              # surrounding space.
              
              # bad
              h = {a: 1, b: 2}
              
              # good
              h = { a: 1, b: 2 }

              Example: EnforcedStyle: no_space

              # The `no_space` style enforces that hash literals have
              # no surrounding space.
              
              # bad
              h = { a: 1, b: 2 }
              
              # good
              h = {a: 1, b: 2}

              Example: EnforcedStyle: compact

              # The `compact` style normally requires a space inside
              # hash braces, with the exception that successive left
              # braces or right braces are collapsed together in nested hashes.
              
              # bad
              h = { a: { b: 2 } }
              
              # good
              h = { a: { b: 2 }}

              Trailing whitespace detected.
              Open

                  respond_to do |format|               
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Trailing whitespace detected.
              Open

                
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Trailing whitespace detected.
              Open

                  
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Trailing whitespace detected.
              Open

                
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Trailing whitespace detected.
              Open

                    
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Line is too long. [105/80]
              Open

                  @receiver = if session[:receiver].is_a?(String) then [session[:receiver]] else session[:receiver] end
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use the return of the conditional for variable assignment and comparison.
              Open

                      if d[d.size-2] == 'p'
                        # reach hour is set to the saved hour plus 12
                        reachHour = (d.slice(0,d.size-3)).to_i + 12
                      else
                        # reach hour is set to the saved hour
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use a guard clause instead of wrapping the code inside a conditional expression.
              Open

                  if Event.exists?(id: id)
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use a guard clause instead of wrapping the code inside a conditional expression

              Example:

              # bad
              def test
                if something
                  work
                end
              end
              
              # good
              def test
                return unless something
                work
              end
              
              # also good
              def test
                work if something
              end
              
              # bad
              if something
                raise 'exception'
              else
                ok
              end
              
              # good
              raise 'exception' if something
              ok

              Space inside { missing.
              Open

                    @data = {:lat => @lati, :lng => @longi}
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

              Example: EnforcedStyle: space

              # The `space` style enforces that hash literals have
              # surrounding space.
              
              # bad
              h = {a: 1, b: 2}
              
              # good
              h = { a: 1, b: 2 }

              Example: EnforcedStyle: no_space

              # The `no_space` style enforces that hash literals have
              # no surrounding space.
              
              # bad
              h = { a: 1, b: 2 }
              
              # good
              h = {a: 1, b: 2}

              Example: EnforcedStyle: compact

              # The `compact` style normally requires a space inside
              # hash braces, with the exception that successive left
              # braces or right braces are collapsed together in nested hashes.
              
              # bad
              h = { a: { b: 2 } }
              
              # good
              h = { a: { b: 2 }}

              Line is too long. [103/80]
              Open

                    # render text: "<script>window.location = '#{event_select_duration_path}';</script>", status: 400
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use snake_case for method names.
              Open

                  def parseDurationToCheckCondition(d)
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop makes sure that all methods use the configured style, snake_case or camelCase, for their names.

              Example: EnforcedStyle: snake_case (default)

              # bad
              def fooBar; end
              
              # good
              def foo_bar; end

              Example: EnforcedStyle: camelCase

              # bad
              def foo_bar; end
              
              # good
              def fooBar; end

              Use && instead of and.
              Open

                    if params['email'] and params['name']
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for uses of and and or, and suggests using && and || instead. It can be configured to check only in conditions, or in all contexts.

              Example: EnforcedStyle: always (default)

              # bad
              foo.save and return
              
              # bad
              if foo and bar
              end
              
              # good
              foo.save && return
              
              # good
              if foo && bar
              end

              Example: EnforcedStyle: conditionals

              # bad
              if foo and bar
              end
              
              # good
              foo.save && return
              
              # good
              foo.save and return
              
              # good
              if foo && bar
              end

              Use the return of the conditional for variable assignment and comparison.
              Open

                      if @receiver_name_all
                        @receiver_name_all = [params['name']] + @receiver_name_all
                      else
                        @receiver_name_all = [params['name']]
                      end
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use the new Ruby 1.9 hash syntax.
              Open

                    @data = {:lat => @lati, :lng => @longi}
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks hash literal syntax.

              It can enforce either the use of the class hash rocket syntax or the use of the newer Ruby 1.9 syntax (when applicable).

              A separate offense is registered for each problematic pair.

              The supported styles are:

              • ruby19 - forces use of the 1.9 syntax (e.g. {a: 1}) when hashes have all symbols for keys
              • hash_rockets - forces use of hash rockets for all hashes
              • nomixedkeys - simply checks for hashes with mixed syntaxes
              • ruby19nomixed_keys - forces use of ruby 1.9 syntax and forbids mixed syntax hashes

              Example: EnforcedStyle: ruby19 (default)

              # bad
              {:a => 2}
              {b: 1, :c => 2}
              
              # good
              {a: 2, b: 1}
              {:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol
              {d: 1, 'e' => 2} # technically not forbidden

              Example: EnforcedStyle: hash_rockets

              # bad
              {a: 1, b: 2}
              {c: 1, 'd' => 5}
              
              # good
              {:a => 1, :b => 2}

              Example: EnforcedStyle: nomixedkeys

              # bad
              {:a => 1, b: 2}
              {c: 1, 'd' => 2}
              
              # good
              {:a => 1, :b => 2}
              {c: 1, d: 2}

              Example: EnforcedStyle: ruby19nomixed_keys

              # bad
              {:a => 1, :b => 2}
              {c: 2, 'd' => 3} # should just use hash rockets
              
              # good
              {a: 1, b: 2}
              {:c => 3, 'd' => 4}

              Surrounding space missing for operator -.
              Open

                      elsif d[d.size-1] == 's' or d[d.size-1] == 'r'
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Checks that operators have space around them, except for ** which should not have surrounding space.

              Example:

              # bad
              total = 3*4
              "apple"+"juice"
              my_number = 38/4
              a ** b
              
              # good
              total = 3 * 4
              "apple" + "juice"
              my_number = 38 / 4
              a**b

              Trailing whitespace detected.
              Open

                  
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Trailing whitespace detected.
              Open

                
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Method EventController#latlng is defined at both app/controllers/event_controller.rb:2 and app/controllers/event_controller.rb:362.
              Open

                def latlng
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for duplicated instance (or singleton) method definitions.

              Example:

              # bad
              
              def duplicated
                1
              end
              
              def duplicated
                2
              end

              Example:

              # bad
              
              def duplicated
                1
              end
              
              alias duplicated other_duplicated

              Example:

              # good
              
              def duplicated
                1
              end
              
              def other_duplicated
                2
              end

              Line is too long. [141/80]
              Open

                          body "Wherewoof is forwarding a message from " + name +  ".The message is " + message + " Track " + receiver + " at " + url + "!"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use the return of the conditional for variable assignment and comparison.
              Open

                  if params[:message]
                    session[:message] = params[:message]
                  else
                    session[:message] = ""
                  end
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use the new Ruby 1.9 hash syntax.
              Open

                      :uid => session[:uid],
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks hash literal syntax.

              It can enforce either the use of the class hash rocket syntax or the use of the newer Ruby 1.9 syntax (when applicable).

              A separate offense is registered for each problematic pair.

              The supported styles are:

              • ruby19 - forces use of the 1.9 syntax (e.g. {a: 1}) when hashes have all symbols for keys
              • hash_rockets - forces use of hash rockets for all hashes
              • nomixedkeys - simply checks for hashes with mixed syntaxes
              • ruby19nomixed_keys - forces use of ruby 1.9 syntax and forbids mixed syntax hashes

              Example: EnforcedStyle: ruby19 (default)

              # bad
              {:a => 2}
              {b: 1, :c => 2}
              
              # good
              {a: 2, b: 1}
              {:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol
              {d: 1, 'e' => 2} # technically not forbidden

              Example: EnforcedStyle: hash_rockets

              # bad
              {a: 1, b: 2}
              {c: 1, 'd' => 5}
              
              # good
              {:a => 1, :b => 2}

              Example: EnforcedStyle: nomixedkeys

              # bad
              {:a => 1, b: 2}
              {c: 1, 'd' => 2}
              
              # good
              {:a => 1, :b => 2}
              {c: 1, d: 2}

              Example: EnforcedStyle: ruby19nomixed_keys

              # bad
              {:a => 1, :b => 2}
              {c: 2, 'd' => 3} # should just use hash rockets
              
              # good
              {a: 1, b: 2}
              {:c => 3, 'd' => 4}

              Use params['name'].length.zero? instead of params['name'].length == 0.
              Open

                      if params['email'].length == 0 or params['name'].length == 0
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for usage of comparison operators (==, >, <) to test numbers as zero, positive, or negative. These can be replaced by their respective predicate methods. The cop can also be configured to do the reverse.

              The cop disregards #nonzero? as it its value is truthy or falsey, but not true and false, and thus not always interchangeable with != 0.

              The cop ignores comparisons to global variables, since they are often populated with objects which can be compared with integers, but are not themselves Interger polymorphic.

              Example: EnforcedStyle: predicate (default)

              # bad
              
              foo == 0
              0 > foo
              bar.baz > 0
              
              # good
              
              foo.zero?
              foo.negative?
              bar.baz.positive?

              Example: EnforcedStyle: comparison

              # bad
              
              foo.zero?
              foo.negative?
              bar.baz.positive?
              
              # good
              
              foo == 0
              0 > foo
              bar.baz > 0

              Surrounding space missing for operator -.
              Open

                        reachHour = (d.slice(0,d.size-3)).to_i
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Checks that operators have space around them, except for ** which should not have surrounding space.

              Example:

              # bad
              total = 3*4
              "apple"+"juice"
              my_number = 38/4
              a ** b
              
              # good
              total = 3 * 4
              "apple" + "juice"
              my_number = 38 / 4
              a**b

              Space inside { missing.
              Open

                      return {lat: @lati, lng: @longi}
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

              Example: EnforcedStyle: space

              # The `space` style enforces that hash literals have
              # surrounding space.
              
              # bad
              h = {a: 1, b: 2}
              
              # good
              h = { a: 1, b: 2 }

              Example: EnforcedStyle: no_space

              # The `no_space` style enforces that hash literals have
              # no surrounding space.
              
              # bad
              h = { a: 1, b: 2 }
              
              # good
              h = {a: 1, b: 2}

              Example: EnforcedStyle: compact

              # The `compact` style normally requires a space inside
              # hash braces, with the exception that successive left
              # braces or right braces are collapsed together in nested hashes.
              
              # bad
              h = { a: { b: 2 } }
              
              # good
              h = { a: { b: 2 }}

              Trailing whitespace detected.
              Open

                
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Method definitions must not be nested. Use lambda instead.
              Open

                  def parseDuration(d)
                    if d
                      if d == 'arrive'
                        return 'Until I arrive'
                      elsif d[d.size-1] == 'm'
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for nested method definitions.

              Example:

              # bad
              
              # `bar` definition actually produces methods in the same scope
              # as the outer `foo` method. Furthermore, the `bar` method
              # will be redefined every time `foo` is invoked.
              def foo
                def bar
                end
              end

              Example:

              # good
              
              def foo
                bar = -> { puts 'hello' }
                bar.call
              end

              Example:

              # good
              
              def foo
                self.class_eval do
                  def bar
                  end
                end
              end
              
              def foo
                self.module_exec do
                  def bar
                  end
                end
              end

              Example:

              # good
              
              def foo
                class << self
                  def bar
                  end
                end
              end

              Method definitions must not be nested. Use lambda instead.
              Open

                  def parseDurationToCheckCondition(d)
                    # return true if condition is met and stop tracking, else return false if keep tracking
                    if d == 'arrive'
                      # print "\n Inside d=='arrive' \n"
                      # print @event.current_lat, @event.current_lng
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for nested method definitions.

              Example:

              # bad
              
              # `bar` definition actually produces methods in the same scope
              # as the outer `foo` method. Furthermore, the `bar` method
              # will be redefined every time `foo` is invoked.
              def foo
                def bar
                end
              end

              Example:

              # good
              
              def foo
                bar = -> { puts 'hello' }
                bar.call
              end

              Example:

              # good
              
              def foo
                self.class_eval do
                  def bar
                  end
                end
              end
              
              def foo
                self.module_exec do
                  def bar
                  end
                end
              end

              Example:

              # good
              
              def foo
                class << self
                  def bar
                  end
                end
              end

              Line is too long. [93/80]
              Open

                    # return true if condition is met and stop tracking, else return false if keep tracking
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use the return of the conditional for variable assignment and comparison.
              Open

                      if @receiver_all
                        @receiver_all = [params['email']] + @receiver_all
                      else
                        @receiver_all = [params['email']]
                      end
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use a guard clause instead of wrapping the code inside a conditional expression.
              Open

                  if session[:address_lat] and session[:address_lng]
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use a guard clause instead of wrapping the code inside a conditional expression

              Example:

              # bad
              def test
                if something
                  work
                end
              end
              
              # good
              def test
                return unless something
                work
              end
              
              # also good
              def test
                work if something
              end
              
              # bad
              if something
                raise 'exception'
              else
                ok
              end
              
              # good
              raise 'exception' if something
              ok

              Use params['name'].length.zero? instead of params['name'].length == 0.
              Open

                      if params['email'].length == 0 or params['name'].length == 0
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for usage of comparison operators (==, >, <) to test numbers as zero, positive, or negative. These can be replaced by their respective predicate methods. The cop can also be configured to do the reverse.

              The cop disregards #nonzero? as it its value is truthy or falsey, but not true and false, and thus not always interchangeable with != 0.

              The cop ignores comparisons to global variables, since they are often populated with objects which can be compared with integers, but are not themselves Interger polymorphic.

              Example: EnforcedStyle: predicate (default)

              # bad
              
              foo == 0
              0 > foo
              bar.baz > 0
              
              # good
              
              foo.zero?
              foo.negative?
              bar.baz.positive?

              Example: EnforcedStyle: comparison

              # bad
              
              foo.zero?
              foo.negative?
              bar.baz.positive?
              
              # good
              
              foo == 0
              0 > foo
              bar.baz > 0

              Surrounding space missing for operator +.
              Open

                        return 'For '+d
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Checks that operators have space around them, except for ** which should not have surrounding space.

              Example:

              # bad
              total = 3*4
              "apple"+"juice"
              my_number = 38/4
              a ** b
              
              # good
              total = 3 * 4
              "apple" + "juice"
              my_number = 38 / 4
              a**b

              Line is too long. [101/80]
              Open

                  # render text: "<script>window.location = '#{event_select_duration_path}';</script>", status: 200
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use the new Ruby 1.9 hash syntax.
              Open

                      :active => true,
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks hash literal syntax.

              It can enforce either the use of the class hash rocket syntax or the use of the newer Ruby 1.9 syntax (when applicable).

              A separate offense is registered for each problematic pair.

              The supported styles are:

              • ruby19 - forces use of the 1.9 syntax (e.g. {a: 1}) when hashes have all symbols for keys
              • hash_rockets - forces use of hash rockets for all hashes
              • nomixedkeys - simply checks for hashes with mixed syntaxes
              • ruby19nomixed_keys - forces use of ruby 1.9 syntax and forbids mixed syntax hashes

              Example: EnforcedStyle: ruby19 (default)

              # bad
              {:a => 2}
              {b: 1, :c => 2}
              
              # good
              {a: 2, b: 1}
              {:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol
              {d: 1, 'e' => 2} # technically not forbidden

              Example: EnforcedStyle: hash_rockets

              # bad
              {a: 1, b: 2}
              {c: 1, 'd' => 5}
              
              # good
              {:a => 1, :b => 2}

              Example: EnforcedStyle: nomixedkeys

              # bad
              {:a => 1, b: 2}
              {c: 1, 'd' => 2}
              
              # good
              {:a => 1, :b => 2}
              {c: 1, d: 2}

              Example: EnforcedStyle: ruby19nomixed_keys

              # bad
              {:a => 1, :b => 2}
              {c: 2, 'd' => 3} # should just use hash rockets
              
              # good
              {a: 1, b: 2}
              {:c => 3, 'd' => 4}

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

                  if @address_lat == "37.7749" and @address_lat == "-122.4194"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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

                        subject "Welcome to wherewoof " + message
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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

                          body "Wherewoof is forwarding a message from " + name +  ".The message is " + message + " Track " + receiver + " at " + url + "!"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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 empty? instead of length == 0.
              Open

                      if params['email'].length == 0 or params['name'].length == 0
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for numeric comparisons that can be replaced by a predicate method, such as receiver.length == 0, receiver.length > 0, receiver.length != 0, receiver.length < 1 and receiver.size == 0 that can be replaced by receiver.empty? and !receiver.empty.

              Example:

              # bad
              [1, 2, 3].length == 0
              0 == "foobar".length
              array.length < 1
              {a: 1, b: 2}.length != 0
              string.length > 0
              hash.size > 0
              
              # good
              [1, 2, 3].empty?
              "foobar".empty?
              array.empty?
              !{a: 1, b: 2}.empty?
              !string.empty?
              !hash.empty?

              Use empty? instead of length == 0.
              Open

                      if params['email'].length == 0 or params['name'].length == 0
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for numeric comparisons that can be replaced by a predicate method, such as receiver.length == 0, receiver.length > 0, receiver.length != 0, receiver.length < 1 and receiver.size == 0 that can be replaced by receiver.empty? and !receiver.empty.

              Example:

              # bad
              [1, 2, 3].length == 0
              0 == "foobar".length
              array.length < 1
              {a: 1, b: 2}.length != 0
              string.length > 0
              hash.size > 0
              
              # good
              [1, 2, 3].empty?
              "foobar".empty?
              array.empty?
              !{a: 1, b: 2}.empty?
              !string.empty?
              !hash.empty?

              Redundant return detected.
              Open

                      return (hour == reachHour and minutes == 0)
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for redundant return expressions.

              Example:

              def test
                return something
              end
              
              def test
                one
                two
                three
                return something
              end

              It should be extended to handle methods whose body is if/else or a case expression with a default branch.

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

                          body "Wherewoof is forwarding a message from " + name +  ".The message is " + message + " Track " + receiver + " at " + url + "!"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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"

              Redundant return detected.
              Open

                      return nil
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for redundant return expressions.

              Example:

              def test
                return something
              end
              
              def test
                one
                two
                three
                return something
              end

              It should be extended to handle methods whose body is if/else or a case expression with a default branch.

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

                          body "Wherewoof is forwarding a message from " + name +  ".The message is " + message + " Track " + receiver + " at " + url + "!"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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 !empty? instead of length > 0.
              Open

                  if @receiver.length > 0 and @receiver_name.length > 0
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for numeric comparisons that can be replaced by a predicate method, such as receiver.length == 0, receiver.length > 0, receiver.length != 0, receiver.length < 1 and receiver.size == 0 that can be replaced by receiver.empty? and !receiver.empty.

              Example:

              # bad
              [1, 2, 3].length == 0
              0 == "foobar".length
              array.length < 1
              {a: 1, b: 2}.length != 0
              string.length > 0
              hash.size > 0
              
              # good
              [1, 2, 3].empty?
              "foobar".empty?
              array.empty?
              !{a: 1, b: 2}.empty?
              !string.empty?
              !hash.empty?

              Surrounding space missing for operator /.
              Open

                      stop_dist = 50/1600.0
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Checks that operators have space around them, except for ** which should not have surrounding space.

              Example:

              # bad
              total = 3*4
              "apple"+"juice"
              my_number = 38/4
              a ** b
              
              # good
              total = 3 * 4
              "apple" + "juice"
              my_number = 38 / 4
              a**b

              Line is too long. [125/80]
              Open

                  @receiver_name = if session[:receiver_name].is_a?(String) then [session[:receiver_name]] else session[:receiver_name] end
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use a guard clause instead of wrapping the code inside a conditional expression.
              Open

                  if @receiver.length > 0 and @receiver_name.length > 0
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use a guard clause instead of wrapping the code inside a conditional expression

              Example:

              # bad
              def test
                if something
                  work
                end
              end
              
              # good
              def test
                return unless something
                work
              end
              
              # also good
              def test
                work if something
              end
              
              # bad
              if something
                raise 'exception'
              else
                ok
              end
              
              # good
              raise 'exception' if something
              ok

              Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||.
              Open

                  if name == nil
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Checks for if and unless statements that would fit on one line if written as a modifier if/unless. The maximum line length is configured in the Metrics/LineLength cop.

              Example:

              # bad
              if condition
                do_stuff(bar)
              end
              
              unless qux.empty?
                Foo.do_something
              end
              
              # good
              do_stuff(bar) if condition
              Foo.do_something unless qux.empty?

              Use ! instead of not.
              Open

                    if not e.message.to_s.empty?
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for uses of the keyword not instead of !.

              Example:

              # bad - parentheses are required because of op precedence
              x = (not something)
              
              # good
              x = !something

              Missing space after #.
              Open

                #attr_accessor :latitud
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

              Example:

              # bad
              #Some comment
              
              # good
              # Some comment

              Missing space after #.
              Open

                      #logger.debug "latlong = #{@latlong}"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

              Example:

              # bad
              #Some comment
              
              # good
              # Some comment

              Favor the ternary operator (?:) over if/then/else/end constructs.
              Open

                  @receiver = if session[:receiver].is_a?(String) then [session[:receiver]] else session[:receiver] end
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

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

                    name = "an unspecified user"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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

                        subject "Welcome to wherewoof" 
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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

                    logger.debug "Something is wrong"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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

                    name = "unspecified user"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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"

              Pass &:message as an argument to uniq instead of a block.
              Open

                  @messagehistory = @messagehistory.uniq { |p| p.message }
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use symbols as procs when possible.

              Example:

              # bad
              something.map { |s| s.upcase }
              
              # good
              something.map(&:upcase)

              Use empty? instead of length == 0.
              Open

                      if params['email'].length == 0 or params['name'].length == 0
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for numeric comparisons that can be replaced by a predicate method, such as receiver.length == 0, receiver.length > 0, receiver.length != 0, receiver.length < 1 and receiver.size == 0 that can be replaced by receiver.empty? and !receiver.empty.

              Example:

              # bad
              [1, 2, 3].length == 0
              0 == "foobar".length
              array.length < 1
              {a: 1, b: 2}.length != 0
              string.length > 0
              hash.size > 0
              
              # good
              [1, 2, 3].empty?
              "foobar".empty?
              array.empty?
              !{a: 1, b: 2}.empty?
              !string.empty?
              !hash.empty?

              Redundant return detected.
              Open

                        return 'Until '+d
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for redundant return expressions.

              Example:

              def test
                return something
              end
              
              def test
                one
                two
                three
                return something
              end

              It should be extended to handle methods whose body is if/else or a case expression with a default branch.

              Redundant return detected.
              Open

                      return nil
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for redundant return expressions.

              Example:

              def test
                return something
              end
              
              def test
                one
                two
                three
                return something
              end

              It should be extended to handle methods whose body is if/else or a case expression with a default branch.

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

                    @address_lng = "-"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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

                  session['url'] = "http://wherewoof.herokuapp.com/event/receiver_map/" + @event.id.to_s
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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

                          body "Wherewoof is forwarding a message from " + name +  ".The message is " + message + " Track " + receiver + " at " + url + "!"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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

                          body "Wherewoof is forwarding a message from " + name +  ".The message is " + message + " Track " + receiver + " at " + url + "!"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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

                  logger.debug "In store_destination"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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

                      name = ""
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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

                          body "Wherewoof is forwarding a message from " + name +  ".The message is " + message + " Track " + receiver + " at " + url + "!"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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"

              Don't use parentheses around a method call.
              Open

                        reachHour = (d.slice(0,d.size-3)).to_i
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for redundant parentheses.

              Example:

              # bad
              (x) if ((y.z).nil?)
              
              # good
              x if y.z.nil?

              Redundant return detected.
              Open

                      return current_distance < stop_dist
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for redundant return expressions.

              Example:

              def test
                return something
              end
              
              def test
                one
                two
                three
                return something
              end

              It should be extended to handle methods whose body is if/else or a case expression with a default branch.

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

                  logger.debug "In store_contacts"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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

                          body "Wherewoof is forwarding a message from " + name +  ".The message is " + message + " Track " + receiver + " at " + url + "!"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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

                    logger.debug "duration"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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

                          body "Wherewoof is forwarding a message from " + name +  ".The message is " + message + " Track " + receiver + " at " + url + "!"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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"

              Redundant return detected.
              Open

                      return (@event.created_at.to_time + num_hours.hours) < Time.now
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for redundant return expressions.

              Example:

              def test
                return something
              end
              
              def test
                one
                two
                three
                return something
              end

              It should be extended to handle methods whose body is if/else or a case expression with a default branch.

              Don't use parentheses around a method call.
              Open

                        reachHour = (d.slice(0,d.size-3)).to_i + 12
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for redundant parentheses.

              Example:

              # bad
              (x) if ((y.z).nil?)
              
              # good
              x if y.z.nil?

              Use empty? instead of length == 0.
              Open

                      if params['email'].length == 0 or params['name'].length == 0
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for numeric comparisons that can be replaced by a predicate method, such as receiver.length == 0, receiver.length > 0, receiver.length != 0, receiver.length < 1 and receiver.size == 0 that can be replaced by receiver.empty? and !receiver.empty.

              Example:

              # bad
              [1, 2, 3].length == 0
              0 == "foobar".length
              array.length < 1
              {a: 1, b: 2}.length != 0
              string.length > 0
              hash.size > 0
              
              # good
              [1, 2, 3].empty?
              "foobar".empty?
              array.empty?
              !{a: 1, b: 2}.empty?
              !string.empty?
              !hash.empty?

              Line is too long. [107/80]
              Open

                  params.require(:event).permit(:address_lat, :address_lng, :receiver, :duration_setting, :uid, :message)
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Line is too long. [99/80]
              Open

                  render text: "<script>window.location = '#{event_select_contacts_path}';</script>", status: 200
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use || instead of or.
              Open

                      if params['email'].length == 0 or params['name'].length == 0
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for uses of and and or, and suggests using && and || instead. It can be configured to check only in conditions, or in all contexts.

              Example: EnforcedStyle: always (default)

              # bad
              foo.save and return
              
              # bad
              if foo and bar
              end
              
              # good
              foo.save && return
              
              # good
              if foo && bar
              end

              Example: EnforcedStyle: conditionals

              # bad
              if foo and bar
              end
              
              # good
              foo.save && return
              
              # good
              foo.save and return
              
              # good
              if foo && bar
              end

              Use the return of the conditional for variable assignment and comparison.
              Open

                  if session[:message]
                    @message = session[:message]
                  else
                    @message = nil
                  end
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use a guard clause instead of wrapping the code inside a conditional expression.
              Open

                    if d
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Use a guard clause instead of wrapping the code inside a conditional expression

              Example:

              # bad
              def test
                if something
                  work
                end
              end
              
              # good
              def test
                return unless something
                work
              end
              
              # also good
              def test
                work if something
              end
              
              # bad
              if something
                raise 'exception'
              else
                ok
              end
              
              # good
              raise 'exception' if something
              ok

              Use the new Ruby 1.9 hash syntax.
              Open

                    @data = {:lat => @lati, :lng => @longi}
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks hash literal syntax.

              It can enforce either the use of the class hash rocket syntax or the use of the newer Ruby 1.9 syntax (when applicable).

              A separate offense is registered for each problematic pair.

              The supported styles are:

              • ruby19 - forces use of the 1.9 syntax (e.g. {a: 1}) when hashes have all symbols for keys
              • hash_rockets - forces use of hash rockets for all hashes
              • nomixedkeys - simply checks for hashes with mixed syntaxes
              • ruby19nomixed_keys - forces use of ruby 1.9 syntax and forbids mixed syntax hashes

              Example: EnforcedStyle: ruby19 (default)

              # bad
              {:a => 2}
              {b: 1, :c => 2}
              
              # good
              {a: 2, b: 1}
              {:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol
              {d: 1, 'e' => 2} # technically not forbidden

              Example: EnforcedStyle: hash_rockets

              # bad
              {a: 1, b: 2}
              {c: 1, 'd' => 5}
              
              # good
              {:a => 1, :b => 2}

              Example: EnforcedStyle: nomixedkeys

              # bad
              {:a => 1, b: 2}
              {c: 1, 'd' => 2}
              
              # good
              {:a => 1, :b => 2}
              {c: 1, d: 2}

              Example: EnforcedStyle: ruby19nomixed_keys

              # bad
              {:a => 1, :b => 2}
              {c: 2, 'd' => 3} # should just use hash rockets
              
              # good
              {a: 1, b: 2}
              {:c => 3, 'd' => 4}

              Favor unless over if for negative conditions.
              Open

                    if not e.message.to_s.empty?
                      logger.debug "message: #{e.message}"
                      @messagehistory << e
                    end
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Checks for uses of if with a negated condition. Only ifs without else are considered. There are three different styles:

              - both
              - prefix
              - postfix

              Example: EnforcedStyle: both (default)

              # enforces `unless` for `prefix` and `postfix` conditionals
              
              # bad
              
              if !foo
                bar
              end
              
              # good
              
              unless foo
                bar
              end
              
              # bad
              
              bar if !foo
              
              # good
              
              bar unless foo

              Example: EnforcedStyle: prefix

              # enforces `unless` for just `prefix` conditionals
              
              # bad
              
              if !foo
                bar
              end
              
              # good
              
              unless foo
                bar
              end
              
              # good
              
              bar if !foo

              Example: EnforcedStyle: postfix

              # enforces `unless` for just `postfix` conditionals
              
              # bad
              
              bar if !foo
              
              # good
              
              bar unless foo
              
              # good
              
              if !foo
                bar
              end

              Prefer the use of the nil? predicate.
              Open

                  if name == nil
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for comparison of something with nil using ==.

              Example:

              # bad
              if x == nil
              end
              
              # good
              if x.nil?
              end

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

                          body "Wherewoof is forwarding a message from " + name +  ".The message is " + message + " Track " + receiver + " at " + url + "!"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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"

              Favor the ternary operator (?:) over if/then/else/end constructs.
              Open

                  @receiver_name = if session[:receiver_name].is_a?(String) then [session[:receiver_name]] else session[:receiver_name] end
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              Redundant return detected.
              Open

                        return 'Until I arrive'
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for redundant return expressions.

              Example:

              def test
                return something
              end
              
              def test
                one
                two
                three
                return something
              end

              It should be extended to handle methods whose body is if/else or a case expression with a default branch.

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

                  if @address_lat == "37.7749" and @address_lat == "-122.4194"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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

                    @address_lat = "-"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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 !empty? instead of length > 0.
              Open

                  if @receiver.length > 0 and @receiver_name.length > 0
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for numeric comparisons that can be replaced by a predicate method, such as receiver.length == 0, receiver.length > 0, receiver.length != 0, receiver.length < 1 and receiver.size == 0 that can be replaced by receiver.empty? and !receiver.empty.

              Example:

              # bad
              [1, 2, 3].length == 0
              0 == "foobar".length
              array.length < 1
              {a: 1, b: 2}.length != 0
              string.length > 0
              hash.size > 0
              
              # good
              [1, 2, 3].empty?
              "foobar".empty?
              array.empty?
              !{a: 1, b: 2}.empty?
              !string.empty?
              !hash.empty?

              Redundant return detected.
              Open

                        return 'For '+d
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for redundant return expressions.

              Example:

              def test
                return something
              end
              
              def test
                one
                two
                three
                return something
              end

              It should be extended to handle methods whose body is if/else or a case expression with a default branch.

              Redundant return detected.
              Open

                        return nil
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              This cop checks for redundant return expressions.

              Example:

              def test
                return something
              end
              
              def test
                one
                two
                three
                return something
              end

              It should be extended to handle methods whose body is if/else or a case expression with a default branch.

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

                  puts "HELLO"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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

                    session[:message] = ""
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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

                        print "stop"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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

                        print "continue"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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

                          body "Wherewoof is forwarding a message from " + name +  ".The message is " + message + " Track " + receiver + " at " + url + "!"
              Severity: Minor
              Found in app/controllers/event_controller.rb by rubocop

              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"

              There are no issues that match your filters.

              Category
              Status