Method truncate_array
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
def truncate_array(string_array, limit = nil, separator = "")
return string_array if limit.nil? || limit <= 0
length = 0
result = []
Method truncate_title
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def truncate_title(site_title, title, separator)
global_limit = MetaTags.config.title_limit.to_i
if global_limit > 0
site_title_limited_length, title_limited_length = calculate_title_limits(
site_title, title, separator, global_limit
Method render_alternate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def render_alternate(tags)
alternate = meta_tags.extract(:alternate)
return unless alternate
if alternate.is_a?(Hash)
Method calculate_title_limits
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
def calculate_title_limits(site_title, title, separator, global_limit)
main_title = MetaTags.config.truncate_site_title_first ? title : [site_title]
main_length = main_title.map(&:length).sum + ((main_title.size - 1) * separator.length)
Method process_hash
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
def process_hash(tags, property, content, **opts)
itemprop = content.delete(:itemprop)
content.each do |key, value|
if key.to_s == "_"
iprop = itemprop