Class: Necropsy::Confidence::Scorer
- Inherits:
-
Object
- Object
- Necropsy::Confidence::Scorer
- Defined in:
- lib/necropsy/confidence/scorer.rb
Instance Method Summary collapse
- #findings ⇒ Object
-
#initialize(graph:, reachability:, project:) ⇒ Scorer
constructor
A new instance of Scorer.
Constructor Details
#initialize(graph:, reachability:, project:) ⇒ Scorer
Returns a new instance of Scorer.
8 9 10 11 12 |
# File 'lib/necropsy/confidence/scorer.rb', line 8 def initialize(graph:, reachability:, project:) @graph = graph @reachability = reachability @project = project end |
Instance Method Details
#findings ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/necropsy/confidence/scorer.rb', line 14 def findings graph.method_nodes.filter_map do |node| next if node.test classification = classification_for(node) next unless classification score, level, reasons = score_for(node, classification) Finding.new( node: node, classification: classification, confidence: level, score: score, reasons: reasons, evidences: graph.incoming_edges(node.id).flat_map(&:evidences) + graph.alive_evidences(node.id) ) end end |