Class: Necropsy::Runner
- Inherits:
-
Object
- Object
- Necropsy::Runner
- Defined in:
- lib/necropsy/runner.rb
Instance Attribute Summary collapse
-
#analyzers ⇒ Object
readonly
Returns the value of attribute analyzers.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
- #analyze ⇒ Object
-
#initialize(root:, config_path: nil, analyzers: nil) ⇒ Runner
constructor
A new instance of Runner.
Constructor Details
#initialize(root:, config_path: nil, analyzers: nil) ⇒ Runner
Returns a new instance of Runner.
7 8 9 10 11 |
# File 'lib/necropsy/runner.rb', line 7 def initialize(root:, config_path: nil, analyzers: nil) @root = File.(root) @config = Configuration.load(root: @root, path: config_path) @analyzers = analyzers end |
Instance Attribute Details
#analyzers ⇒ Object (readonly)
Returns the value of attribute analyzers.
5 6 7 |
# File 'lib/necropsy/runner.rb', line 5 def analyzers @analyzers end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
5 6 7 |
# File 'lib/necropsy/runner.rb', line 5 def config @config end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
5 6 7 |
# File 'lib/necropsy/runner.rb', line 5 def root @root end |
Instance Method Details
#analyze ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/necropsy/runner.rb', line 13 def analyze project = Project.new(root: root, config: config) graph = CallGraph.new(project.scan_result, ambiguity_limit: config.ambiguity_limit) rta_results = [] apply_entry_points(graph, project) configured_analyzers.each do |analyzer| graph.add_profile(analyzer.profile) result = analyzer.analyze(graph, project) graph.apply_result(result) rta_results << result if analyzer.profile.name == :rta end rta_results.each { |result| graph.reconcile_rta_result(result) } reachability = Reachability::Engine.new(graph).call findings = Confidence::Scorer.new(graph: graph, reachability: reachability, project: project).findings Report.new( root: root, graph: graph, findings: findings, reachability: reachability, report_include_paths: config.report_include_paths, report_exclude_paths: config.report_exclude_paths ) end |