decko-commons/decko

View on GitHub
mod/format/set/all/haml.rb

Summary

Maintainability
A
0 mins
Test Coverage

Use caller_locations(3..3).first instead of caller_locations[2].
Open

    base_path = locals.delete(:template_path) || caller_locations[2].path
Severity: Minor
Found in mod/format/set/all/haml.rb by rubocop

This cop identifies places where caller[n] can be replaced by caller(n..n).first.

Example:

# bad
caller[1]
caller.first
caller_locations[1]
caller_locations.first

# good
caller(2..2).first
caller(1..1).first
caller_locations(2..2).first
caller_locations(1..1).first

There are no issues that match your filters.

Category
Status