Class: AbideDevUtils::CEM::Generate::CoverageReport::BenchmarkReport

Inherits:
Object
  • Object
show all
Defined in:
lib/abide_dev_utils/cem/generate/coverage_report.rb

Overview

Creates ReportOutput objects based on the given Benchmark

Instance Method Summary collapse

Constructor Details

#initialize(benchmark, opts = ReportOptions.new) ⇒ BenchmarkReport

Returns a new instance of BenchmarkReport.



307
308
309
310
# File 'lib/abide_dev_utils/cem/generate/coverage_report.rb', line 307

def initialize(benchmark, opts = ReportOptions.new)
  @benchmark = benchmark
  @opts = opts
end

Instance Method Details

#basic_coverage(level: @opts.level, profile: @opts.profile) ⇒ Object



324
325
326
327
328
# File 'lib/abide_dev_utils/cem/generate/coverage_report.rb', line 324

def basic_coverage(level: @opts.level, profile: @opts.profile)
  map_type = @benchmark.map_type(controls_in_resource_data[0])
  rules_in_map = @benchmark.rules_in_map(map_type, level: level, profile: profile)
  ReportOutput.new(@benchmark, controls_in_resource_data, rules_in_map)
end

#controls_in_mapping_dataObject



320
321
322
# File 'lib/abide_dev_utils/cem/generate/coverage_report.rb', line 320

def controls_in_mapping_data
  @controls_in_mapping_data ||= find_controls_in_mapping_data
end

#controls_in_resource_dataObject



316
317
318
# File 'lib/abide_dev_utils/cem/generate/coverage_report.rb', line 316

def controls_in_resource_data
  @controls_in_resource_data ||= find_controls_in_resource_data
end

#runObject



312
313
314
# File 'lib/abide_dev_utils/cem/generate/coverage_report.rb', line 312

def run
  send(@opts.report_type)
end