Class: AbideDevUtils::Sce::Generate::CoverageReport::BenchmarkReport

Inherits:
Object
  • Object
show all
Defined in:
lib/abide_dev_utils/sce/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.



247
248
249
250
251
252
# File 'lib/abide_dev_utils/sce/generate/coverage_report.rb', line 247

def initialize(benchmark, opts = ReportOptions.new)
  @benchmark = benchmark
  @opts = opts
  @special_control_names = %w[sce_options sce_protected]
  @stig_map_types = %w[vulnid ruleid]
end

Instance Method Details

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



266
267
268
269
270
# File 'lib/abide_dev_utils/sce/generate/coverage_report.rb', line 266

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, profile: profile, level: level)
end

#controls_in_mapping_dataObject



262
263
264
# File 'lib/abide_dev_utils/sce/generate/coverage_report.rb', line 262

def controls_in_mapping_data
  @controls_in_mapping_data ||= find_controls_in_mapping_data
end

#controls_in_resource_dataObject



258
259
260
# File 'lib/abide_dev_utils/sce/generate/coverage_report.rb', line 258

def controls_in_resource_data
  @controls_in_resource_data ||= find_controls_in_resource_data
end

#runObject



254
255
256
# File 'lib/abide_dev_utils/sce/generate/coverage_report.rb', line 254

def run
  send(@opts.report_type)
end