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 |
# File 'lib/necropsy/runner.rb', line 13 def analyze project = Project.new(root: root, config: config) graph = CallGraph.new(project.scan_result) apply_entry_points(graph, project) configured_analyzers.each do |analyzer| graph.add_profile(analyzer.profile) graph.apply_result(analyzer.analyze(graph, project)) end 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) end |