• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nshkrdotcom / ElixirScope / 112b416ac835e573caad3d4ca597732ac565f124

30 May 2025 01:53AM UTC coverage: 57.46% (+0.05%) from 57.411%
112b416ac835e573caad3d4ca597732ac565f124

push

github

NSHkr
* Refactored CFGGenerator to use Mox

** This is a compromise to slowly transition:

** The issue is that ExpressionProcessors now uses dependency injection via Application.get_env/3,
** but the main CFGGenerator and other parts of the system still directly call the concrete modules.
** This creates a mismatch.

In this change we: Set the default Application environment values and fix the dependency injection pattern.

For future refactoring that is done wholistically: Refactor the entire CFG generation pipeline to use dependency injection consistently.

21 of 49 new or added lines in 3 files covered. (42.86%)

9 existing lines in 1 file now uncovered.

6185 of 10764 relevant lines covered (57.46%)

3131.58 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

71.43
/lib/elixir_scope/application.ex
1
defmodule ElixirScope.Application do
2
  @moduledoc """
3
  ElixirScope Application Supervisor
4

5
  Manages the lifecycle of all ElixirScope components in a supervised manner.
6
  The supervision tree is designed to be fault-tolerant and to restart 
7
  components in the correct order if failures occur.
8
  """
9

10
  use Application
11

12
  require Logger
13

14
  @impl true
15
  def start(_type, _args) do
16
    Logger.info("Starting ElixirScope application...")
56✔
17

18
    ensure_default_cfg_dependencies()
56✔
19

20
    children = [
56✔
21
      # Core configuration and utilities (no dependencies)
22
      {ElixirScope.Config, []},
23
      
24
      # Layer 1: Core capture pipeline will be added here
25
      # {ElixirScope.Capture.PipelineManager, []},
26
      
27
      # Layer 2: Storage and correlation will be added here
28
      # {ElixirScope.Storage.QueryCoordinator, []},
29
      
30
      # Layer 4: AI components will be added here
31
      # {ElixirScope.AI.Orchestrator, []},
32
    ]
33

34
    opts = [strategy: :one_for_one, name: ElixirScope.Supervisor]
56✔
35
    
36
    case Supervisor.start_link(children, opts) do
56✔
37
      {:ok, pid} ->
38
        Logger.info("ElixirScope application started successfully")
56✔
39
        {:ok, pid}
40
      
41
      {:error, reason} ->
42
        Logger.error("Failed to start ElixirScope application: #{inspect(reason)}")
×
43
        {:error, reason}
44
    end
45
  end
46

47
  defp ensure_default_cfg_dependencies do
48
    unless Application.get_env(:elixir_scope, :state_manager) do
56✔
NEW
49
      Application.put_env(:elixir_scope, :state_manager,
×
50
        ElixirScope.ASTRepository.Enhanced.CFGGenerator.StateManager)
51
    end
52

53
    unless Application.get_env(:elixir_scope, :ast_utilities) do
56✔
NEW
54
      Application.put_env(:elixir_scope, :ast_utilities,
×
55
        ElixirScope.ASTRepository.Enhanced.CFGGenerator.ASTUtilities)
56
    end
57

58
    unless Application.get_env(:elixir_scope, :ast_processor) do
56✔
NEW
59
      Application.put_env(:elixir_scope, :ast_processor,
×
60
        ElixirScope.ASTRepository.Enhanced.CFGGenerator.ASTProcessor)
61
    end
62
  end
63

64
  @impl true
65
  def stop(_state) do
66
    Logger.info("Stopping ElixirScope application...")
56✔
67
    :ok
68
  end
69
end 
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc