Eclipse (RedRails) complain about "Feature envy" in the following code:
if input_text =~ /^(---\s*\n.*?\n?)(---.*?)/m
content_text = input_text[($1.size + $2.size)..-1] # warning in $1
header = YAML.load($1)
@content = content_text.strip()
@title = header["title"]
end
My understanding is that I safe to ignore this warning. But I am wander why this warning generated. I cannot understand how I can extract method for $1.size and $1. Pls, explain.