claytron/augury

View on GitHub

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
Severity: Minor
Found in lib/augury/fortune.rb - About 45 mins to fix

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
Severity: Minor
Found in lib/augury/fortune.rb - About 25 mins to fix

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]
 
 
Severity: Minor
Found in lib/augury/fortune.rb - About 25 mins to fix

Use anonymous block forwarding.
Open

collect_with_max_id(collection, response.last.id - 1, &block)
Severity: Minor
Found in lib/augury/fortune.rb by rubocop

Use anonymous block forwarding.
Open

def collect_with_max_id(collection = [], max_id = nil, &block)
Severity: Minor
Found in lib/augury/fortune.rb by rubocop
Severity
Category
Status
Source
Language