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