Module: Necropsy::ResolutionStore

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

Constant Summary collapse

DIAGNOSTIC_SAMPLE_LIMIT =
5
INVALID_SCOPE_LIMIT =
8
RESOLUTION_STATUSES =
%i[complete partial unknown].freeze
EMPTY_RESOLUTION_RECORDS =
[].freeze

Instance Method Summary collapse

Instance Method Details

#call_sites_resolving_definition(definition_id) ⇒ Object



26
27
28
29
# File 'lib/necropsy/graph/resolution_store.rb', line 26

def call_sites_resolving_definition(definition_id)
  ids = resolution_call_site_ids_by_definition.fetch(definition_id.to_s, EMPTY_RESOLUTION_RECORDS)
  ids.flat_map { |call_site_id| @call_sites_by_id.fetch(call_site_id, EMPTY_RESOLUTION_RECORDS) }
end

#resolution_conflictsObject



31
32
33
# File 'lib/necropsy/graph/resolution_store.rb', line 31

def resolution_conflicts
  compute_resolution_conflicts
end

#resolution_issuesObject



35
36
37
# File 'lib/necropsy/graph/resolution_store.rb', line 35

def resolution_issues
  compute_resolution_issues
end

#resolution_records(call_site_id = nil) ⇒ Object



13
14
15
16
17
18
# File 'lib/necropsy/graph/resolution_store.rb', line 13

def resolution_records(call_site_id = nil)
  records = sorted_resolution_records
  return records unless call_site_id

  resolution_records_by_call_site.fetch(call_site_id.to_s, EMPTY_RESOLUTION_RECORDS)
end

#resolution_status_countsObject



20
21
22
23
24
# File 'lib/necropsy/graph/resolution_store.rb', line 20

def resolution_status_counts
  counts = RESOLUTION_STATUSES.to_h { |status| [status, 0] }
  sorted_resolution_records.each { |record| counts[record.resolution.status] += 1 }
  counts.freeze
end