RUBYCRITIC
module ApplicationHelper - ApplicationHelper has no descriptive comment
include Pagy::Frontend
def embedded_svg(filename, options = {}) - ApplicationHelper#embedded_svg has approx 8 statements
assets = Rails.application.assets
asset = assets.find_asset(filename)
if asset
file = asset.source.force_encoding("UTF-8")
doc = Nokogiri::HTML::DocumentFragment.parse file
svg = doc.at_css "svg"
svg["class"] = options[:class] if options[:class].present? - ApplicationHelper#embedded_svg calls 'options[:class]' 2 times
- ApplicationHelper#embedded_svg refers to 'options' more than self (maybe move it to another class?)
else
doc = "<!-- SVG #{filename} not found -->"
end
raw doc
end
end