jain-nikunj/room-reservation-app

View on GitHub
app/models/building.rb

Summary

Maintainability
A
0 mins
Test Coverage

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

  def query_gmap
    url = URI.parse("http://maps.googleapis.com/maps/api/geocode/json?\
                     key=#{ENV['GOOGLE_API_KEY']}&
                     address=${name}%20Hall%20Berkeley")
    req = Net::HTTP::Get.new(url.to_s)
Severity: Minor
Found in app/models/building.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 query_gmap is too high. [19.42/15]
Open

  def query_gmap
    url = URI.parse("http://maps.googleapis.com/maps/api/geocode/json?\
                     key=#{ENV['GOOGLE_API_KEY']}&
                     address=${name}%20Hall%20Berkeley")
    req = Net::HTTP::Get.new(url.to_s)
Severity: Minor
Found in app/models/building.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

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

    if lat && lng
Severity: Minor
Found in app/models/building.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?

There are no issues that match your filters.

Category
Status