# `VulnCheck.Solver.RoutineScope`
[🔗](https://github.com/Voskan/vulncheck/blob/v1.0.1/lib/vulncheck/solver/routine_scope.ex#L1)

Splits the routines and modules named by an advisory into those that
belong to the vulnerable package and context routines from elsewhere.

CVE records often list functions on the vulnerable path that live outside
the package, such as `List.delete/2` or a function of another dependency.
Those are reachable in almost any project, so treating them as targets
would prove nothing about the package. A module is part of the package
when:

  * a compiled module of that name belongs to the package; or
  * no compiled module of that name exists and it is not a module of the
    Erlang/OTP or Elixir installation running the scan (unknown modules
    stay targets, so missing `.beam` files never hide an advisory).

Modules compiled for another package or the project, and platform
modules, are context.

# `split`

```elixir
@type split() :: %{
  routines: [VulnCheck.Types.MFA.t()],
  modules: [String.t()],
  context_routines: [VulnCheck.Types.MFA.t()]
}
```

# `platform_module?`

```elixir
@spec platform_module?(String.t()) :: boolean()
```

`true` when `module` ships with the Erlang/OTP or Elixir installation.

# `scope`

```elixir
@spec scope(VulnCheck.Types.Advisory.t(), [String.t()], %{
  required(String.t()) =&gt; VulnCheck.Types.ModuleSummary.t()
}) :: {VulnCheck.Types.Advisory.t(), [VulnCheck.Types.MFA.t()]}
```

Returns the advisory restricted to the routines and modules of the
package, and the context routines.

# `split`

```elixir
@spec split(VulnCheck.Types.Advisory.t(), [String.t()], %{
  required(String.t()) =&gt; VulnCheck.Types.ModuleSummary.t()
}) :: split()
```

Splits `advisory`'s routines and modules for the package known by the
names in `owners` (lockfile key and OTP application), using the compiled
modules of the workspace (`%{module_name => ModuleSummary.t()}`; may be
empty).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
