Class: Contrast::Agent::StaticAnalysis

Inherits:
Object
  • Object
show all
Includes:
Components::Interface, Singleton
Defined in:
lib/contrast/agent/static_analysis.rb

Overview

this module handles one time static analysis tasks

Class Method Summary collapse

Methods included from Components::Interface

included

Class Method Details

.catchupObject

After the first request is complete, we do a one-time manual catchup to review and report the already-loaded gems.



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/contrast/agent/static_analysis.rb', line 18

def catchup
  @_catchup ||= begin
    with_contrast_scope do
      Contrast::Agent::Inventory::DependencyUsageAnalysis.instance.catchup
      send_inventory_message
      true
    end
  end
rescue StandardError => e
  logger.warn('Unable to run post-initialization static analysis', e)
end

.send_inventory_messageObject



30
31
32
33
34
35
36
37
# File 'lib/contrast/agent/static_analysis.rb', line 30

def send_inventory_message
  return unless INVENTORY.enabled?

  app_update_msg = Contrast::Api::Dtm::ApplicationUpdate.build

  Contrast::Utils::InventoryUtil.append_db_config(app_update_msg)
  Contrast::Agent.messaging_queue.send_event_eventually(app_update_msg)
end