Fernando "Brujo" Benavides
Inaka
Erlang Factory
March, 2015
The Ultimate Code-Checking Machine
+warn_unused_vars +warn_export_all
+warn_shadow_vars +warn_unused_import
+warn_unused_function +warn_exported_vars
+warn_bif_clash +warn_unused_record
+warn_deprecated_function +warn_export_vars
+strict_validation +warn_obsolete_guard
+warn_missing_spec +warn_untyped_record
{ok, Xref} = xref:start(my_xref),
ok =
xref:set_library_path(
Xref, code:get_path()),
{ok, _Modules} =
xref:add_directory(Xref, "ebin"),
{ok, Results} =
xref:analyze(
Xref, undefined_function_calls),
stopped = xref:stop(Xref),
Results.
{ok, Xref} = xref:start(my_xref),
ok =
xref:set_library_path(
Xref, code:get_path()),
{ok, _Modules} =
xref:add_directory(Xref, "ebin"),
{ok, Results} =
xref:analyze(
Xref, undefined_function_calls),
stopped = xref:stop(Xref),
Results.
{ok, Xref} = xref:start(my_xref),
.
.
.
.
.
.
.
.
.
{ok, Xref} = xref:start(my_xref),
ok =
xref:set_library_path(
Xref, code:get_path()),
{ok, _Modules} =
xref:add_directory(Xref, "ebin"),
{ok, Results} =
xref:analyze(
Xref, undefined_function_calls),
stopped = xref:stop(Xref),
Results.
ok =
xref:set_library_path(
Xref, code:get_path()),
.
.
.
.
.
.
.
.
.
{ok, Xref} = xref:start(my_xref),
ok =
xref:set_library_path(
Xref, code:get_path()),
{ok, _Modules} =
xref:add_directory(Xref, "ebin"),
{ok, Results} =
xref:analyze(
Xref, undefined_function_calls),
stopped = xref:stop(Xref),
Results.
{ok, _Modules} =
xref:add_directory(Xref, "ebin"),
.
.
.
.
.
.
.
.
.
{ok, Xref} = xref:start(my_xref),
ok =
xref:set_library_path(
Xref, code:get_path()),
{ok, _Modules} =
xref:add_directory(Xref, "ebin"),
{ok, Results} =
xref:analyze(
Xref, undefined_function_calls),
stopped = xref:stop(Xref),
Results.
{ok, Results} =
xref:analyze(
Xref, undefined_function_calls),
.
.
.
.
.
.
.
.
.
{ok, Xref} = xref:start(my_xref),
ok =
xref:set_library_path(
Xref, code:get_path()),
{ok, _Modules} =
xref:add_directory(Xref, "ebin"),
{ok, Results} =
xref:analyze(
Xref, undefined_function_calls),
stopped = xref:stop(Xref),
Results.
stopped = xref:stop(Xref),
.
.
.
.
.
.
.
.
.
[{{my_module_1,bad,0},
{my_module_1,my_function_1,0}},
{{my_module_1,bad,1},
{other_module,my_function_2,1}},
{{my_module_1,bad,1},
{my_module_2,my_function_3,0}},
{{my_module_2,bad,0},
{my_module_2,my_function_4,0}},
{{my_module_2,bad,1},
{other_module,my_function_2,0}},
{{my_module_2,bad,1},
{other_module,my_function_2,1}}]
[{{my_module_1,bad,0},
{my_module_1,undefined_here,0}},
{{my_module_1,bad,1},
{other_module,undefined_somewhere_else,1}},
{{my_module_1,bad,1},
{my_module_2,undefined_there,0}},
{{my_module_2,bad,0},
{my_module_2,undefined_here,0}},
{{my_module_2,bad,1},
{other_module,undefined_somewhere_else,0}},
{{my_module_2,bad,1},
{other_module,undefined_somewhere_else,1}}]
.
.
.
.
.
.
.
.
.
.
{{my_module_2,bad,0},
{my_module_2,my_function_4,0}},
my_module_1.erl:5: Warning bad/0 calls undefined
function my_module_1:my_function_1/0
my_module_1.erl:9: Warning bad/1 calls undefined
function other_module:my_function_2/1
my_module_1.erl:9: Warning bad/1 calls undefined
function my_module_2:my_function_3/0
my_module_2.erl:5: Warning bad/0 calls undefined
function my_module_2:my_function_4/0
my_module_2.erl:9: Warning bad/1 calls undefined
function other_module:my_function_2/0
my_module_2.erl:9: Warning bad/1 calls undefined
function other_module:my_function_2/1
my_module_1.erl:5: Warning bad/0 calls undefined
function my_module_1:my_function_1/0
my_module_1.erl:9: Warning bad/1 calls undefined
function other_module:my_function_2/1
my_module_1.erl:9: Warning bad/1 calls undefined
function my_module_2:my_function_3/0
my_module_2.erl:5: Warning bad/0 calls undefined
function my_module_2:my_function_4/0
my_module_2.erl:9: Warning bad/1 calls undefined
function other_module:my_function_2/0
my_module_2.erl:9: Warning bad/1 calls undefined
function other_module:my_function_2/1
.
.
.
.
.
.
.
.
.
.
my_module_2.erl:5: Warning bad/0 calls undefined
function my_module_2:my_function_4/0
1> xref_runner:check().
[#{check => undefined_function_calls,
filename => "src/xref/my_module_1.erl",
line => 5,
source => {my_module_1,bad,0},
target => {my_module_1,my_function_1,0}},
#{check => undefined_function_calls,
filename => "src/xref/my_module_1.erl",
line => 9,
source => {my_module_1,bad,1},
target => {other_module,my_function_2,1}},
…]
1> xref_runner:check().
[#{check => undefined_function_calls,
filename => "src/xref/my_module_1.erl",
line => 5,
source => {my_module_1,bad,0},
target => {my_module_1,my_function_1,0}},
#{check => undefined_function_calls,
filename => "src/xref/my_module_1.erl",
line => 9,
source => {my_module_1,bad,1},
target => {other_module,my_function_2,1}},
…]
.
.
.
.
.
.
.
.
.
.
[#{check => undefined_function_calls,
filename => "src/xref/my_module_1.erl",
line => 5,
source => {my_module_1,bad,0},
target => {my_module_1,my_function_1,0}},
Loading files...
Loading src/org.erl
Loading src/org_warning.erl
Applying rules...
# src/org.erl [FAIL]
- line_length
- Line 26 is too long: "-spec this_long_long_function_name(a_very_long_module_name:this_type_is_just_huge()) -> well_its_long()".
# src/org_warning.erl [OK]
…
elbrujohalcon@inaka.net
elbrujohalcon
@elbrujohalcon