Method collect_with_max_id
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
def collect_with_max_id(collection = [], max_id = nil, &block)
response = yield(max_id)
collection += response
if response.empty?
collection
Method format_fortune
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
def format_fortune
filtered = @tweets.flat_map(&:full_text).reject do |tweet|
tweet.match(/https?:/) unless @config[:links]
end
to_transform = transforms
Method transforms
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
def transforms
all_transforms = []
all_transforms << [%r{https?://[^\s]+}, ''] if @config[:remove_links]
return all_transforms unless @config[:apply_transforms]