Class: Necropsy::Analyzers::Static::NameResolution

Inherits:
Necropsy::Analyzer show all
Defined in:
lib/necropsy/analyzers/static/name_resolution.rb

Instance Method Summary collapse

Instance Method Details

#analyze(graph, _project) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/necropsy/analyzers/static/name_resolution.rb', line 7

def analyze(graph, _project)
  edge_evidences = []
  uncertainties = {}
  graph.call_sites.each do |site|
    candidates = graph.resolve_call_site(site)
    fallback = graph.fallback_resolution?(site, resolved: candidates)
    edge_evidences.concat(edge_evidences_for(site, candidates, fallback))
    record_unresolved_uncertainty(graph, site, candidates, uncertainties)
  end

  AnalyzerResult.new(
    edge_evidences: edge_evidences,
    alive_evidences: [],
    uncertainties: uncertainties,
    observation: {}
  )
end

#profileObject



25
26
27
28
29
30
31
32
# File 'lib/necropsy/analyzers/static/name_resolution.rb', line 25

def profile
  AnalyzerProfile.new(
    name: :name_resolution,
    kind: :static,
    soundness: :unsound,
    description: 'Resolves Ruby call sites by exact receiver and method name, falling back to same-name candidates.'
  )
end