ex_admin
ex_admin copied to clipboard
A lot of warnings like 'warning: the variable "var_name" is unsafe as it has been set inside a case/cond/receive/if/&&/||.'
After upgrading to elixir 1.3
I have faced a lot of warnings! Here are the ones coming from ex_admin
:
warning: the variable "controller_route" is unsafe as it has been set inside a case/cond/receive/if/&&/||. Please explicitly return the variable value instead. For example:
case int do 1 -> atom = :one 2 -> atom = :two end
should be written as
atom = case int do 1 -> :one 2 -> :two end
Unsafe variable found at: lib/ex_admin/register.ex:184
warning: the variable "resources" is unsafe as it has been set inside a case/cond/receive/if/&&/||. Please explicitly return the variable value instead. For example:
case int do 1 -> atom = :one 2 -> atom = :two end
should be written as
atom = case int do 1 -> :one 2 -> :two end
Unsafe variable found at: lib/ex_admin/form.ex
warning: the variable "controller_route" is unsafe as it has been set inside a case/cond/receive/if/&&/||. Please explicitly return the variable value instead. For example:
case int do 1 -> atom = :one 2 -> atom = :two end
should be written as
atom = case int do 1 -> :one 2 -> :two end
Unsafe variable found at: lib/ex_admin/register.ex:184
warning: the variable "controller_route" is unsafe as it has been set inside a case/cond/receive/if/&&/||. Please explicitly return the variable value instead. For example:
case int do 1 -> atom = :one 2 -> atom = :two end
should be written as
atom = case int do 1 -> :one 2 -> :two end
Unsafe variable found at: lib/ex_admin/register.ex:184
warning: the variable "controller_route" is unsafe as it has been set inside a case/cond/receive/if/&&/||. Please explicitly return the variable value instead. For example:
case int do 1 -> atom = :one 2 -> atom = :two end
should be written as
atom = case int do 1 -> :one 2 -> :two end
Unsafe variable found at: lib/ex_admin/register.ex:184
warning: the variable "controller_route" is unsafe as it has been set inside a case/cond/receive/if/&&/||. Please explicitly return the variable value instead. For example:
case int do 1 -> atom = :one 2 -> atom = :two end
should be written as
atom = case int do 1 -> :one 2 -> :two end
Unsafe variable found at: lib/ex_admin/register.ex:184
warning: variable speaker is unused lib/ex_admin/show.ex:15
warning: the variable "controller_route" is unsafe as it has been set inside a case/cond/receive/if/&&/||. Please explicitly return the variable value instead. For example:
case int do 1 -> atom = :one 2 -> atom = :two end
should be written as
atom = case int do 1 -> :one 2 -> :two end
Unsafe variable found at: lib/ex_admin/register.ex:184
Here's my mix.lock
information:
"ex_admin": {:hex, :ex_admin, "0.7.6", "8ea0b7d21a073bd901edf37a10808a0c504d9bd952e41b19cb78a896ab253c00", [:mix], [{:xain, "~> 0.5.3", [hex: :xain, optional: false]}, {:scrivener, "~> 1.0", [hex: :scrivener, optional: false]}, {:phoenix_html, "~> 2.5", [hex: :phoenix_html, optional: false]}, {:phoenix_ecto, "~> 2.0", [hex: :phoenix_ecto, optional: false]}, {:phoenix, "~> 1.1", [hex: :phoenix, optional: false]}, {:inflex, "~> 1.5", [hex: :inflex, optional: false]}, {:factory_girl_elixir, "~> 0.1.1", [hex: :factory_girl_elixir, optional: false]}, {:exactor, "~> 2.2.0", [hex: :exactor, optional: false]}, {:ex_queb, "~> 0.1", [hex: :ex_queb, optional: false]}, {:ecto, "~> 1.1", [hex: :ecto, optional: false]}, {:decimal, "~> 1.0", [hex: :decimal, optional: false]}, {:csvlixir, "~> 1.0.0", [hex: :csvlixir, optional: false]}, {:cowboy, "~> 1.0", [hex: :cowboy, optional: false]}]},
Most of this stuff has been fixed on my github master branch. I have been waiting to push a new hex release until I get more of the new ecto2 stuff finished.
There's still one left at
Unsafe variable found at:
lib/ex_admin/form.ex:32
I'm running on master and the docs here: https://github.com/smpallen99/ex_admin/blob/880e511cf3e67081cd727b809eb115eb31a57966/lib/ex_admin/form.ex#L145 show and example that produces compile warnings like this. Is there another way to do conditional rendering? Or, alternatively, add a class to an inputs
call?