Updated

app/helpers / social_meta_helper.rb

B
21 lines of codes
2 methods
10.1 complexity/method
2 churn
20.14 complexity
88 duplications
module SocialMetaHelper
  1. SocialMetaHelper has no descriptive comment
def open_graph_tag(name, content, interpolation = {})
  1. Similar code found in 2 nodes Locations: 0 1
if Symbol === content tag(:meta, property: "og:#{name}", content: t(content, interpolation.merge(scope: :'metadata.open_graph'))) elsif name == 'image' tag(:meta, property: "og:image", content: url_to_image(content)) else tag(:meta, property: "og:#{name}", content: content) end end def twitter_card_tag(name, content, interpolation = {})
  1. Similar code found in 2 nodes Locations: 0 1
if Symbol === content tag(:meta, name: "twitter:#{name}", content: t(content, interpolation.merge(scope: :'metadata.twitter'))) elsif name == 'image' tag(:meta, name: "twitter:image", content: url_to_image(content)) else tag(:meta, name: "twitter:#{name}", content: content) end end end