Current section

Files

Jump to
reach lib reach check candidate.ex
Raw

lib/reach/check/candidate.ex

defmodule Reach.Check.Candidate do
@moduledoc "Struct for an advisory refactoring candidate with confidence and proof."
@derive JSON.Encoder
defstruct [
:id,
:kind,
:target,
:file,
:line,
:benefit,
:risk,
:confidence,
:actionability,
:evidence,
:effects,
:proof,
:suggestion,
:modules,
:representative_calls,
:call,
:branches,
:direct_caller_count,
:keys,
:occurrences,
:sources,
:boundary,
:decoder,
:canonical_site,
:draft_contract,
blast_radius: [],
clone_siblings: []
]
@type t :: %__MODULE__{
risk: :high | :medium | :low,
confidence: :high | :medium | :low,
effects: [Reach.Effects.effect()] | nil,
canonical_site: map() | nil,
blast_radius: [String.t()],
clone_siblings: [map()]
}
def new(attrs) when is_list(attrs) or is_map(attrs), do: struct!(__MODULE__, attrs)
end