Credo v1.2.0 Credo.Check.Warning.UnsafeToAtom View Source
Creating atoms from unknown or external sources dynamically is a potentially unsafe operation because atoms are not garbage-collected by the runtime.
Creating an atom from a string or charlist should be done by using
String.to_existing_atom(string)
or
List.to_existing_atom(charlist)
Module aliases should be constructed using
Module.safe_concat(prefix, suffix)
or
Module.safe_concat([prefix, infix, suffix])
Jason.decode/Jason.decode! should be called using keys: :atoms!
(not keys: :atoms
):
Jason.decode(str, keys: :atoms!)
or :keys
should be omitted (which defaults to :strings
):
Jason.decode(str)
Link to this section Summary
Functions
Returns the base priority for the check
Returns the category for the check
Callback implementation for Credo.Check.explanation/0
Callback implementation for Credo.Check.explanation_for_params/0
Callback implementation for Credo.Check.format_issue/2
Callback implementation for Credo.Check.run_on_all?/0
Link to this section Functions
Returns the base priority for the check.
Callback implementation for Credo.Check.base_priority/0
.
Returns the category for the check.
Callback implementation for Credo.Check.category/0
.
Callback implementation for Credo.Check.explanation/0
.
Callback implementation for Credo.Check.explanation_for_params/0
.
Callback implementation for Credo.Check.format_issue/2
.
Callback implementation for Credo.Check.run_on_all?/0
.