lawrencechanyewlong/wherewolfpro

View on GitHub

Showing 767 of 767 total issues

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.

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

    def self.toDurationString(duration_setting)
        if duration_setting == 'arrive'
            return "Until I Arrive"
        elsif duration_setting[-4..-1] == 'hour' or duration_setting[-5..-1] == 'hours'
            if duration_setting[1] == ' '
Severity: Minor
Found in app/helpers/welcome_helper.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

    Assignment Branch Condition size for toDurationString is too high. [33.26/15]
    Open

        def self.toDurationString(duration_setting)
            if duration_setting == 'arrive'
                return "Until I Arrive"
            elsif duration_setting[-4..-1] == 'hour' or duration_setting[-5..-1] == 'hours'
                if duration_setting[1] == ' '
    Severity: Minor
    Found in app/helpers/welcome_helper.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. [25/10]
    Open

      def third_party
        contacts = request.env['omnicontacts.contacts']
        user_data = request.env['omnicontacts.user']
        name = user_data[:name]
        email = user_data[:email]
    Severity: Minor
    Found in app/controllers/users_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. [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.

    Assignment Branch Condition size for third_party is too high. [29.75/15]
    Open

      def third_party
        contacts = request.env['omnicontacts.contacts']
        user_data = request.env['omnicontacts.user']
        name = user_data[:name]
        email = user_data[:email]
    Severity: Minor
    Found in app/controllers/users_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

    Severity
    Category
    Status
    Source
    Language