ManageIQ/manageiq

View on GitHub
app/models/time_profile.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
92%

private (on line 157) does not make singleton methods private. Use private_class_method or private inside a class << self block instead.
Open

  def self.profile_for_user_tz(user_id, user_tz)
Severity: Minor
Found in app/models/time_profile.rb by rubocop

Checks for private or protected access modifiers which are applied to a singleton method. These access modifiers do not make singleton methods private/protected. private_class_method can be used for that.

Example:

# bad

class C
  private

  def self.method
    puts 'hi'
  end
end

Example:

# good

class C
  def self.method
    puts 'hi'
  end

  private_class_method :method
end

Example:

# good

class C
  class << self
    private

    def method
      puts 'hi'
    end
  end
end

private (on line 157) does not make singleton methods private. Use private_class_method or private inside a class << self block instead.
Open

  def self.ordered_by_desc
Severity: Minor
Found in app/models/time_profile.rb by rubocop

Checks for private or protected access modifiers which are applied to a singleton method. These access modifiers do not make singleton methods private/protected. private_class_method can be used for that.

Example:

# bad

class C
  private

  def self.method
    puts 'hi'
  end
end

Example:

# good

class C
  def self.method
    puts 'hi'
  end

  private_class_method :method
end

Example:

# good

class C
  class << self
    private

    def method
      puts 'hi'
    end
  end
end

private (on line 157) does not make singleton methods private. Use private_class_method or private inside a class << self block instead.
Open

  def self.for_user(user_id)
Severity: Minor
Found in app/models/time_profile.rb by rubocop

Checks for private or protected access modifiers which are applied to a singleton method. These access modifiers do not make singleton methods private/protected. private_class_method can be used for that.

Example:

# bad

class C
  private

  def self.method
    puts 'hi'
  end
end

Example:

# good

class C
  def self.method
    puts 'hi'
  end

  private_class_method :method
end

Example:

# good

class C
  class << self
    private

    def method
      puts 'hi'
    end
  end
end

private (on line 157) does not make singleton methods private. Use private_class_method or private inside a class << self block instead.
Open

  def self.default_time_profile(tz = DEFAULT_TZ)
Severity: Minor
Found in app/models/time_profile.rb by rubocop

Checks for private or protected access modifiers which are applied to a singleton method. These access modifiers do not make singleton methods private/protected. private_class_method can be used for that.

Example:

# bad

class C
  private

  def self.method
    puts 'hi'
  end
end

Example:

# good

class C
  def self.method
    puts 'hi'
  end

  private_class_method :method
end

Example:

# good

class C
  class << self
    private

    def method
      puts 'hi'
    end
  end
end

private (on line 157) does not make singleton methods private. Use private_class_method or private inside a class << self block instead.
Open

  def self.profiles_for_user(user_id, region_id)
Severity: Minor
Found in app/models/time_profile.rb by rubocop

Checks for private or protected access modifiers which are applied to a singleton method. These access modifiers do not make singleton methods private/protected. private_class_method can be used for that.

Example:

# bad

class C
  private

  def self.method
    puts 'hi'
  end
end

Example:

# good

class C
  def self.method
    puts 'hi'
  end

  private_class_method :method
end

Example:

# good

class C
  class << self
    private

    def method
      puts 'hi'
    end
  end
end

There are no issues that match your filters.

Category
Status