Module: Necropsy::BlockerMatching

Included in:
CallGraph
Defined in:
lib/necropsy/graph/blocker_matching.rb

Instance Method Summary collapse

Instance Method Details

#add_blocker(blocker) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/necropsy/graph/blocker_matching.rb', line 9

def add_blocker(blocker)
  blocker, key = canonical_blocker(blocker)
  return blocker unless @blocker_keys.add?(key)

  @dynamic_ancestry_cache = {} if blocker.kind == :dynamic_ancestry
  @blockers << blocker
  @blocker_keys_by_object[blocker] = key
  index_blocker(blocker)
  blocker
end

#blockersObject



5
6
7
# File 'lib/necropsy/graph/blocker_matching.rb', line 5

def blockers
  @blockers.dup
end

#matching_blockers(node_or_id, caller_domain: :runtime) ⇒ Object

Test-source uncertainty is diagnostic-only for production findings. A test call site cannot make a production definition callable in the deployed app.



22
23
24
25
26
27
28
29
# File 'lib/necropsy/graph/blocker_matching.rb', line 22

def matching_blockers(node_or_id, caller_domain: :runtime)
  node = node_or_id.is_a?(Node) ? node_or_id : nodes[node_or_id]
  return [] unless node

  blocker_candidates(node).select do |blocker|
    blocker.caller_domain == caller_domain.to_sym && blocker_matches_node?(blocker, node)
  end
end