Class: CC::Analyzer::Formatters::HTMLFormatter::IssueCollection

Inherits:
Object
  • Object
show all
Defined in:
lib/cc/analyzer/formatters/html_formatter.rb

Instance Method Summary collapse

Constructor Details

#initialize(filesystem) ⇒ IssueCollection

Returns a new instance of IssueCollection.



319
320
321
322
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 319

def initialize(filesystem)
  @collection = []
  @filesystem = filesystem
end

Instance Method Details

#<<(issue) ⇒ Object



328
329
330
331
332
333
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 328

def <<(issue)
  if issue.is_a? Hash
    issue = Issue.new(issue, filesystem)
  end
  collection.push(issue)
end

#any?Boolean

Returns:

  • (Boolean)


335
336
337
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 335

def any?
  collection.any?
end

#categoriesObject



345
346
347
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 345

def categories
  collection.flat_map(&:categories).uniq.sort
end

#each(&block) ⇒ Object



324
325
326
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 324

def each(&block)
  collection.each(&block)
end

#enginesObject



349
350
351
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 349

def engines
  collection.map(&:engine_name).uniq.compact.sort
end

#syntaxesObject



339
340
341
342
343
# File 'lib/cc/analyzer/formatters/html_formatter.rb', line 339

def syntaxes
  collection.flat_map do |issue|
    issue.source.syntaxes
  end.uniq.sort
end