From 343b976a5fa22a867a3380cdb0a4ae4f99acac74 Mon Sep 17 00:00:00 2001 From: Corentin De Souza <9597216+fantazio@users.noreply.github.com> Date: Fri, 5 Dec 2025 18:48:11 +0100 Subject: [PATCH 1/8] [src] compile in 5.3 Naively fix compilation issues. In particular, the use of `cmt_declaration_dependecies` instead of `cmt_value_dependencies` is a simple translation from the latter to the former and is not exactly equivalent because `uid`s may not be found in the `cmt_uid_to_decl` table. This is certainly the root cause of the introduced FP and FN --- .github/workflows/workflow.yml | 6 +- README.md | 2 +- check/classic/classic.ref | 56 +-- check/internal/internal.ref | 113 ++++-- check/threshold-1/threshold-1.ref | 269 ++++++++----- check/threshold-3-0.5/threshold-3-0.5.ref | 443 +++++++++++++--------- dead_code_analyzer.opam | 2 +- dune-project | 2 +- src/deadCode.ml | 48 ++- src/deadLexiFi.ml | 3 +- 10 files changed, 600 insertions(+), 344 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index ef09077..190eb0a 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -25,7 +25,7 @@ jobs: - name: Set-up OCaml uses: ocaml/setup-ocaml@v3 with: - ocaml-compiler: "5.2" + ocaml-compiler: "5.3" - run: opam install . --deps-only --with-test @@ -45,7 +45,7 @@ jobs: - name: Set-up OCaml uses: ocaml/setup-ocaml@v3 with: - ocaml-compiler: "5.2" + ocaml-compiler: "5.3" - uses: ocaml/setup-ocaml/lint-doc@v3 lint-opam: @@ -56,5 +56,5 @@ jobs: - name: Set-up OCaml uses: ocaml/setup-ocaml@v3 with: - ocaml-compiler: "5.2" + ocaml-compiler: "5.3" - uses: ocaml/setup-ocaml/lint-opam@v3 diff --git a/README.md b/README.md index a02f486..4158c89 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ For more information, see [the documentation](docs/USER_DOC.md) ## Requirements -- Currently tested and working on **OCaml 5.2** +- Currently tested and working on **OCaml 5.3** ## Install diff --git a/check/classic/classic.ref b/check/classic/classic.ref index e6452e5..5fde27b 100644 --- a/check/classic/classic.ref +++ b/check/classic/classic.ref @@ -46,7 +46,8 @@ ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y - +./examples/using_make/advanced/val.mli:1: x: Should not be detected +./examples/using_make/advanced/val.mli:2: y: Should not be detected ./examples/using_make/bar.ml:1: x ./examples/using_make/bar_fn.ml:3: h ./examples/using_make/baz.mli:1: z @@ -105,7 +106,7 @@ Nothing else to report in this section .> UNUSED METHODS: ================= -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused @@ -115,15 +116,14 @@ Nothing else to report in this section ./examples/using_dune/unwrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int - +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected ./examples/using_dune/wrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -131,15 +131,14 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int - +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f @@ -242,6 +241,9 @@ Nothing else to report in this section .> OPTIONAL ARGUMENTS: ALWAYS: ============================= ./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?always +./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?internally: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?always: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?externally: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: ?always ./examples/using_dune/unwrapped_lib/opt_args/mixed_args.ml:1: ?always @@ -365,6 +367,8 @@ Nothing else to report in this section ./examples/using_make/if_end.ml:5: ?b ./examples/using_make/letIn.mli:1: ?a ./examples/using_make/let_in.ml:1: ?a +./examples/using_make/opt/sig_struct.ml:6: ?x: Should not be detected +./examples/using_make/opt/sig_struct.ml:11: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:1: ?a ./examples/using_make/opt_in_opt.ml:5: ?a ./examples/using_make/partial_opt.ml:1: ?a @@ -378,8 +382,11 @@ Nothing else to report in this section .> OPTIONAL ARGUMENTS: NEVER: ============================ +./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?externally: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?never ./examples/using_dune/preprocessed_lib/preprocessed.ml:65: ?opt +./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?internally: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?never: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: ?never ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:65: ?opt @@ -476,6 +483,7 @@ Nothing else to report in this section ./examples/using_make/foo.ml:1: ?a ./examples/using_make/letIn.mli:1: ?b ./examples/using_make/let_in.ml:1: ?c +./examples/using_make/opt/sig_struct.ml:2: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:2: ?a ./examples/using_make/opt_in_opt.ml:2: ?b ./examples/using_make/record.ml:12: ?b @@ -533,7 +541,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 460 -Success: 460 -Failed: 0 -Ratio: 100.% +Total: 471 +Success: 443 +Failed: 28 +Ratio: 94.0552016985% diff --git a/check/internal/internal.ref b/check/internal/internal.ref index ef171b0..ff15644 100644 --- a/check/internal/internal.ref +++ b/check/internal/internal.ref @@ -1,15 +1,25 @@ .> UNUSED EXPORTED VALUES: ========================= ./examples/using_dune/preprocessed_lib/preprocessed.mli:1: unused +./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg - +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:2: unused_int -./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun -./examples/using_dune/unwrapped_lib/values/values.mli:20: unused_alias_fun -./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure +./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:20: unused_alias_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:20: unused_alias_fun: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int +./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun @@ -17,12 +27,21 @@ ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg - +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:2: unused_int -./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun -./examples/using_dune/wrapped_lib/values/values.mli:20: unused_alias_fun -./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure +./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:20: unused_alias_fun: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:20: unused_alias_fun: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int +./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun @@ -31,7 +50,8 @@ ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y - +./examples/using_make/advanced/val.mli:1: x: Should not be detected +./examples/using_make/advanced/val.mli:2: y: Should not be detected ./examples/using_make/bar.ml:1: x ./examples/using_make/bar_fn.ml:3: h ./examples/using_make/baz.mli:1: z @@ -48,32 +68,48 @@ ./examples/using_make/dir/anon_call2.ml:9: h ./examples/using_make/dir/match_opt.ml:8: l ./examples/using_make/dir/matchopt.ml:5: w +./examples/using_make/dir/mod.mli:10: M.f: Should not be detected ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x ./examples/using_make/dir/ref_opt.ml:3: no ./examples/using_make/dir/ref_opt.ml:11: x -./examples/using_make/exported.mli:11: F.times_five -./examples/using_make/exported.mli:17: M2.ten +./examples/using_make/exported.mli:11: F.times_five: Not detected +./examples/using_make/exported.mli:17: M2.ten: Not detected +./examples/using_make/exported.mli:6: M1.five: Should not be detected +./examples/using_make/exported.mli:10: F.plus_five: Should not be detected +./examples/using_make/exported.mli:11: F.times_five: Should not be detected +./examples/using_make/exported.mli:15: M2.five: Should not be detected +./examples/using_make/exported.mli:16: M2.plus_five: Should not be detected +./examples/using_make/exported.mli:17: M2.ten: Should not be detected ./examples/using_make/foo.mli:2: y ./examples/using_make/fooFn.mli:2: g +./examples/using_make/functor.mli:2: M.f: Should not be detected ./examples/using_make/functor.mli:3: M.none +./examples/using_make/functor.mli:7: F.g: Should not be detected +./examples/using_make/functor.mli:11: N.g: Should not be detected ./examples/using_make/let_in.ml:3: parent ./examples/using_make/let_test.ml:3: g ./examples/using_make/matchopt.ml:5: w +./examples/using_make/mod_alias.mli:2: M1.id: Should not be detected +./examples/using_make/mod_alias.mli:6: M2.id: Should not be detected +./examples/using_make/obj/class.mli:7: o: Should not be detected +./examples/using_make/obj/class.mli:9: f: Should not be detected +./examples/using_make/obj/inher.mli:11: o: Should not be detected +./examples/using_make/obj/inher.mli:13: f: Should not be detected ./examples/using_make/opt_in_opt.ml:7: x ./examples/using_make/qux.ml:1: z ./examples/using_make/unused_fn.ml:3: g ./examples/using_make/unused_fn.ml:5: var ./examples/using_make/useless_opt.ml:3: x - +./examples/using_make/variant.mli:5: f: Should not be detected Nothing else to report in this section -------------------------------------------------------------------------------- .> UNUSED METHODS: ================= -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused @@ -83,15 +119,14 @@ Nothing else to report in this section ./examples/using_dune/unwrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int - +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected ./examples/using_dune/wrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -99,15 +134,14 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int - +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f @@ -210,6 +244,9 @@ Nothing else to report in this section .> OPTIONAL ARGUMENTS: ALWAYS: ============================= ./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?always +./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?internally: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?always: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?externally: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: ?always ./examples/using_dune/unwrapped_lib/opt_args/mixed_args.ml:1: ?always @@ -333,6 +370,8 @@ Nothing else to report in this section ./examples/using_make/if_end.ml:5: ?b ./examples/using_make/letIn.mli:1: ?a ./examples/using_make/let_in.ml:1: ?a +./examples/using_make/opt/sig_struct.ml:6: ?x: Should not be detected +./examples/using_make/opt/sig_struct.ml:11: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:1: ?a ./examples/using_make/opt_in_opt.ml:5: ?a ./examples/using_make/partial_opt.ml:1: ?a @@ -346,8 +385,11 @@ Nothing else to report in this section .> OPTIONAL ARGUMENTS: NEVER: ============================ +./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?externally: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?never ./examples/using_dune/preprocessed_lib/preprocessed.ml:65: ?opt +./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?internally: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?never: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: ?never ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:65: ?opt @@ -444,6 +486,7 @@ Nothing else to report in this section ./examples/using_make/foo.ml:1: ?a ./examples/using_make/letIn.mli:1: ?b ./examples/using_make/let_in.ml:1: ?c +./examples/using_make/opt/sig_struct.ml:2: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:2: ?a ./examples/using_make/opt_in_opt.ml:2: ?b ./examples/using_make/record.ml:12: ?b @@ -501,7 +544,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 430 -Success: 430 -Failed: 0 -Ratio: 100.% +Total: 479 +Success: 405 +Failed: 74 +Ratio: 84.5511482255% diff --git a/check/threshold-1/threshold-1.ref b/check/threshold-1/threshold-1.ref index 1ef3c2f..ff063c7 100644 --- a/check/threshold-1/threshold-1.ref +++ b/check/threshold-1/threshold-1.ref @@ -1,15 +1,25 @@ .> UNUSED EXPORTED VALUES: ========================= ./examples/using_dune/preprocessed_lib/preprocessed.mli:1: unused +./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg - +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:2: unused_int -./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun -./examples/using_dune/unwrapped_lib/values/values.mli:20: unused_alias_fun -./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure +./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:20: unused_alias_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:20: unused_alias_fun: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int +./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun @@ -17,12 +27,21 @@ ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg - +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:2: unused_int -./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun -./examples/using_dune/wrapped_lib/values/values.mli:20: unused_alias_fun -./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure +./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:20: unused_alias_fun: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:20: unused_alias_fun: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int +./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun @@ -31,7 +50,8 @@ ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y - +./examples/using_make/advanced/val.mli:1: x: Should not be detected +./examples/using_make/advanced/val.mli:2: y: Should not be detected ./examples/using_make/bar.ml:1: x ./examples/using_make/bar_fn.ml:3: h ./examples/using_make/baz.mli:1: z @@ -48,24 +68,41 @@ ./examples/using_make/dir/anon_call2.ml:9: h ./examples/using_make/dir/match_opt.ml:8: l ./examples/using_make/dir/matchopt.ml:5: w +./examples/using_make/dir/mod.mli:10: M.f: Should not be detected ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x ./examples/using_make/dir/ref_opt.ml:3: no ./examples/using_make/dir/ref_opt.ml:11: x -./examples/using_make/exported.mli:11: F.times_five -./examples/using_make/exported.mli:17: M2.ten +./examples/using_make/exported.mli:11: F.times_five: Not detected +./examples/using_make/exported.mli:17: M2.ten: Not detected +./examples/using_make/exported.mli:6: M1.five: Should not be detected +./examples/using_make/exported.mli:10: F.plus_five: Should not be detected +./examples/using_make/exported.mli:11: F.times_five: Should not be detected +./examples/using_make/exported.mli:15: M2.five: Should not be detected +./examples/using_make/exported.mli:16: M2.plus_five: Should not be detected +./examples/using_make/exported.mli:17: M2.ten: Should not be detected ./examples/using_make/foo.mli:2: y ./examples/using_make/fooFn.mli:2: g +./examples/using_make/functor.mli:2: M.f: Should not be detected ./examples/using_make/functor.mli:3: M.none +./examples/using_make/functor.mli:7: F.g: Should not be detected +./examples/using_make/functor.mli:11: N.g: Should not be detected ./examples/using_make/let_in.ml:3: parent ./examples/using_make/let_test.ml:3: g ./examples/using_make/matchopt.ml:5: w +./examples/using_make/mod_alias.mli:2: M1.id: Should not be detected +./examples/using_make/mod_alias.mli:6: M2.id: Should not be detected +./examples/using_make/obj/class.mli:7: o: Should not be detected +./examples/using_make/obj/class.mli:9: f: Should not be detected +./examples/using_make/obj/inher.mli:11: o: Should not be detected +./examples/using_make/obj/inher.mli:13: f: Should not be detected ./examples/using_make/opt_in_opt.ml:7: x ./examples/using_make/qux.ml:1: z ./examples/using_make/unused_fn.ml:3: g ./examples/using_make/unused_fn.ml:5: var ./examples/using_make/useless_opt.ml:3: x +./examples/using_make/variant.mli:5: f: Should not be detected -------- @@ -103,32 +140,55 @@ ./examples/using_dune/bin/use_wrapped_lib/use_without_class.mli:1: mark_used ./examples/using_dune/bin/use_wrapped_lib/use_wrapped_lib.mli:1: mark_used -./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used +./examples/using_dune/preprocessed_lib/preprocessed.mli:2: used: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:4: externally_used +./examples/using_dune/preprocessed_lib/preprocessed.mli:31: f: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:4: internally_used ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:5: externally_used -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg - +./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected ./examples/using_dune/unwrapped_lib/style/style.ml:1: all -./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int +./examples/using_dune/unwrapped_lib/values/values.mli:1: used_int: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:4: externally_used_int ./examples/using_dune/unwrapped_lib/values/values.mli:5: externally_used_as_parameter_int ./examples/using_dune/unwrapped_lib/values/values.mli:7: externally_written_bool_ref ./examples/using_dune/unwrapped_lib/values/values.mli:8: externally_matched_option ./examples/using_dune/unwrapped_lib/values/values.mli:10: externally_stored_in_ref_bool ./examples/using_dune/unwrapped_lib/values/values.mli:11: externally_stored_in_option_bool -./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun +./examples/using_dune/unwrapped_lib/values/values.mli:13: used_fun: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:16: externally_used_fun ./examples/using_dune/unwrapped_lib/values/values.mli:17: externally_used_as_parameter_fun +./examples/using_dune/unwrapped_lib/values/values.mli:19: used_alias_fun: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:21: externally_used_alias_fun -./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure +./examples/using_dune/unwrapped_lib/values/values.mli:23: partially_used_fun: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:24: used_closure: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:27: externally_used_closure -./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int +./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int @@ -146,27 +206,48 @@ ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:27: internally_used_closure ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:28: externally_used_closure -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg - +./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected ./examples/using_dune/wrapped_lib/style/style.ml:1: all -./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int +./examples/using_dune/wrapped_lib/values/values.mli:1: used_int: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:4: externally_used_int ./examples/using_dune/wrapped_lib/values/values.mli:5: externally_used_as_parameter_int ./examples/using_dune/wrapped_lib/values/values.mli:7: externally_written_bool_ref ./examples/using_dune/wrapped_lib/values/values.mli:8: externally_matched_option ./examples/using_dune/wrapped_lib/values/values.mli:10: externally_stored_in_ref_bool ./examples/using_dune/wrapped_lib/values/values.mli:11: externally_stored_in_option_bool -./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun +./examples/using_dune/wrapped_lib/values/values.mli:13: used_fun: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:16: externally_used_fun ./examples/using_dune/wrapped_lib/values/values.mli:17: externally_used_as_parameter_fun +./examples/using_dune/wrapped_lib/values/values.mli:19: used_alias_fun: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:21: externally_used_alias_fun -./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure +./examples/using_dune/wrapped_lib/values/values.mli:23: partially_used_fun: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:24: used_closure: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:27: externally_used_closure -./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int +./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected +./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int @@ -187,9 +268,8 @@ ./examples/using_make/advanced/incl.ml:7: f ./examples/using_make/advanced/mod.mli:1: f ./examples/using_make/advanced/mod.mli:2: x -./examples/using_make/advanced/val.mli:1: x -./examples/using_make/advanced/val.mli:2: y - +./examples/using_make/advanced/val.mli:1: x: Not detected +./examples/using_make/advanced/val.mli:2: y: Not detected ./examples/using_make/baz.mli:2: t ./examples/using_make/cond_sel.ml:9: f ./examples/using_make/cond_sel.ml:11: g @@ -204,25 +284,24 @@ ./examples/using_make/dir/hidden_opt_use.ml:1: f ./examples/using_make/dir/hidden_opt_use.ml:3: apply ./examples/using_make/dir/match_opt.ml:3: m -./examples/using_make/dir/mod.mli:10: M.f +./examples/using_make/dir/mod.mli:10: M.f: Not detected ./examples/using_make/dir/partial.ml:5: g ./examples/using_make/dir/ref_fn.ml:5: g ./examples/using_make/dir/ref_opt.ml:7: g ./examples/using_make/foo.mli:1: x ./examples/using_make/fooFn.mli:1: f -./examples/using_make/functor.mli:2: M.f +./examples/using_make/functor.mli:2: M.f: Not detected ./examples/using_make/if_end.ml:1: f ./examples/using_make/if_end.ml:3: g ./examples/using_make/if_end.ml:5: h ./examples/using_make/letIn.mli:1: f -./examples/using_make/mod_alias.mli:2: M1.id -./examples/using_make/mod_alias.mli:6: M2.id - -./examples/using_make/obj/class.mli:9: f +./examples/using_make/mod_alias.mli:2: M1.id: Not detected +./examples/using_make/mod_alias.mli:6: M2.id: Not detected +./examples/using_make/obj/class.mli:9: f: Not detected ./examples/using_make/obj/fun_class.ml:8: f ./examples/using_make/obj/fun_obj_param.ml:7: app_m -./examples/using_make/obj/inher.mli:13: f +./examples/using_make/obj/inher.mli:13: f: Not detected ./examples/using_make/obj/obj_inher.ml:7: o ./examples/using_make/obj/obj_inher.ml:12: o4 ./examples/using_make/obj/obj_inher.ml:17: o2 @@ -233,15 +312,14 @@ ./examples/using_make/opt_in_opt.ml:5: baz ./examples/using_make/partial_opt.ml:1: f ./examples/using_make/useless_opt.ml:1: foo -./examples/using_make/variant.mli:5: f - +./examples/using_make/variant.mli:5: f: Not detected Nothing else to report in this section -------------------------------------------------------------------------------- .> UNUSED METHODS: ================= -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused @@ -251,15 +329,14 @@ Nothing else to report in this section ./examples/using_dune/unwrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int - +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected ./examples/using_dune/wrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -267,15 +344,14 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int - +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f @@ -301,41 +377,39 @@ Nothing else to report in this section .>-> ALMOST UNUSED METHODS: Called 1 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#externally_used -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#internally_used +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#externally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#internally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#externally_used ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#internally_used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#used -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int - +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int: Not detected ./examples/using_dune/wrapped_lib/obj/with_class.mli:35: _self_used#used ./examples/using_dune/wrapped_lib/obj/with_class.mli:41: _self_used_fun_class#used -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int - +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int: Not detected ./examples/using_make/advanced/func.mli:3: M.c#f ./examples/using_make/advanced/mod.mli:4: p#f @@ -518,6 +592,9 @@ Nothing else to report in this section .> OPTIONAL ARGUMENTS: ALWAYS: ============================= ./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?always +./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?internally: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?always: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?externally: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: ?always ./examples/using_dune/unwrapped_lib/opt_args/mixed_args.ml:1: ?always @@ -641,6 +718,8 @@ Nothing else to report in this section ./examples/using_make/if_end.ml:5: ?b ./examples/using_make/letIn.mli:1: ?a ./examples/using_make/let_in.ml:1: ?a +./examples/using_make/opt/sig_struct.ml:6: ?x: Should not be detected +./examples/using_make/opt/sig_struct.ml:11: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:1: ?a ./examples/using_make/opt_in_opt.ml:5: ?a ./examples/using_make/partial_opt.ml:1: ?a @@ -654,8 +733,11 @@ Nothing else to report in this section .> OPTIONAL ARGUMENTS: NEVER: ============================ +./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?externally: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?never ./examples/using_dune/preprocessed_lib/preprocessed.ml:65: ?opt +./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?internally: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?never: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: ?never ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:65: ?opt @@ -752,6 +834,7 @@ Nothing else to report in this section ./examples/using_make/foo.ml:1: ?a ./examples/using_make/letIn.mli:1: ?b ./examples/using_make/let_in.ml:1: ?c +./examples/using_make/opt/sig_struct.ml:2: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:2: ?a ./examples/using_make/opt_in_opt.ml:2: ?b ./examples/using_make/record.ml:12: ?b @@ -809,7 +892,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 701 -Success: 701 -Failed: 0 -Ratio: 100.% +Total: 796 +Success: 624 +Failed: 172 +Ratio: 78.391959799% diff --git a/check/threshold-3-0.5/threshold-3-0.5.ref b/check/threshold-3-0.5/threshold-3-0.5.ref index 60e2afc..4d40a58 100644 --- a/check/threshold-3-0.5/threshold-3-0.5.ref +++ b/check/threshold-3-0.5/threshold-3-0.5.ref @@ -1,15 +1,25 @@ .> UNUSED EXPORTED VALUES: ========================= ./examples/using_dune/preprocessed_lib/preprocessed.mli:1: unused +./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg - +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:2: unused_int -./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun -./examples/using_dune/unwrapped_lib/values/values.mli:20: unused_alias_fun -./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure +./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:20: unused_alias_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:20: unused_alias_fun: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int +./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun @@ -17,12 +27,21 @@ ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg - +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:2: unused_int -./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun -./examples/using_dune/wrapped_lib/values/values.mli:20: unused_alias_fun -./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure +./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:20: unused_alias_fun: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:20: unused_alias_fun: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int +./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun @@ -31,7 +50,8 @@ ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y - +./examples/using_make/advanced/val.mli:1: x: Should not be detected +./examples/using_make/advanced/val.mli:2: y: Should not be detected ./examples/using_make/bar.ml:1: x ./examples/using_make/bar_fn.ml:3: h ./examples/using_make/baz.mli:1: z @@ -48,24 +68,41 @@ ./examples/using_make/dir/anon_call2.ml:9: h ./examples/using_make/dir/match_opt.ml:8: l ./examples/using_make/dir/matchopt.ml:5: w +./examples/using_make/dir/mod.mli:10: M.f: Should not be detected ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x ./examples/using_make/dir/ref_opt.ml:3: no ./examples/using_make/dir/ref_opt.ml:11: x -./examples/using_make/exported.mli:11: F.times_five -./examples/using_make/exported.mli:17: M2.ten +./examples/using_make/exported.mli:11: F.times_five: Not detected +./examples/using_make/exported.mli:17: M2.ten: Not detected +./examples/using_make/exported.mli:6: M1.five: Should not be detected +./examples/using_make/exported.mli:10: F.plus_five: Should not be detected +./examples/using_make/exported.mli:11: F.times_five: Should not be detected +./examples/using_make/exported.mli:15: M2.five: Should not be detected +./examples/using_make/exported.mli:16: M2.plus_five: Should not be detected +./examples/using_make/exported.mli:17: M2.ten: Should not be detected ./examples/using_make/foo.mli:2: y ./examples/using_make/fooFn.mli:2: g +./examples/using_make/functor.mli:2: M.f: Should not be detected ./examples/using_make/functor.mli:3: M.none +./examples/using_make/functor.mli:7: F.g: Should not be detected +./examples/using_make/functor.mli:11: N.g: Should not be detected ./examples/using_make/let_in.ml:3: parent ./examples/using_make/let_test.ml:3: g ./examples/using_make/matchopt.ml:5: w +./examples/using_make/mod_alias.mli:2: M1.id: Should not be detected +./examples/using_make/mod_alias.mli:6: M2.id: Should not be detected +./examples/using_make/obj/class.mli:7: o: Should not be detected +./examples/using_make/obj/class.mli:9: f: Should not be detected +./examples/using_make/obj/inher.mli:11: o: Should not be detected +./examples/using_make/obj/inher.mli:13: f: Should not be detected ./examples/using_make/opt_in_opt.ml:7: x ./examples/using_make/qux.ml:1: z ./examples/using_make/unused_fn.ml:3: g ./examples/using_make/unused_fn.ml:5: var ./examples/using_make/useless_opt.ml:3: x +./examples/using_make/variant.mli:5: f: Should not be detected -------- @@ -103,32 +140,55 @@ ./examples/using_dune/bin/use_wrapped_lib/use_without_class.mli:1: mark_used ./examples/using_dune/bin/use_wrapped_lib/use_wrapped_lib.mli:1: mark_used -./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used +./examples/using_dune/preprocessed_lib/preprocessed.mli:2: used: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:4: externally_used +./examples/using_dune/preprocessed_lib/preprocessed.mli:31: f: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:4: internally_used ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:5: externally_used -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg - +./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected ./examples/using_dune/unwrapped_lib/style/style.ml:1: all -./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int +./examples/using_dune/unwrapped_lib/values/values.mli:1: used_int: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:4: externally_used_int ./examples/using_dune/unwrapped_lib/values/values.mli:5: externally_used_as_parameter_int ./examples/using_dune/unwrapped_lib/values/values.mli:7: externally_written_bool_ref ./examples/using_dune/unwrapped_lib/values/values.mli:8: externally_matched_option ./examples/using_dune/unwrapped_lib/values/values.mli:10: externally_stored_in_ref_bool ./examples/using_dune/unwrapped_lib/values/values.mli:11: externally_stored_in_option_bool -./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun +./examples/using_dune/unwrapped_lib/values/values.mli:13: used_fun: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:16: externally_used_fun ./examples/using_dune/unwrapped_lib/values/values.mli:17: externally_used_as_parameter_fun +./examples/using_dune/unwrapped_lib/values/values.mli:19: used_alias_fun: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:21: externally_used_alias_fun -./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure +./examples/using_dune/unwrapped_lib/values/values.mli:23: partially_used_fun: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:24: used_closure: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:27: externally_used_closure -./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int +./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int @@ -146,27 +206,48 @@ ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:27: internally_used_closure ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:28: externally_used_closure -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg - +./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected ./examples/using_dune/wrapped_lib/style/style.ml:1: all -./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int +./examples/using_dune/wrapped_lib/values/values.mli:1: used_int: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:4: externally_used_int ./examples/using_dune/wrapped_lib/values/values.mli:5: externally_used_as_parameter_int ./examples/using_dune/wrapped_lib/values/values.mli:7: externally_written_bool_ref ./examples/using_dune/wrapped_lib/values/values.mli:8: externally_matched_option ./examples/using_dune/wrapped_lib/values/values.mli:10: externally_stored_in_ref_bool ./examples/using_dune/wrapped_lib/values/values.mli:11: externally_stored_in_option_bool -./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun +./examples/using_dune/wrapped_lib/values/values.mli:13: used_fun: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:16: externally_used_fun ./examples/using_dune/wrapped_lib/values/values.mli:17: externally_used_as_parameter_fun +./examples/using_dune/wrapped_lib/values/values.mli:19: used_alias_fun: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:21: externally_used_alias_fun -./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure +./examples/using_dune/wrapped_lib/values/values.mli:23: partially_used_fun: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:24: used_closure: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:27: externally_used_closure -./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int +./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected +./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int @@ -187,9 +268,8 @@ ./examples/using_make/advanced/incl.ml:7: f ./examples/using_make/advanced/mod.mli:1: f ./examples/using_make/advanced/mod.mli:2: x -./examples/using_make/advanced/val.mli:1: x -./examples/using_make/advanced/val.mli:2: y - +./examples/using_make/advanced/val.mli:1: x: Not detected +./examples/using_make/advanced/val.mli:2: y: Not detected ./examples/using_make/baz.mli:2: t ./examples/using_make/cond_sel.ml:9: f ./examples/using_make/cond_sel.ml:11: g @@ -204,25 +284,24 @@ ./examples/using_make/dir/hidden_opt_use.ml:1: f ./examples/using_make/dir/hidden_opt_use.ml:3: apply ./examples/using_make/dir/match_opt.ml:3: m -./examples/using_make/dir/mod.mli:10: M.f +./examples/using_make/dir/mod.mli:10: M.f: Not detected ./examples/using_make/dir/partial.ml:5: g ./examples/using_make/dir/ref_fn.ml:5: g ./examples/using_make/dir/ref_opt.ml:7: g ./examples/using_make/foo.mli:1: x ./examples/using_make/fooFn.mli:1: f -./examples/using_make/functor.mli:2: M.f +./examples/using_make/functor.mli:2: M.f: Not detected ./examples/using_make/if_end.ml:1: f ./examples/using_make/if_end.ml:3: g ./examples/using_make/if_end.ml:5: h ./examples/using_make/letIn.mli:1: f -./examples/using_make/mod_alias.mli:2: M1.id -./examples/using_make/mod_alias.mli:6: M2.id - -./examples/using_make/obj/class.mli:9: f +./examples/using_make/mod_alias.mli:2: M1.id: Not detected +./examples/using_make/mod_alias.mli:6: M2.id: Not detected +./examples/using_make/obj/class.mli:9: f: Not detected ./examples/using_make/obj/fun_class.ml:8: f ./examples/using_make/obj/fun_obj_param.ml:7: app_m -./examples/using_make/obj/inher.mli:13: f +./examples/using_make/obj/inher.mli:13: f: Not detected ./examples/using_make/obj/obj_inher.ml:7: o ./examples/using_make/obj/obj_inher.ml:12: o4 ./examples/using_make/obj/obj_inher.ml:17: o2 @@ -233,69 +312,92 @@ ./examples/using_make/opt_in_opt.ml:5: baz ./examples/using_make/partial_opt.ml:1: f ./examples/using_make/useless_opt.ml:1: foo -./examples/using_make/variant.mli:5: f +./examples/using_make/variant.mli:5: f: Not detected -------- .>-> ALMOST UNUSED EXPORTED VALUES: Called 2 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./examples/using_dune/preprocessed_lib/preprocessed.mli:2: used -./examples/using_dune/preprocessed_lib/preprocessed.mli:31: f +./examples/using_dune/preprocessed_lib/preprocessed.mli:2: used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:31: f: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:3: used ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: f -./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory - -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:18: externally_used_fun_with_single_sometimes_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig - -./examples/using_dune/unwrapped_lib/values/values.mli:1: used_int -./examples/using_dune/unwrapped_lib/values/values.mli:13: used_fun -./examples/using_dune/unwrapped_lib/values/values.mli:19: used_alias_fun -./examples/using_dune/unwrapped_lib/values/values.mli:24: used_closure -./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int +./examples/using_dune/unwrapped_lib/obj/with_class.mli:21: basics_factory: Should not be detected +./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory: Not detected +./examples/using_dune/unwrapped_lib/opt_args/mixed_args.mli:1: interlaced_mandatory_and_opt: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/mixed_args.mli:3: interlaced_labeled_and_opt: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/mixed_args.mli:7: interlaced_mandatory_labeled_and_opt: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:18: externally_used_fun_with_single_sometimes_used_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:6: used_fun_with_single_sometimes_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:18: externally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:26: multiple_nas_used_opt_args: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:28: multiple_ans_used_opt_args: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:30: multiple_sna_used_opt_args: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:32: multiple_san_used_opt_args: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:34: multiple_nsa_used_opt_args: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:36: multiple_asn_used_opt_args: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:5: partially_applied_with_sometimes_used_opt_arg: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Not detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:1: used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:13: used_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:19: used_alias_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:24: used_closure: Not detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Not detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:2: Exported.used_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:1: used_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:14: used_fun ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:21: used_alias_fun ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:26: used_closure -./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory - -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:18: externally_used_fun_with_single_sometimes_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig - -./examples/using_dune/wrapped_lib/values/values.mli:1: used_int -./examples/using_dune/wrapped_lib/values/values.mli:13: used_fun -./examples/using_dune/wrapped_lib/values/values.mli:19: used_alias_fun -./examples/using_dune/wrapped_lib/values/values.mli:24: used_closure -./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int +./examples/using_dune/wrapped_lib/obj/with_class.mli:21: basics_factory: Should not be detected +./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory: Not detected +./examples/using_dune/wrapped_lib/opt_args/mixed_args.mli:1: interlaced_mandatory_and_opt: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/mixed_args.mli:3: interlaced_labeled_and_opt: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/mixed_args.mli:7: interlaced_mandatory_labeled_and_opt: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:18: externally_used_fun_with_single_sometimes_used_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:6: used_fun_with_single_sometimes_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:18: externally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:26: multiple_nas_used_opt_args: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:28: multiple_ans_used_opt_args: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:30: multiple_sna_used_opt_args: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:32: multiple_san_used_opt_args: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:34: multiple_nsa_used_opt_args: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:36: multiple_asn_used_opt_args: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:5: partially_applied_with_sometimes_used_opt_arg: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Not detected +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:1: used_int: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:13: used_fun: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:19: used_alias_fun: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:24: used_closure: Not detected +./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Not detected ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:2: Exported.used_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:1: used_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:14: used_fun @@ -310,16 +412,16 @@ ./examples/using_make/dir/ref_opt.ml:1: f ./examples/using_make/dir/ref_opt.ml:5: r -./examples/using_make/exported.mli:6: M1.five -./examples/using_make/exported.mli:15: M2.five -./examples/using_make/functor.mli:7: F.g -./examples/using_make/functor.mli:11: N.g - -./examples/using_make/obj/class.mli:7: o +./examples/using_make/exported.mli:6: M1.five: Not detected +./examples/using_make/exported.mli:15: M2.five: Not detected +./examples/using_make/functor.mli:7: F.g: Not detected +./examples/using_make/functor.mli:11: N.g: Not detected +./examples/using_make/obj/class.mli:7: o: Not detected ./examples/using_make/obj/fun_obj_param.ml:1: f -./examples/using_make/obj/inher.mli:11: o +./examples/using_make/obj/inher.mli:11: o: Not detected ./examples/using_make/obj/object.ml:1: o +./examples/using_make/opt/sig_struct.ml:6: f: Should not be detected ./examples/using_make/opt_in_opt.ml:1: foo ./examples/using_make/unused_fn.ml:1: f -------- @@ -327,28 +429,30 @@ .>-> ALMOST UNUSED EXPORTED VALUES: Called 3 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:24: multiple_sometimes_used_opt_args: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:19: aliased_fun +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:24: multiple_sometimes_used_opt_args: Should not be detected ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:19: aliased_fun ./examples/using_make/dir/anonFn2.mli:1: f ./examples/using_make/dir/anonFn2.mli:2: g ./examples/using_make/dir/match_opt.ml:1: f +./examples/using_make/dir/refFn.mli:1: r: Should not be detected ./examples/using_make/dir/ref_fn.ml:1: f -./examples/using_make/exported.mli:10: F.plus_five -./examples/using_make/exported.mli:16: M2.plus_five +./examples/using_make/exported.mli:10: F.plus_five: Not detected +./examples/using_make/exported.mli:16: M2.plus_five: Not detected ./examples/using_make/let_in.ml:1: complicated -./examples/using_make/opt/sig_struct.ml:6: f - +./examples/using_make/opt/sig_struct.ml:6: f: Not detected Nothing else to report in this section -------------------------------------------------------------------------------- .> UNUSED METHODS: ================= -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused @@ -358,15 +462,14 @@ Nothing else to report in this section ./examples/using_dune/unwrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int - +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected ./examples/using_dune/wrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -374,15 +477,14 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int - +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f @@ -408,41 +510,39 @@ Nothing else to report in this section .>-> ALMOST UNUSED METHODS: Called 1 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#externally_used -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#internally_used +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#externally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#internally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#externally_used ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#internally_used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#used -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int - +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int: Not detected ./examples/using_dune/wrapped_lib/obj/with_class.mli:35: _self_used#used ./examples/using_dune/wrapped_lib/obj/with_class.mli:41: _self_used_fun_class#used -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int - +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int: Not detected ./examples/using_make/advanced/func.mli:3: M.c#f ./examples/using_make/advanced/mod.mli:4: p#f @@ -474,7 +574,7 @@ Nothing else to report in this section .>-> ALMOST UNUSED METHODS: Called 2 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#used +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#externally_used_fun @@ -484,11 +584,10 @@ Nothing else to report in this section ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#sometimes_used_fun ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#sometimes_used_int ./examples/using_dune/unwrapped_lib/obj/with_class.mli:25: fun_class#used -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#used_int -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#used_fun -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#used_int - +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#used_fun: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#used_int: Not detected ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#externally_used_fun ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#externally_used_int ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#internally_used_fun @@ -496,11 +595,10 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#sometimes_used_fun ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#sometimes_used_int ./examples/using_dune/wrapped_lib/obj/with_class.mli:25: fun_class#used -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#used_int -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#used_fun -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#used_int - +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#used_fun: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#used_int: Not detected ./examples/using_make/obj/class_type.mli:7: p#g ./examples/using_make/obj/coerce.mli:8: c#f ./examples/using_make/obj/named.mli:1: p1#f @@ -707,6 +805,9 @@ Nothing else to report in this section .> OPTIONAL ARGUMENTS: ALWAYS: ============================= ./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?always +./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?internally: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?always: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?externally: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: ?always ./examples/using_dune/unwrapped_lib/opt_args/mixed_args.ml:1: ?always @@ -830,6 +931,8 @@ Nothing else to report in this section ./examples/using_make/if_end.ml:5: ?b ./examples/using_make/letIn.mli:1: ?a ./examples/using_make/let_in.ml:1: ?a +./examples/using_make/opt/sig_struct.ml:6: ?x: Should not be detected +./examples/using_make/opt/sig_struct.ml:11: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:1: ?a ./examples/using_make/opt_in_opt.ml:5: ?a ./examples/using_make/partial_opt.ml:1: ?a @@ -841,8 +944,8 @@ Nothing else to report in this section .>-> OPTIONAL ARGUMENTS: ALMOST ALWAYS: Except 1 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?externally (1/2 calls) -./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?internally (1/2 calls) +./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?externally (1/2 calls): Not detected +./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?internally (1/2 calls): Not detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: ?externally (1/2 calls) ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: ?internally (1/2 calls) @@ -922,9 +1025,7 @@ Nothing else to report in this section ./examples/using_make/dir/ref_fn.ml:1: ?b (2/3 calls) ./examples/using_make/matchopt.ml:1: ?x (3/4 calls) - -./examples/using_make/opt/sig_struct.ml:2: ?x (2/3 calls) - +./examples/using_make/opt/sig_struct.ml:2: ?x (2/3 calls): Not detected ./examples/using_make/opt_in_opt.ml:1: ?b (1/2 calls) -------- @@ -936,8 +1037,11 @@ Nothing else to report in this section .> OPTIONAL ARGUMENTS: NEVER: ============================ +./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?externally: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?never ./examples/using_dune/preprocessed_lib/preprocessed.ml:65: ?opt +./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?internally: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?never: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: ?never ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:65: ?opt @@ -1034,6 +1138,7 @@ Nothing else to report in this section ./examples/using_make/foo.ml:1: ?a ./examples/using_make/letIn.mli:1: ?b ./examples/using_make/let_in.ml:1: ?c +./examples/using_make/opt/sig_struct.ml:2: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:2: ?a ./examples/using_make/opt_in_opt.ml:2: ?b ./examples/using_make/record.ml:12: ?b @@ -1042,8 +1147,8 @@ Nothing else to report in this section .>-> OPTIONAL ARGUMENTS: ALMOST NEVER: Except 1 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?externally (1/2 calls) -./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?internally (1/2 calls) +./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?externally (1/2 calls): Not detected +./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?internally (1/2 calls): Not detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: ?externally (1/2 calls) ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: ?internally (1/2 calls) @@ -1168,7 +1273,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 988 -Success: 988 -Failed: 0 -Ratio: 100.% +Total: 1114 +Success: 844 +Failed: 270 +Ratio: 75.763016158% diff --git a/dead_code_analyzer.opam b/dead_code_analyzer.opam index 2ae96e5..116ede5 100644 --- a/dead_code_analyzer.opam +++ b/dead_code_analyzer.opam @@ -15,7 +15,7 @@ homepage: "https://github.com/LexiFi/dead_code_analyzer" bug-reports: "https://github.com/LexiFi/dead_code_analyzer/issues" depends: [ "dune" {>= "3.20"} - "ocaml" {>= "5.2" & < "5.3"} + "ocaml" {>= "5.3" & < "5.4"} "odoc" {with-doc} ] build: [ diff --git a/dune-project b/dune-project index 3eb6ae4..6ce3b6f 100644 --- a/dune-project +++ b/dune-project @@ -22,6 +22,6 @@ (synopsis "Dead code analyzer for OCaml") (license MIT) (depends - (ocaml (and (>= 5.2) (< 5.3))) + (ocaml (and (>= 5.3) (< 5.4))) ) ) diff --git a/src/deadCode.ml b/src/deadCode.ml index 8a87659..4bab96a 100644 --- a/src/deadCode.ml +++ b/src/deadCode.ml @@ -64,8 +64,12 @@ let rec treat_exp exp args = | Texp_field (_, _, {lbl_loc = {Location.loc_start = loc; _}; _}) -> DeadArg.register_uses loc args - | Texp_match (_, l, _) -> - List.iter (fun {c_rhs = exp; _} -> treat_exp exp args) l + | Texp_match (_, comp_l, val_l, _) -> + let process_cases l = + List.iter (fun {c_rhs = exp; _} -> treat_exp exp args) l + in + process_cases comp_l; + process_cases val_l | Texp_ifthenelse (_, exp_then, exp_else) -> treat_exp exp_then args; @@ -247,7 +251,7 @@ let expr super self e = "let () = ... in ... (=> use sequence)" end - | Texp_match (_, [{c_lhs; _}], _) + | Texp_match (_, [{c_lhs; _}], [], _) when DeadType.is_unit c_lhs.pat_type && !DeadFlag.style.DeadFlag.seq -> begin match c_lhs.pat_desc with | Tpat_value tpat_arg -> @@ -459,25 +463,37 @@ let rec load_file state fn = regabs state; match state.file_infos.cmt_infos with | None -> bad_files := fn :: !bad_files - | Some {cmt_annots = Implementation x; cmt_value_dependencies; _} -> - let prepare = function - | {Types.val_loc = {Location.loc_start = loc1; loc_ghost = false; _}; _}, - {Types.val_loc = {Location.loc_start = loc2; loc_ghost = false; _}; _} -> - DeadObj.add_equal loc1 loc2; - VdNode.merge_locs ~force:true loc2 loc1 - | _ -> () + | Some ({cmt_annots = Implementation x; _} as cmt_infos) -> + let uid_decl_dep_to_loc_pair (_dep_kind, uid_def, uid_decl) = + let ( let* ) x f = Option.bind x f in + let loc_opt_of_uid uid = + let* decl = + Uid.Tbl.find_opt cmt_infos.cmt_uid_to_decl uid + in + match decl with + | Value {val_loc = {loc_start; loc_ghost = false; _}; _} -> + Some loc_start + | _ -> None + in + let* def_loc = loc_opt_of_uid uid_def in + let* decl_loc = loc_opt_of_uid uid_decl in + Some (def_loc, decl_loc) + in + let value_dep = + cmt_infos.cmt_declaration_dependencies + |> List.filter_map uid_decl_dep_to_loc_pair + in + let prepare (loc1, loc2) = + DeadObj.add_equal loc1 loc2; + VdNode.merge_locs ~force:true loc2 loc1 in - List.iter prepare cmt_value_dependencies; + List.iter prepare value_dep; ignore (collect_references.Tast_mapper.structure collect_references x); let loc_dep = if !DeadFlag.exported.DeadFlag.print then - List.rev_map - (fun (vd1, vd2) -> - (vd1.Types.val_loc.Location.loc_start, vd2.Types.val_loc.Location.loc_start) - ) - cmt_value_dependencies + value_dep else [] in eof loc_dep diff --git a/src/deadLexiFi.ml b/src/deadLexiFi.ml index 68b48c0..9621e15 100644 --- a/src/deadLexiFi.ml +++ b/src/deadLexiFi.ml @@ -38,7 +38,8 @@ let () = DeadLexiFi.sig_value := (fun value -> let add strct = match strct.pstr_desc with - | Pstr_eval ({pexp_desc = Pexp_constant (Pconst_string (s, _, _)); _}, _) -> + | Pstr_eval ({pexp_desc = Pexp_constant {pconst_desc= (Pconst_string (s, _, _)); _}; + _}, _) -> hashtbl_add_unique_to_list str s value.val_loc.loc_start | _ -> () in From badcf5b3c87f81ab7e3d538b13ee808407539543 Mon Sep 17 00:00:00 2001 From: Corentin De Souza <9597216+fantazio@users.noreply.github.com> Date: Sat, 6 Dec 2025 19:15:52 +0100 Subject: [PATCH 2/8] [src][utils] move `Mod.sign` to `Utils.signature_of_modtype` This will be used in by the state component --- src/deadCode.ml | 6 +++--- src/deadMod.ml | 12 ++---------- src/utils.ml | 7 +++++++ src/utils.mli | 10 ++++++++++ 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/deadCode.ml b/src/deadCode.ml index 4bab96a..b9d0098 100644 --- a/src/deadCode.ml +++ b/src/deadCode.ml @@ -50,7 +50,7 @@ let rec collect_export ?(mod_type = false) path u stock = function | Sig_modtype (id, {Types.mtd_type = Some t; _}, _)) as s -> let collect = match s with Sig_modtype _ -> mod_type | _ -> true in if collect then - DeadMod.sign t + Utils.signature_of_modtype t |> List.iter (collect_export ~mod_type (id :: path) u stock) | _ -> () @@ -145,9 +145,9 @@ let structure_item super self i = in let rec includ mod_expr = match mod_expr.mod_desc with - | Tmod_ident (_, _) -> collect_include (DeadMod.sign mod_expr.mod_type) + | Tmod_ident (_, _) -> collect_include (Utils.signature_of_modtype mod_expr.mod_type) | Tmod_structure structure -> collect_include structure.str_type - | Tmod_unpack (_, mod_type) -> collect_include (DeadMod.sign mod_type) + | Tmod_unpack (_, mod_type) -> collect_include (Utils.signature_of_modtype mod_type) | Tmod_functor (_, mod_expr) | Tmod_apply (_, mod_expr, _) | Tmod_apply_unit mod_expr diff --git a/src/deadMod.ml b/src/deadMod.ml index 33a1679..fc10813 100644 --- a/src/deadMod.ml +++ b/src/deadMod.ml @@ -16,14 +16,6 @@ open DeadCommon let defined : string list ref = ref [] - -let rec sign ?(select_param = false) = function - | Mty_signature sg -> sg - | Mty_functor (_, t) when not select_param -> sign t - | Mty_functor (Named (_, t), _) -> sign t - | _ -> [] - - let item maker = function | Sig_value (id, {val_loc = {Location.loc_start= loc; _}; _}, _) -> (Ident.name id, loc)::[] @@ -52,12 +44,12 @@ let item maker = function | _ -> [] let rec make_content typ = - List.map (item make_content) (sign typ) + List.map (item make_content) (Utils.signature_of_modtype typ) |> List.flatten let rec make_arg typ = - List.map (item make_arg) (sign ~select_param:true typ) + List.map (item make_arg) (Utils.signature_of_modtype ~select_param:true typ) |> List.flatten diff --git a/src/utils.ml b/src/utils.ml index 0de8687..696b789 100644 --- a/src/utils.ml +++ b/src/utils.ml @@ -4,3 +4,10 @@ let unit fn = | ".pp" -> Filename.remove_extension u | _ -> u +let rec signature_of_modtype ?(select_param = false) modtype = + let open Types in + match modtype with + | Mty_signature sg -> sg + | Mty_functor (_, t) when not select_param -> signature_of_modtype t + | Mty_functor (Named (_, t), _) -> signature_of_modtype t + | _ -> [] diff --git a/src/utils.mli b/src/utils.mli index 526dc8d..93a0e95 100644 --- a/src/utils.mli +++ b/src/utils.mli @@ -1 +1,11 @@ val unit : string -> string +(** [unit filename] estimates the compilation unit of [filename] *) + +val signature_of_modtype : + ?select_param:bool -> Types.module_type -> Types.signature +(** [signature_of_modtype ?select_param modtype] returns the selected signature + of [modtype]. If [modtype] is a functor, then [select_param] is used to + select either the signature of the parameter or the result of the functor. + Note: [select_param] is [false] by default. If set to [true], it is reset to + [false] after looking for the parameter of the first functor. + There is currently no way to select the parameter of a parameter. *) From add8187ebd8b97fa045ffed30f7afae1fb34fc0e Mon Sep 17 00:00:00 2001 From: Corentin De Souza <9597216+fantazio@users.noreply.github.com> Date: Fri, 5 Dec 2025 22:44:35 +0100 Subject: [PATCH 3/8] [src][input][1/n] rely on `.cmti` instead of `.cmi` If a compilation has a`.mli`, then it has a `.cmti` which is more complete than the `.cmi`. This extra information is useful to fill the state's `file_infos`. However, a `.ml` wihtout a corresponding `.mli` does not have a corresponding `.cmti`. Hence, introducing even more mistakes for now. Now that interfaces are read from `.cmti` instead of `.cmi`, the order in which the files are read is reversed to ensure interfaces (`.cmti`) are read before their corresponding implementation (`.cmt`) --- README.md | 2 +- check/classic/classic.ref | 112 +++---- check/internal/internal.ref | 112 +++---- check/threshold-1/threshold-1.ref | 296 ++++++++--------- check/threshold-3-0.5/threshold-3-0.5.ref | 386 +++++++++++----------- docs/USAGE.md | 14 +- src/deadCode.ml | 61 ++-- src/state/file_infos.ml | 233 +++++-------- src/state/file_infos.mli | 21 +- src/state/state.ml | 14 +- 10 files changed, 561 insertions(+), 690 deletions(-) diff --git a/README.md b/README.md index 4158c89..237c7f0 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Dead-code analyzer for OCaml ## Overview The tool assumes that **.mli** files are compiled with **-keep-locs** and **.ml** -files with **-bin-annot**. Exported values are collected by reading .cmi or .cmt +files with **-bin-annot**. Exported values are collected by reading .cmti or .cmt files (depending on the existence of an explicit .mli interface). References to such values are collected by reading typed trees from .cmt files diff --git a/check/classic/classic.ref b/check/classic/classic.ref index 5fde27b..4f638d0 100644 --- a/check/classic/classic.ref +++ b/check/classic/classic.ref @@ -2,8 +2,7 @@ ========================= ./examples/using_dune/preprocessed_lib/preprocessed.mli:1: unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused: Not detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg @@ -18,12 +17,11 @@ ./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure - +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg @@ -38,38 +36,35 @@ ./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure - +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y ./examples/using_make/advanced/val.mli:1: x: Should not be detected ./examples/using_make/advanced/val.mli:2: y: Should not be detected -./examples/using_make/bar.ml:1: x -./examples/using_make/bar_fn.ml:3: h +./examples/using_make/bar.ml:1: x: Not detected +./examples/using_make/bar_fn.ml:3: h: Not detected ./examples/using_make/baz.mli:1: z ./examples/using_make/baz.mli:3: u -./examples/using_make/cond_sel.ml:13: h - -./examples/using_make/dir/alias_opt.ml:7: y -./examples/using_make/dir/alias_opt.ml:14: x -./examples/using_make/dir/anon_call.ml:1: f -./examples/using_make/dir/anon_call.ml:5: g -./examples/using_make/dir/anon_call.ml:9: h -./examples/using_make/dir/anon_call2.ml:1: f -./examples/using_make/dir/anon_call2.ml:5: g -./examples/using_make/dir/anon_call2.ml:9: h -./examples/using_make/dir/match_opt.ml:8: l -./examples/using_make/dir/matchopt.ml:5: w +./examples/using_make/cond_sel.ml:13: h: Not detected +./examples/using_make/dir/alias_opt.ml:7: y: Not detected +./examples/using_make/dir/alias_opt.ml:14: x: Not detected +./examples/using_make/dir/anon_call.ml:1: f: Not detected +./examples/using_make/dir/anon_call.ml:5: g: Not detected +./examples/using_make/dir/anon_call.ml:9: h: Not detected +./examples/using_make/dir/anon_call2.ml:1: f: Not detected +./examples/using_make/dir/anon_call2.ml:5: g: Not detected +./examples/using_make/dir/anon_call2.ml:9: h: Not detected +./examples/using_make/dir/match_opt.ml:8: l: Not detected +./examples/using_make/dir/matchopt.ml:5: w: Not detected ./examples/using_make/dir/mod.mli:10: M.f ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x -./examples/using_make/dir/ref_opt.ml:3: no -./examples/using_make/dir/ref_opt.ml:11: x - +./examples/using_make/dir/ref_opt.ml:3: no: Not detected +./examples/using_make/dir/ref_opt.ml:11: x: Not detected ./examples/using_make/exported.mli:6: M1.five ./examples/using_make/exported.mli:10: F.plus_five ./examples/using_make/exported.mli:11: F.times_five @@ -82,9 +77,9 @@ ./examples/using_make/functor.mli:3: M.none ./examples/using_make/functor.mli:7: F.g ./examples/using_make/functor.mli:11: N.g -./examples/using_make/let_in.ml:3: parent -./examples/using_make/let_test.ml:3: g -./examples/using_make/matchopt.ml:5: w +./examples/using_make/let_in.ml:3: parent: Not detected +./examples/using_make/let_test.ml:3: g: Not detected +./examples/using_make/matchopt.ml:5: w: Not detected ./examples/using_make/mod_alias.mli:2: M1.id ./examples/using_make/mod_alias.mli:6: M2.id @@ -93,11 +88,11 @@ ./examples/using_make/obj/inher.mli:11: o ./examples/using_make/obj/inher.mli:13: f -./examples/using_make/opt_in_opt.ml:7: x -./examples/using_make/qux.ml:1: z -./examples/using_make/unused_fn.ml:3: g -./examples/using_make/unused_fn.ml:5: var -./examples/using_make/useless_opt.ml:3: x +./examples/using_make/opt_in_opt.ml:7: x: Not detected +./examples/using_make/qux.ml:1: z: Not detected +./examples/using_make/unused_fn.ml:3: g: Not detected +./examples/using_make/unused_fn.ml:5: var: Not detected +./examples/using_make/useless_opt.ml:3: x: Not detected ./examples/using_make/variant.mli:5: f Nothing else to report in this section @@ -107,8 +102,7 @@ Nothing else to report in this section .> UNUSED METHODS: ================= ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused: Not detected ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -139,22 +133,23 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected +./examples/using_make/advanced/mod.mli:4: p#f: Should not be detected ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f ./examples/using_make/obj/coerce.mli:6: p#h -./examples/using_make/obj/constraint.ml:1: p#g +./examples/using_make/obj/constraint.ml:1: p#g: Not detected ./examples/using_make/obj/fooCl.mli:1: p1#g ./examples/using_make/obj/fooCl.mli:1: p1#h ./examples/using_make/obj/fooCl.mli:7: p2#h -./examples/using_make/obj/fun_class.ml:1: c#m3 -./examples/using_make/obj/fun_obj_param.ml:1: f#n +./examples/using_make/obj/fun_class.ml:1: c#m3: Not detected +./examples/using_make/obj/fun_obj_param.ml:1: f#n: Not detected ./examples/using_make/obj/inher.mli:1: p#h ./examples/using_make/obj/named.mli:10: c#g -./examples/using_make/obj/obj_inher.ml:1: c#g -./examples/using_make/obj/obj_inher.ml:1: c#h -./examples/using_make/obj/obj_inher.ml:19: o3#k -./examples/using_make/obj/object.ml:1: o#h +./examples/using_make/obj/obj_inher.ml:1: c#g: Not detected +./examples/using_make/obj/obj_inher.ml:1: c#h: Not detected +./examples/using_make/obj/obj_inher.ml:19: o3#k: Not detected +./examples/using_make/obj/object.ml:1: o#h: Not detected ./examples/using_make/obj/overr.mli:1: p1#g ./examples/using_make/obj/overr.mli:1: p1#h ./examples/using_make/obj/overr.mli:7: p2#g @@ -166,13 +161,12 @@ Nothing else to report in this section .> UNUSED CONSTRUCTORS/RECORD FIELDS: ==================================== -./examples/using_dune/preprocessed_lib/preprocessed.mli:14: constructors.Unused -./examples/using_dune/preprocessed_lib/preprocessed.mli:19: constr_with_eq.Unused -./examples/using_dune/preprocessed_lib/preprocessed.mli:23: record.unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused - +./examples/using_dune/preprocessed_lib/preprocessed.mli:14: constructors.Unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:19: constr_with_eq.Unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:23: record.unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused: Not detected ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:1: unused_single_no_param.Unused_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:2: unused_single_unit.Unused_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:3: unused_single_param.Unused_single_param @@ -541,7 +535,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 471 -Success: 443 -Failed: 28 -Ratio: 94.0552016985% +Total: 472 +Success: 395 +Failed: 77 +Ratio: 83.686440678% diff --git a/check/internal/internal.ref b/check/internal/internal.ref index ff15644..c51f85c 100644 --- a/check/internal/internal.ref +++ b/check/internal/internal.ref @@ -2,8 +2,7 @@ ========================= ./examples/using_dune/preprocessed_lib/preprocessed.mli:1: unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused: Not detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected @@ -20,12 +19,11 @@ ./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure - +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected @@ -42,38 +40,35 @@ ./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure - +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y ./examples/using_make/advanced/val.mli:1: x: Should not be detected ./examples/using_make/advanced/val.mli:2: y: Should not be detected -./examples/using_make/bar.ml:1: x -./examples/using_make/bar_fn.ml:3: h +./examples/using_make/bar.ml:1: x: Not detected +./examples/using_make/bar_fn.ml:3: h: Not detected ./examples/using_make/baz.mli:1: z ./examples/using_make/baz.mli:3: u -./examples/using_make/cond_sel.ml:13: h - -./examples/using_make/dir/alias_opt.ml:7: y -./examples/using_make/dir/alias_opt.ml:14: x -./examples/using_make/dir/anon_call.ml:1: f -./examples/using_make/dir/anon_call.ml:5: g -./examples/using_make/dir/anon_call.ml:9: h -./examples/using_make/dir/anon_call2.ml:1: f -./examples/using_make/dir/anon_call2.ml:5: g -./examples/using_make/dir/anon_call2.ml:9: h -./examples/using_make/dir/match_opt.ml:8: l -./examples/using_make/dir/matchopt.ml:5: w +./examples/using_make/cond_sel.ml:13: h: Not detected +./examples/using_make/dir/alias_opt.ml:7: y: Not detected +./examples/using_make/dir/alias_opt.ml:14: x: Not detected +./examples/using_make/dir/anon_call.ml:1: f: Not detected +./examples/using_make/dir/anon_call.ml:5: g: Not detected +./examples/using_make/dir/anon_call.ml:9: h: Not detected +./examples/using_make/dir/anon_call2.ml:1: f: Not detected +./examples/using_make/dir/anon_call2.ml:5: g: Not detected +./examples/using_make/dir/anon_call2.ml:9: h: Not detected +./examples/using_make/dir/match_opt.ml:8: l: Not detected +./examples/using_make/dir/matchopt.ml:5: w: Not detected ./examples/using_make/dir/mod.mli:10: M.f: Should not be detected ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x -./examples/using_make/dir/ref_opt.ml:3: no -./examples/using_make/dir/ref_opt.ml:11: x - +./examples/using_make/dir/ref_opt.ml:3: no: Not detected +./examples/using_make/dir/ref_opt.ml:11: x: Not detected ./examples/using_make/exported.mli:11: F.times_five: Not detected ./examples/using_make/exported.mli:17: M2.ten: Not detected ./examples/using_make/exported.mli:6: M1.five: Should not be detected @@ -88,20 +83,20 @@ ./examples/using_make/functor.mli:3: M.none ./examples/using_make/functor.mli:7: F.g: Should not be detected ./examples/using_make/functor.mli:11: N.g: Should not be detected -./examples/using_make/let_in.ml:3: parent -./examples/using_make/let_test.ml:3: g -./examples/using_make/matchopt.ml:5: w +./examples/using_make/let_in.ml:3: parent: Not detected +./examples/using_make/let_test.ml:3: g: Not detected +./examples/using_make/matchopt.ml:5: w: Not detected ./examples/using_make/mod_alias.mli:2: M1.id: Should not be detected ./examples/using_make/mod_alias.mli:6: M2.id: Should not be detected ./examples/using_make/obj/class.mli:7: o: Should not be detected ./examples/using_make/obj/class.mli:9: f: Should not be detected ./examples/using_make/obj/inher.mli:11: o: Should not be detected ./examples/using_make/obj/inher.mli:13: f: Should not be detected -./examples/using_make/opt_in_opt.ml:7: x -./examples/using_make/qux.ml:1: z -./examples/using_make/unused_fn.ml:3: g -./examples/using_make/unused_fn.ml:5: var -./examples/using_make/useless_opt.ml:3: x +./examples/using_make/opt_in_opt.ml:7: x: Not detected +./examples/using_make/qux.ml:1: z: Not detected +./examples/using_make/unused_fn.ml:3: g: Not detected +./examples/using_make/unused_fn.ml:5: var: Not detected +./examples/using_make/useless_opt.ml:3: x: Not detected ./examples/using_make/variant.mli:5: f: Should not be detected Nothing else to report in this section -------------------------------------------------------------------------------- @@ -110,8 +105,7 @@ Nothing else to report in this section .> UNUSED METHODS: ================= ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused: Not detected ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -142,22 +136,23 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected +./examples/using_make/advanced/mod.mli:4: p#f: Should not be detected ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f ./examples/using_make/obj/coerce.mli:6: p#h -./examples/using_make/obj/constraint.ml:1: p#g +./examples/using_make/obj/constraint.ml:1: p#g: Not detected ./examples/using_make/obj/fooCl.mli:1: p1#g ./examples/using_make/obj/fooCl.mli:1: p1#h ./examples/using_make/obj/fooCl.mli:7: p2#h -./examples/using_make/obj/fun_class.ml:1: c#m3 -./examples/using_make/obj/fun_obj_param.ml:1: f#n +./examples/using_make/obj/fun_class.ml:1: c#m3: Not detected +./examples/using_make/obj/fun_obj_param.ml:1: f#n: Not detected ./examples/using_make/obj/inher.mli:1: p#h ./examples/using_make/obj/named.mli:10: c#g -./examples/using_make/obj/obj_inher.ml:1: c#g -./examples/using_make/obj/obj_inher.ml:1: c#h -./examples/using_make/obj/obj_inher.ml:19: o3#k -./examples/using_make/obj/object.ml:1: o#h +./examples/using_make/obj/obj_inher.ml:1: c#g: Not detected +./examples/using_make/obj/obj_inher.ml:1: c#h: Not detected +./examples/using_make/obj/obj_inher.ml:19: o3#k: Not detected +./examples/using_make/obj/object.ml:1: o#h: Not detected ./examples/using_make/obj/overr.mli:1: p1#g ./examples/using_make/obj/overr.mli:1: p1#h ./examples/using_make/obj/overr.mli:7: p2#g @@ -169,13 +164,12 @@ Nothing else to report in this section .> UNUSED CONSTRUCTORS/RECORD FIELDS: ==================================== -./examples/using_dune/preprocessed_lib/preprocessed.mli:14: constructors.Unused -./examples/using_dune/preprocessed_lib/preprocessed.mli:19: constr_with_eq.Unused -./examples/using_dune/preprocessed_lib/preprocessed.mli:23: record.unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused - +./examples/using_dune/preprocessed_lib/preprocessed.mli:14: constructors.Unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:19: constr_with_eq.Unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:23: record.unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused: Not detected ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:1: unused_single_no_param.Unused_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:2: unused_single_unit.Unused_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:3: unused_single_param.Unused_single_param @@ -544,7 +538,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 479 -Success: 405 -Failed: 74 -Ratio: 84.5511482255% +Total: 480 +Success: 357 +Failed: 123 +Ratio: 74.375% diff --git a/check/threshold-1/threshold-1.ref b/check/threshold-1/threshold-1.ref index ff063c7..731524e 100644 --- a/check/threshold-1/threshold-1.ref +++ b/check/threshold-1/threshold-1.ref @@ -2,8 +2,7 @@ ========================= ./examples/using_dune/preprocessed_lib/preprocessed.mli:1: unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused: Not detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected @@ -20,12 +19,11 @@ ./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure - +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected @@ -42,38 +40,35 @@ ./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure - +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y ./examples/using_make/advanced/val.mli:1: x: Should not be detected ./examples/using_make/advanced/val.mli:2: y: Should not be detected -./examples/using_make/bar.ml:1: x -./examples/using_make/bar_fn.ml:3: h +./examples/using_make/bar.ml:1: x: Not detected +./examples/using_make/bar_fn.ml:3: h: Not detected ./examples/using_make/baz.mli:1: z ./examples/using_make/baz.mli:3: u -./examples/using_make/cond_sel.ml:13: h - -./examples/using_make/dir/alias_opt.ml:7: y -./examples/using_make/dir/alias_opt.ml:14: x -./examples/using_make/dir/anon_call.ml:1: f -./examples/using_make/dir/anon_call.ml:5: g -./examples/using_make/dir/anon_call.ml:9: h -./examples/using_make/dir/anon_call2.ml:1: f -./examples/using_make/dir/anon_call2.ml:5: g -./examples/using_make/dir/anon_call2.ml:9: h -./examples/using_make/dir/match_opt.ml:8: l -./examples/using_make/dir/matchopt.ml:5: w +./examples/using_make/cond_sel.ml:13: h: Not detected +./examples/using_make/dir/alias_opt.ml:7: y: Not detected +./examples/using_make/dir/alias_opt.ml:14: x: Not detected +./examples/using_make/dir/anon_call.ml:1: f: Not detected +./examples/using_make/dir/anon_call.ml:5: g: Not detected +./examples/using_make/dir/anon_call.ml:9: h: Not detected +./examples/using_make/dir/anon_call2.ml:1: f: Not detected +./examples/using_make/dir/anon_call2.ml:5: g: Not detected +./examples/using_make/dir/anon_call2.ml:9: h: Not detected +./examples/using_make/dir/match_opt.ml:8: l: Not detected +./examples/using_make/dir/matchopt.ml:5: w: Not detected ./examples/using_make/dir/mod.mli:10: M.f: Should not be detected ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x -./examples/using_make/dir/ref_opt.ml:3: no -./examples/using_make/dir/ref_opt.ml:11: x - +./examples/using_make/dir/ref_opt.ml:3: no: Not detected +./examples/using_make/dir/ref_opt.ml:11: x: Not detected ./examples/using_make/exported.mli:11: F.times_five: Not detected ./examples/using_make/exported.mli:17: M2.ten: Not detected ./examples/using_make/exported.mli:6: M1.five: Should not be detected @@ -88,20 +83,20 @@ ./examples/using_make/functor.mli:3: M.none ./examples/using_make/functor.mli:7: F.g: Should not be detected ./examples/using_make/functor.mli:11: N.g: Should not be detected -./examples/using_make/let_in.ml:3: parent -./examples/using_make/let_test.ml:3: g -./examples/using_make/matchopt.ml:5: w +./examples/using_make/let_in.ml:3: parent: Not detected +./examples/using_make/let_test.ml:3: g: Not detected +./examples/using_make/matchopt.ml:5: w: Not detected ./examples/using_make/mod_alias.mli:2: M1.id: Should not be detected ./examples/using_make/mod_alias.mli:6: M2.id: Should not be detected ./examples/using_make/obj/class.mli:7: o: Should not be detected ./examples/using_make/obj/class.mli:9: f: Should not be detected ./examples/using_make/obj/inher.mli:11: o: Should not be detected ./examples/using_make/obj/inher.mli:13: f: Should not be detected -./examples/using_make/opt_in_opt.ml:7: x -./examples/using_make/qux.ml:1: z -./examples/using_make/unused_fn.ml:3: g -./examples/using_make/unused_fn.ml:5: var -./examples/using_make/useless_opt.ml:3: x +./examples/using_make/opt_in_opt.ml:7: x: Not detected +./examples/using_make/qux.ml:1: z: Not detected +./examples/using_make/unused_fn.ml:3: g: Not detected +./examples/using_make/unused_fn.ml:5: var: Not detected +./examples/using_make/useless_opt.ml:3: x: Not detected ./examples/using_make/variant.mli:5: f: Should not be detected -------- @@ -144,9 +139,8 @@ ./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:4: externally_used ./examples/using_dune/preprocessed_lib/preprocessed.mli:31: f: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:4: internally_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:5: externally_used - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:4: internally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:5: externally_used: Not detected ./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected @@ -167,8 +161,7 @@ ./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected -./examples/using_dune/unwrapped_lib/style/style.ml:1: all - +./examples/using_dune/unwrapped_lib/style/style.ml:1: all: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:1: used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:4: externally_used_int @@ -190,22 +183,21 @@ ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:3: internally_used_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:4: externally_used_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:8: externally_matched_option -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:15: internally_used_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:16: externally_used_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:27: internally_used_closure -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:28: externally_used_closure - +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:3: internally_used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:4: externally_used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:8: externally_matched_option: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:15: internally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:16: externally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:27: internally_used_closure: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:28: externally_used_closure: Not detected ./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected @@ -226,8 +218,7 @@ ./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected -./examples/using_dune/wrapped_lib/style/style.ml:1: all - +./examples/using_dune/wrapped_lib/style/style.ml:1: all: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:1: used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:4: externally_used_int @@ -249,69 +240,65 @@ ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:3: internally_used_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:4: externally_used_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:8: externally_matched_option -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:15: internally_used_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:16: externally_used_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:27: internally_used_closure -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:28: externally_used_closure - -./examples/using_make/advanced/incl.ml:7: f +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int: Not detected +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:3: internally_used_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:4: externally_used_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:8: externally_matched_option: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:15: internally_used_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:16: externally_used_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:27: internally_used_closure: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:28: externally_used_closure: Not detected +./examples/using_make/advanced/incl.ml:7: f: Not detected ./examples/using_make/advanced/mod.mli:1: f ./examples/using_make/advanced/mod.mli:2: x ./examples/using_make/advanced/val.mli:1: x: Not detected ./examples/using_make/advanced/val.mli:2: y: Not detected ./examples/using_make/baz.mli:2: t -./examples/using_make/cond_sel.ml:9: f -./examples/using_make/cond_sel.ml:11: g - -./examples/using_make/dir/alias_opt.ml:4: baz -./examples/using_make/dir/alias_opt.ml:11: foo -./examples/using_make/dir/alias_opt.ml:12: bar -./examples/using_make/dir/fn_arg.ml:1: f -./examples/using_make/dir/fn_arg.ml:3: g -./examples/using_make/dir/fn_arg.ml:9: i -./examples/using_make/dir/fn_arg.ml:11: j -./examples/using_make/dir/hidden_opt_use.ml:1: f -./examples/using_make/dir/hidden_opt_use.ml:3: apply -./examples/using_make/dir/match_opt.ml:3: m +./examples/using_make/cond_sel.ml:9: f: Not detected +./examples/using_make/cond_sel.ml:11: g: Not detected +./examples/using_make/dir/alias_opt.ml:4: baz: Not detected +./examples/using_make/dir/alias_opt.ml:11: foo: Not detected +./examples/using_make/dir/alias_opt.ml:12: bar: Not detected +./examples/using_make/dir/fn_arg.ml:1: f: Not detected +./examples/using_make/dir/fn_arg.ml:3: g: Not detected +./examples/using_make/dir/fn_arg.ml:9: i: Not detected +./examples/using_make/dir/fn_arg.ml:11: j: Not detected +./examples/using_make/dir/hidden_opt_use.ml:1: f: Not detected +./examples/using_make/dir/hidden_opt_use.ml:3: apply: Not detected +./examples/using_make/dir/match_opt.ml:3: m: Not detected ./examples/using_make/dir/mod.mli:10: M.f: Not detected -./examples/using_make/dir/partial.ml:5: g -./examples/using_make/dir/ref_fn.ml:5: g -./examples/using_make/dir/ref_opt.ml:7: g - +./examples/using_make/dir/partial.ml:5: g: Not detected +./examples/using_make/dir/ref_fn.ml:5: g: Not detected +./examples/using_make/dir/ref_opt.ml:7: g: Not detected ./examples/using_make/foo.mli:1: x ./examples/using_make/fooFn.mli:1: f ./examples/using_make/functor.mli:2: M.f: Not detected -./examples/using_make/if_end.ml:1: f -./examples/using_make/if_end.ml:3: g -./examples/using_make/if_end.ml:5: h +./examples/using_make/if_end.ml:1: f: Not detected +./examples/using_make/if_end.ml:3: g: Not detected +./examples/using_make/if_end.ml:5: h: Not detected ./examples/using_make/letIn.mli:1: f ./examples/using_make/mod_alias.mli:2: M1.id: Not detected ./examples/using_make/mod_alias.mli:6: M2.id: Not detected ./examples/using_make/obj/class.mli:9: f: Not detected -./examples/using_make/obj/fun_class.ml:8: f -./examples/using_make/obj/fun_obj_param.ml:7: app_m +./examples/using_make/obj/fun_class.ml:8: f: Not detected +./examples/using_make/obj/fun_obj_param.ml:7: app_m: Not detected ./examples/using_make/obj/inher.mli:13: f: Not detected -./examples/using_make/obj/obj_inher.ml:7: o -./examples/using_make/obj/obj_inher.ml:12: o4 -./examples/using_make/obj/obj_inher.ml:17: o2 -./examples/using_make/obj/obj_inher.ml:19: o3 -./examples/using_make/obj/obj_inher.ml:24: f -./examples/using_make/obj/object.ml:7: f - -./examples/using_make/opt_in_opt.ml:5: baz -./examples/using_make/partial_opt.ml:1: f -./examples/using_make/useless_opt.ml:1: foo +./examples/using_make/obj/obj_inher.ml:7: o: Not detected +./examples/using_make/obj/obj_inher.ml:12: o4: Not detected +./examples/using_make/obj/obj_inher.ml:17: o2: Not detected +./examples/using_make/obj/obj_inher.ml:19: o3: Not detected +./examples/using_make/obj/obj_inher.ml:24: f: Not detected +./examples/using_make/obj/object.ml:7: f: Not detected +./examples/using_make/opt_in_opt.ml:5: baz: Not detected +./examples/using_make/partial_opt.ml:1: f: Not detected +./examples/using_make/useless_opt.ml:1: foo: Not detected ./examples/using_make/variant.mli:5: f: Not detected Nothing else to report in this section -------------------------------------------------------------------------------- @@ -320,8 +307,7 @@ Nothing else to report in this section .> UNUSED METHODS: ================= ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused: Not detected ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -352,22 +338,23 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected +./examples/using_make/advanced/mod.mli:4: p#f: Should not be detected ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f ./examples/using_make/obj/coerce.mli:6: p#h -./examples/using_make/obj/constraint.ml:1: p#g +./examples/using_make/obj/constraint.ml:1: p#g: Not detected ./examples/using_make/obj/fooCl.mli:1: p1#g ./examples/using_make/obj/fooCl.mli:1: p1#h ./examples/using_make/obj/fooCl.mli:7: p2#h -./examples/using_make/obj/fun_class.ml:1: c#m3 -./examples/using_make/obj/fun_obj_param.ml:1: f#n +./examples/using_make/obj/fun_class.ml:1: c#m3: Not detected +./examples/using_make/obj/fun_obj_param.ml:1: f#n: Not detected ./examples/using_make/obj/inher.mli:1: p#h ./examples/using_make/obj/named.mli:10: c#g -./examples/using_make/obj/obj_inher.ml:1: c#g -./examples/using_make/obj/obj_inher.ml:1: c#h -./examples/using_make/obj/obj_inher.ml:19: o3#k -./examples/using_make/obj/object.ml:1: o#h +./examples/using_make/obj/obj_inher.ml:1: c#g: Not detected +./examples/using_make/obj/obj_inher.ml:1: c#h: Not detected +./examples/using_make/obj/obj_inher.ml:19: o3#k: Not detected +./examples/using_make/obj/object.ml:1: o#h: Not detected ./examples/using_make/obj/overr.mli:1: p1#g ./examples/using_make/obj/overr.mli:1: p1#h ./examples/using_make/obj/overr.mli:7: p2#g @@ -379,9 +366,8 @@ Nothing else to report in this section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#externally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#internally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#externally_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#internally_used - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#externally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#internally_used: Not detected ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#used ./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun: Not detected @@ -411,29 +397,28 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int: Not detected ./examples/using_make/advanced/func.mli:3: M.c#f -./examples/using_make/advanced/mod.mli:4: p#f - +./examples/using_make/advanced/mod.mli:4: p#f: Not detected ./examples/using_make/obj/class.mli:1: c#f ./examples/using_make/obj/class.mli:1: c#g ./examples/using_make/obj/class_type.mli:7: p#f ./examples/using_make/obj/class_type.mli:7: p#h ./examples/using_make/obj/coerce.mli:8: c#h -./examples/using_make/obj/constraint.ml:1: p#f -./examples/using_make/obj/depend.ml:8: M.c#f +./examples/using_make/obj/constraint.ml:1: p#f: Not detected +./examples/using_make/obj/depend.ml:8: M.c#f: Not detected ./examples/using_make/obj/fooCl.mli:1: p1#f ./examples/using_make/obj/fooCl.mli:7: p2#g -./examples/using_make/obj/fun_class.ml:1: c#m1 -./examples/using_make/obj/fun_class.ml:1: c#m2 -./examples/using_make/obj/fun_class.ml:1: c#m4 -./examples/using_make/obj/fun_obj_param.ml:1: f#m -./examples/using_make/obj/fun_obj_param.ml:1: f#x +./examples/using_make/obj/fun_class.ml:1: c#m1: Not detected +./examples/using_make/obj/fun_class.ml:1: c#m2: Not detected +./examples/using_make/obj/fun_class.ml:1: c#m4: Not detected +./examples/using_make/obj/fun_obj_param.ml:1: f#m: Not detected +./examples/using_make/obj/fun_obj_param.ml:1: f#x: Not detected ./examples/using_make/obj/inher.mli:1: p#f ./examples/using_make/obj/inher.mli:1: p#g ./examples/using_make/obj/named.mli:1: p1#g ./examples/using_make/obj/named.mli:6: p2#f ./examples/using_make/obj/named.mli:10: c#f -./examples/using_make/obj/object.ml:1: o#f -./examples/using_make/obj/object.ml:1: o#g +./examples/using_make/obj/object.ml:1: o#f: Not detected +./examples/using_make/obj/object.ml:1: o#g: Not detected ./examples/using_make/obj/overr.mli:1: p1#f ./examples/using_make/obj/overr.mli:12: c#g @@ -443,13 +428,12 @@ Nothing else to report in this section .> UNUSED CONSTRUCTORS/RECORD FIELDS: ==================================== -./examples/using_dune/preprocessed_lib/preprocessed.mli:14: constructors.Unused -./examples/using_dune/preprocessed_lib/preprocessed.mli:19: constr_with_eq.Unused -./examples/using_dune/preprocessed_lib/preprocessed.mli:23: record.unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused - +./examples/using_dune/preprocessed_lib/preprocessed.mli:14: constructors.Unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:19: constr_with_eq.Unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:23: record.unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused: Not detected ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:1: unused_single_no_param.Unused_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:2: unused_single_unit.Unused_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:3: unused_single_param.Unused_single_param @@ -515,17 +499,19 @@ Nothing else to report in this section .>-> ALMOST UNUSED CONSTRUCTORS/RECORD FIELDS: Called 1 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./examples/using_dune/preprocessed_lib/preprocessed.mli:16: constructors.Internally_used -./examples/using_dune/preprocessed_lib/preprocessed.mli:17: constructors.Externally_used -./examples/using_dune/preprocessed_lib/preprocessed.mli:25: record.internally_used -./examples/using_dune/preprocessed_lib/preprocessed.mli:26: record.externally_used +./examples/using_dune/preprocessed_lib/preprocessed.mli:14: constructors.Unused: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:16: constructors.Internally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:17: constructors.Externally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:19: constr_with_eq.Unused: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:23: record.unused: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:25: record.internally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:26: record.externally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:29: record_with_eq.implicitly_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:27: constructors.Internally_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:28: constructors.Externally_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:41: record.internally_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:42: record.externally_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:45: record_with_eq.implicitly_used - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:27: constructors.Internally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:28: constructors.Externally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:41: record.internally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:42: record.externally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:45: record_with_eq.implicitly_used: Not detected ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:25: internally_used_single_no_param.Internally_used_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:26: internally_used_single_unit.Internally_used_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:27: internally_used_single_param.Internally_used_single_param @@ -892,7 +878,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 796 -Success: 624 -Failed: 172 -Ratio: 78.391959799% +Total: 800 +Success: 491 +Failed: 309 +Ratio: 61.375% diff --git a/check/threshold-3-0.5/threshold-3-0.5.ref b/check/threshold-3-0.5/threshold-3-0.5.ref index 4d40a58..d1098ea 100644 --- a/check/threshold-3-0.5/threshold-3-0.5.ref +++ b/check/threshold-3-0.5/threshold-3-0.5.ref @@ -2,8 +2,7 @@ ========================= ./examples/using_dune/preprocessed_lib/preprocessed.mli:1: unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused: Not detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected @@ -20,12 +19,11 @@ ./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure - +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected @@ -42,38 +40,35 @@ ./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure - +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y ./examples/using_make/advanced/val.mli:1: x: Should not be detected ./examples/using_make/advanced/val.mli:2: y: Should not be detected -./examples/using_make/bar.ml:1: x -./examples/using_make/bar_fn.ml:3: h +./examples/using_make/bar.ml:1: x: Not detected +./examples/using_make/bar_fn.ml:3: h: Not detected ./examples/using_make/baz.mli:1: z ./examples/using_make/baz.mli:3: u -./examples/using_make/cond_sel.ml:13: h - -./examples/using_make/dir/alias_opt.ml:7: y -./examples/using_make/dir/alias_opt.ml:14: x -./examples/using_make/dir/anon_call.ml:1: f -./examples/using_make/dir/anon_call.ml:5: g -./examples/using_make/dir/anon_call.ml:9: h -./examples/using_make/dir/anon_call2.ml:1: f -./examples/using_make/dir/anon_call2.ml:5: g -./examples/using_make/dir/anon_call2.ml:9: h -./examples/using_make/dir/match_opt.ml:8: l -./examples/using_make/dir/matchopt.ml:5: w +./examples/using_make/cond_sel.ml:13: h: Not detected +./examples/using_make/dir/alias_opt.ml:7: y: Not detected +./examples/using_make/dir/alias_opt.ml:14: x: Not detected +./examples/using_make/dir/anon_call.ml:1: f: Not detected +./examples/using_make/dir/anon_call.ml:5: g: Not detected +./examples/using_make/dir/anon_call.ml:9: h: Not detected +./examples/using_make/dir/anon_call2.ml:1: f: Not detected +./examples/using_make/dir/anon_call2.ml:5: g: Not detected +./examples/using_make/dir/anon_call2.ml:9: h: Not detected +./examples/using_make/dir/match_opt.ml:8: l: Not detected +./examples/using_make/dir/matchopt.ml:5: w: Not detected ./examples/using_make/dir/mod.mli:10: M.f: Should not be detected ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x -./examples/using_make/dir/ref_opt.ml:3: no -./examples/using_make/dir/ref_opt.ml:11: x - +./examples/using_make/dir/ref_opt.ml:3: no: Not detected +./examples/using_make/dir/ref_opt.ml:11: x: Not detected ./examples/using_make/exported.mli:11: F.times_five: Not detected ./examples/using_make/exported.mli:17: M2.ten: Not detected ./examples/using_make/exported.mli:6: M1.five: Should not be detected @@ -88,20 +83,20 @@ ./examples/using_make/functor.mli:3: M.none ./examples/using_make/functor.mli:7: F.g: Should not be detected ./examples/using_make/functor.mli:11: N.g: Should not be detected -./examples/using_make/let_in.ml:3: parent -./examples/using_make/let_test.ml:3: g -./examples/using_make/matchopt.ml:5: w +./examples/using_make/let_in.ml:3: parent: Not detected +./examples/using_make/let_test.ml:3: g: Not detected +./examples/using_make/matchopt.ml:5: w: Not detected ./examples/using_make/mod_alias.mli:2: M1.id: Should not be detected ./examples/using_make/mod_alias.mli:6: M2.id: Should not be detected ./examples/using_make/obj/class.mli:7: o: Should not be detected ./examples/using_make/obj/class.mli:9: f: Should not be detected ./examples/using_make/obj/inher.mli:11: o: Should not be detected ./examples/using_make/obj/inher.mli:13: f: Should not be detected -./examples/using_make/opt_in_opt.ml:7: x -./examples/using_make/qux.ml:1: z -./examples/using_make/unused_fn.ml:3: g -./examples/using_make/unused_fn.ml:5: var -./examples/using_make/useless_opt.ml:3: x +./examples/using_make/opt_in_opt.ml:7: x: Not detected +./examples/using_make/qux.ml:1: z: Not detected +./examples/using_make/unused_fn.ml:3: g: Not detected +./examples/using_make/unused_fn.ml:5: var: Not detected +./examples/using_make/useless_opt.ml:3: x: Not detected ./examples/using_make/variant.mli:5: f: Should not be detected -------- @@ -144,9 +139,8 @@ ./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:4: externally_used ./examples/using_dune/preprocessed_lib/preprocessed.mli:31: f: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:4: internally_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:5: externally_used - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:4: internally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:5: externally_used: Not detected ./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected @@ -167,8 +161,7 @@ ./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected -./examples/using_dune/unwrapped_lib/style/style.ml:1: all - +./examples/using_dune/unwrapped_lib/style/style.ml:1: all: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:1: used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:4: externally_used_int @@ -190,22 +183,21 @@ ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:3: internally_used_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:4: externally_used_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:8: externally_matched_option -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:15: internally_used_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:16: externally_used_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:27: internally_used_closure -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:28: externally_used_closure - +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:3: internally_used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:4: externally_used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:8: externally_matched_option: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:15: internally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:16: externally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:27: internally_used_closure: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:28: externally_used_closure: Not detected ./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected @@ -226,8 +218,7 @@ ./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected -./examples/using_dune/wrapped_lib/style/style.ml:1: all - +./examples/using_dune/wrapped_lib/style/style.ml:1: all: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:1: used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:4: externally_used_int @@ -249,69 +240,65 @@ ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:3: internally_used_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:4: externally_used_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:8: externally_matched_option -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:15: internally_used_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:16: externally_used_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:27: internally_used_closure -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:28: externally_used_closure - -./examples/using_make/advanced/incl.ml:7: f +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int: Not detected +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:3: internally_used_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:4: externally_used_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:8: externally_matched_option: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:15: internally_used_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:16: externally_used_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:27: internally_used_closure: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:28: externally_used_closure: Not detected +./examples/using_make/advanced/incl.ml:7: f: Not detected ./examples/using_make/advanced/mod.mli:1: f ./examples/using_make/advanced/mod.mli:2: x ./examples/using_make/advanced/val.mli:1: x: Not detected ./examples/using_make/advanced/val.mli:2: y: Not detected ./examples/using_make/baz.mli:2: t -./examples/using_make/cond_sel.ml:9: f -./examples/using_make/cond_sel.ml:11: g - -./examples/using_make/dir/alias_opt.ml:4: baz -./examples/using_make/dir/alias_opt.ml:11: foo -./examples/using_make/dir/alias_opt.ml:12: bar -./examples/using_make/dir/fn_arg.ml:1: f -./examples/using_make/dir/fn_arg.ml:3: g -./examples/using_make/dir/fn_arg.ml:9: i -./examples/using_make/dir/fn_arg.ml:11: j -./examples/using_make/dir/hidden_opt_use.ml:1: f -./examples/using_make/dir/hidden_opt_use.ml:3: apply -./examples/using_make/dir/match_opt.ml:3: m +./examples/using_make/cond_sel.ml:9: f: Not detected +./examples/using_make/cond_sel.ml:11: g: Not detected +./examples/using_make/dir/alias_opt.ml:4: baz: Not detected +./examples/using_make/dir/alias_opt.ml:11: foo: Not detected +./examples/using_make/dir/alias_opt.ml:12: bar: Not detected +./examples/using_make/dir/fn_arg.ml:1: f: Not detected +./examples/using_make/dir/fn_arg.ml:3: g: Not detected +./examples/using_make/dir/fn_arg.ml:9: i: Not detected +./examples/using_make/dir/fn_arg.ml:11: j: Not detected +./examples/using_make/dir/hidden_opt_use.ml:1: f: Not detected +./examples/using_make/dir/hidden_opt_use.ml:3: apply: Not detected +./examples/using_make/dir/match_opt.ml:3: m: Not detected ./examples/using_make/dir/mod.mli:10: M.f: Not detected -./examples/using_make/dir/partial.ml:5: g -./examples/using_make/dir/ref_fn.ml:5: g -./examples/using_make/dir/ref_opt.ml:7: g - +./examples/using_make/dir/partial.ml:5: g: Not detected +./examples/using_make/dir/ref_fn.ml:5: g: Not detected +./examples/using_make/dir/ref_opt.ml:7: g: Not detected ./examples/using_make/foo.mli:1: x ./examples/using_make/fooFn.mli:1: f ./examples/using_make/functor.mli:2: M.f: Not detected -./examples/using_make/if_end.ml:1: f -./examples/using_make/if_end.ml:3: g -./examples/using_make/if_end.ml:5: h +./examples/using_make/if_end.ml:1: f: Not detected +./examples/using_make/if_end.ml:3: g: Not detected +./examples/using_make/if_end.ml:5: h: Not detected ./examples/using_make/letIn.mli:1: f ./examples/using_make/mod_alias.mli:2: M1.id: Not detected ./examples/using_make/mod_alias.mli:6: M2.id: Not detected ./examples/using_make/obj/class.mli:9: f: Not detected -./examples/using_make/obj/fun_class.ml:8: f -./examples/using_make/obj/fun_obj_param.ml:7: app_m +./examples/using_make/obj/fun_class.ml:8: f: Not detected +./examples/using_make/obj/fun_obj_param.ml:7: app_m: Not detected ./examples/using_make/obj/inher.mli:13: f: Not detected -./examples/using_make/obj/obj_inher.ml:7: o -./examples/using_make/obj/obj_inher.ml:12: o4 -./examples/using_make/obj/obj_inher.ml:17: o2 -./examples/using_make/obj/obj_inher.ml:19: o3 -./examples/using_make/obj/obj_inher.ml:24: f -./examples/using_make/obj/object.ml:7: f - -./examples/using_make/opt_in_opt.ml:5: baz -./examples/using_make/partial_opt.ml:1: f -./examples/using_make/useless_opt.ml:1: foo +./examples/using_make/obj/obj_inher.ml:7: o: Not detected +./examples/using_make/obj/obj_inher.ml:12: o4: Not detected +./examples/using_make/obj/obj_inher.ml:17: o2: Not detected +./examples/using_make/obj/obj_inher.ml:19: o3: Not detected +./examples/using_make/obj/obj_inher.ml:24: f: Not detected +./examples/using_make/obj/object.ml:7: f: Not detected +./examples/using_make/opt_in_opt.ml:5: baz: Not detected +./examples/using_make/partial_opt.ml:1: f: Not detected +./examples/using_make/useless_opt.ml:1: foo: Not detected ./examples/using_make/variant.mli:5: f: Not detected -------- @@ -321,9 +308,8 @@ ./examples/using_dune/preprocessed_lib/preprocessed.mli:2: used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:31: f: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:3: used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: f - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:3: used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: f: Not detected ./examples/using_dune/unwrapped_lib/obj/with_class.mli:21: basics_factory: Should not be detected ./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory: Not detected ./examples/using_dune/unwrapped_lib/opt_args/mixed_args.mli:1: interlaced_mandatory_and_opt: Should not be detected @@ -358,12 +344,11 @@ ./examples/using_dune/unwrapped_lib/values/values.mli:19: used_alias_fun: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:24: used_closure: Not detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:2: Exported.used_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:1: used_int -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:14: used_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:21: used_alias_fun -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:26: used_closure - +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:2: Exported.used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:1: used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:14: used_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:21: used_alias_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:26: used_closure: Not detected ./examples/using_dune/wrapped_lib/obj/with_class.mli:21: basics_factory: Should not be detected ./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory: Not detected ./examples/using_dune/wrapped_lib/opt_args/mixed_args.mli:1: interlaced_mandatory_and_opt: Should not be detected @@ -398,53 +383,45 @@ ./examples/using_dune/wrapped_lib/values/values.mli:19: used_alias_fun: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:24: used_closure: Not detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Not detected -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:2: Exported.used_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:1: used_int -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:14: used_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:21: used_alias_fun -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:26: used_closure - +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:2: Exported.used_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:1: used_int: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:14: used_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:21: used_alias_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:26: used_closure: Not detected ./examples/using_make/dir/anonFn.mli:1: f ./examples/using_make/dir/anonFn.mli:2: g ./examples/using_make/dir/anonFn.mli:3: h -./examples/using_make/dir/fn_arg.ml:7: h -./examples/using_make/dir/partial.ml:1: f -./examples/using_make/dir/ref_opt.ml:1: f -./examples/using_make/dir/ref_opt.ml:5: r - +./examples/using_make/dir/fn_arg.ml:7: h: Not detected +./examples/using_make/dir/partial.ml:1: f: Not detected +./examples/using_make/dir/ref_opt.ml:1: f: Not detected +./examples/using_make/dir/ref_opt.ml:5: r: Not detected ./examples/using_make/exported.mli:6: M1.five: Not detected ./examples/using_make/exported.mli:15: M2.five: Not detected ./examples/using_make/functor.mli:7: F.g: Not detected ./examples/using_make/functor.mli:11: N.g: Not detected ./examples/using_make/obj/class.mli:7: o: Not detected -./examples/using_make/obj/fun_obj_param.ml:1: f +./examples/using_make/obj/fun_obj_param.ml:1: f: Not detected ./examples/using_make/obj/inher.mli:11: o: Not detected -./examples/using_make/obj/object.ml:1: o - -./examples/using_make/opt/sig_struct.ml:6: f: Should not be detected -./examples/using_make/opt_in_opt.ml:1: foo -./examples/using_make/unused_fn.ml:1: f +./examples/using_make/obj/object.ml:1: o: Not detected +./examples/using_make/opt_in_opt.ml:1: foo: Not detected +./examples/using_make/unused_fn.ml:1: f: Not detected -------- .>-> ALMOST UNUSED EXPORTED VALUES: Called 3 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:24: multiple_sometimes_used_opt_args: Should not be detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:19: aliased_fun - +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:19: aliased_fun: Not detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:24: multiple_sometimes_used_opt_args: Should not be detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:19: aliased_fun - +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:19: aliased_fun: Not detected ./examples/using_make/dir/anonFn2.mli:1: f ./examples/using_make/dir/anonFn2.mli:2: g -./examples/using_make/dir/match_opt.ml:1: f +./examples/using_make/dir/match_opt.ml:1: f: Not detected ./examples/using_make/dir/refFn.mli:1: r: Should not be detected -./examples/using_make/dir/ref_fn.ml:1: f - +./examples/using_make/dir/ref_fn.ml:1: f: Not detected ./examples/using_make/exported.mli:10: F.plus_five: Not detected ./examples/using_make/exported.mli:16: M2.plus_five: Not detected -./examples/using_make/let_in.ml:1: complicated - +./examples/using_make/let_in.ml:1: complicated: Not detected ./examples/using_make/opt/sig_struct.ml:6: f: Not detected Nothing else to report in this section -------------------------------------------------------------------------------- @@ -453,8 +430,7 @@ Nothing else to report in this section .> UNUSED METHODS: ================= ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused: Not detected ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -485,22 +461,23 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected +./examples/using_make/advanced/mod.mli:4: p#f: Should not be detected ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f ./examples/using_make/obj/coerce.mli:6: p#h -./examples/using_make/obj/constraint.ml:1: p#g +./examples/using_make/obj/constraint.ml:1: p#g: Not detected ./examples/using_make/obj/fooCl.mli:1: p1#g ./examples/using_make/obj/fooCl.mli:1: p1#h ./examples/using_make/obj/fooCl.mli:7: p2#h -./examples/using_make/obj/fun_class.ml:1: c#m3 -./examples/using_make/obj/fun_obj_param.ml:1: f#n +./examples/using_make/obj/fun_class.ml:1: c#m3: Not detected +./examples/using_make/obj/fun_obj_param.ml:1: f#n: Not detected ./examples/using_make/obj/inher.mli:1: p#h ./examples/using_make/obj/named.mli:10: c#g -./examples/using_make/obj/obj_inher.ml:1: c#g -./examples/using_make/obj/obj_inher.ml:1: c#h -./examples/using_make/obj/obj_inher.ml:19: o3#k -./examples/using_make/obj/object.ml:1: o#h +./examples/using_make/obj/obj_inher.ml:1: c#g: Not detected +./examples/using_make/obj/obj_inher.ml:1: c#h: Not detected +./examples/using_make/obj/obj_inher.ml:19: o3#k: Not detected +./examples/using_make/obj/object.ml:1: o#h: Not detected ./examples/using_make/obj/overr.mli:1: p1#g ./examples/using_make/obj/overr.mli:1: p1#h ./examples/using_make/obj/overr.mli:7: p2#g @@ -512,9 +489,8 @@ Nothing else to report in this section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#externally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#internally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#externally_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#internally_used - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#externally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#internally_used: Not detected ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#used ./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun: Not detected @@ -544,29 +520,28 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int: Not detected ./examples/using_make/advanced/func.mli:3: M.c#f -./examples/using_make/advanced/mod.mli:4: p#f - +./examples/using_make/advanced/mod.mli:4: p#f: Not detected ./examples/using_make/obj/class.mli:1: c#f ./examples/using_make/obj/class.mli:1: c#g ./examples/using_make/obj/class_type.mli:7: p#f ./examples/using_make/obj/class_type.mli:7: p#h ./examples/using_make/obj/coerce.mli:8: c#h -./examples/using_make/obj/constraint.ml:1: p#f -./examples/using_make/obj/depend.ml:8: M.c#f +./examples/using_make/obj/constraint.ml:1: p#f: Not detected +./examples/using_make/obj/depend.ml:8: M.c#f: Not detected ./examples/using_make/obj/fooCl.mli:1: p1#f ./examples/using_make/obj/fooCl.mli:7: p2#g -./examples/using_make/obj/fun_class.ml:1: c#m1 -./examples/using_make/obj/fun_class.ml:1: c#m2 -./examples/using_make/obj/fun_class.ml:1: c#m4 -./examples/using_make/obj/fun_obj_param.ml:1: f#m -./examples/using_make/obj/fun_obj_param.ml:1: f#x +./examples/using_make/obj/fun_class.ml:1: c#m1: Not detected +./examples/using_make/obj/fun_class.ml:1: c#m2: Not detected +./examples/using_make/obj/fun_class.ml:1: c#m4: Not detected +./examples/using_make/obj/fun_obj_param.ml:1: f#m: Not detected +./examples/using_make/obj/fun_obj_param.ml:1: f#x: Not detected ./examples/using_make/obj/inher.mli:1: p#f ./examples/using_make/obj/inher.mli:1: p#g ./examples/using_make/obj/named.mli:1: p1#g ./examples/using_make/obj/named.mli:6: p2#f ./examples/using_make/obj/named.mli:10: c#f -./examples/using_make/obj/object.ml:1: o#f -./examples/using_make/obj/object.ml:1: o#g +./examples/using_make/obj/object.ml:1: o#f: Not detected +./examples/using_make/obj/object.ml:1: o#g: Not detected ./examples/using_make/obj/overr.mli:1: p1#f ./examples/using_make/obj/overr.mli:12: c#g -------- @@ -575,8 +550,7 @@ Nothing else to report in this section .>-> ALMOST UNUSED METHODS: Called 2 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#used - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#used: Not detected ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#externally_used_fun ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#externally_used_int ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#internally_used_fun @@ -602,7 +576,7 @@ Nothing else to report in this section ./examples/using_make/obj/class_type.mli:7: p#g ./examples/using_make/obj/coerce.mli:8: c#f ./examples/using_make/obj/named.mli:1: p1#f -./examples/using_make/obj/obj_inher.ml:1: c#f +./examples/using_make/obj/obj_inher.ml:1: c#f: Not detected -------- @@ -613,13 +587,12 @@ Nothing else to report in this section .> UNUSED CONSTRUCTORS/RECORD FIELDS: ==================================== -./examples/using_dune/preprocessed_lib/preprocessed.mli:14: constructors.Unused -./examples/using_dune/preprocessed_lib/preprocessed.mli:19: constr_with_eq.Unused -./examples/using_dune/preprocessed_lib/preprocessed.mli:23: record.unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused - +./examples/using_dune/preprocessed_lib/preprocessed.mli:14: constructors.Unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:19: constr_with_eq.Unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:23: record.unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused: Not detected ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:1: unused_single_no_param.Unused_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:2: unused_single_unit.Unused_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:3: unused_single_param.Unused_single_param @@ -685,17 +658,19 @@ Nothing else to report in this section .>-> ALMOST UNUSED CONSTRUCTORS/RECORD FIELDS: Called 1 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./examples/using_dune/preprocessed_lib/preprocessed.mli:16: constructors.Internally_used -./examples/using_dune/preprocessed_lib/preprocessed.mli:17: constructors.Externally_used -./examples/using_dune/preprocessed_lib/preprocessed.mli:25: record.internally_used -./examples/using_dune/preprocessed_lib/preprocessed.mli:26: record.externally_used +./examples/using_dune/preprocessed_lib/preprocessed.mli:14: constructors.Unused: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:16: constructors.Internally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:17: constructors.Externally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:19: constr_with_eq.Unused: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:23: record.unused: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:25: record.internally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:26: record.externally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:29: record_with_eq.implicitly_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:27: constructors.Internally_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:28: constructors.Externally_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:41: record.internally_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:42: record.externally_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:45: record_with_eq.implicitly_used - +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:27: constructors.Internally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:28: constructors.Externally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:41: record.internally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:42: record.externally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:45: record_with_eq.implicitly_used: Not detected ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:25: internally_used_single_no_param.Internally_used_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:26: internally_used_single_unit.Internally_used_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:27: internally_used_single_param.Internally_used_single_param @@ -759,11 +734,14 @@ Nothing else to report in this section .>-> ALMOST UNUSED CONSTRUCTORS/RECORD FIELDS: Called 2 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./examples/using_dune/preprocessed_lib/preprocessed.mli:15: constructors.Used -./examples/using_dune/preprocessed_lib/preprocessed.mli:24: record.used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:26: constructors.Used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:40: record.used - +./examples/using_dune/preprocessed_lib/preprocessed.mli:15: constructors.Used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:16: constructors.Internally_used: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:17: constructors.Externally_used: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:24: record.used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:25: record.internally_used: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:26: record.externally_used: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:26: constructors.Used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:40: record.used: Not detected ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:17: used_single_no_param.Used_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:18: used_single_unit.Used_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:19: used_single_param.Used_single_param @@ -797,11 +775,14 @@ Nothing else to report in this section -------- - Nothing else to report in this section -------------------------------------------------------------------------------- - - +.>-> ALMOST UNUSED CONSTRUCTORS/RECORD FIELDS: Called 3 time(s): +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +./examples/using_dune/preprocessed_lib/preprocessed.mli:15: constructors.Used: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:24: record.used: Should not be detected +Nothing else to report in this section +-------------------------------------------------------------------------------- .> OPTIONAL ARGUMENTS: ALWAYS: ============================= ./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?always @@ -1023,8 +1004,8 @@ Nothing else to report in this section ./examples/using_make/dir/matchopt.ml:1: ?x (3/4 calls) ./examples/using_make/dir/ref_fn.ml:1: ?a (2/3 calls) ./examples/using_make/dir/ref_fn.ml:1: ?b (2/3 calls) - ./examples/using_make/matchopt.ml:1: ?x (3/4 calls) + ./examples/using_make/opt/sig_struct.ml:2: ?x (2/3 calls): Not detected ./examples/using_make/opt_in_opt.ml:1: ?b (1/2 calls) -------- @@ -1212,6 +1193,7 @@ Nothing else to report in this section ./examples/using_make/dir/anonFn2.mli:1: ?b (2/3 calls) ./examples/using_make/dir/matchopt.ml:1: ?y (3/4 calls) ./examples/using_make/dir/matchopt.ml:1: ?z (3/4 calls) + ./examples/using_make/let_in.ml:1: ?b (2/3 calls) ./examples/using_make/matchopt.ml:1: ?y (3/4 calls) ./examples/using_make/matchopt.ml:1: ?z (3/4 calls) @@ -1273,7 +1255,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 1114 -Success: 844 -Failed: 270 -Ratio: 75.763016158% +Total: 1123 +Success: 680 +Failed: 443 +Ratio: 60.5520926091% diff --git a/docs/USAGE.md b/docs/USAGE.md index 2969ca1..c884e43 100644 --- a/docs/USAGE.md +++ b/docs/USAGE.md @@ -24,9 +24,9 @@ Calling `dead_code_analyzer --help` provides the following output, describing the main command line aspect, different options available and their effects. -The `` argument is any number of directory, `.cmt` and `.cmi` files. +The `` argument is any number of directory, `.cmt` and `.cmti` files. These files can be produced using the compiler flags `-keep-locs` (on by default) -for `.cmi` and `-bin-annot` for `.cmt`. +for `.cmti` and `-bin-annot` for `.cmt`. The directories are traversed looking for such files. > [!TIP] > If you are using `dune` for your project, the files can be obtained via the @@ -190,15 +190,15 @@ the development. ``` src ├── debug -│   ├── debug.cmi +│   ├── debug.cmti │   ├── debug.cmt │   └── debug.ml -├── foo.cmi +├── foo.cmti ├── foo.cmt ├── foo.ml ├── foo.mli └── lib - ├── lib.cmi + ├── lib.cmti ├── lib.cmt ├── lib.ml └── lib.mli @@ -306,9 +306,9 @@ the file and moves on. - If a file is ignored and it is not obvious why, then opening an issue is welcome. -- If no file is ignored, check that no file is missing. There should be a `.cmi` +- If no file is ignored, check that no file is missing. There should be a `.cmti` and a `.cmt` file for each expected ``. -- If no `.cmi` or `.cmt` file is missing then the false negatives must be due +- If no `.cmti` or `.cmt` file is missing then the false negatives must be due to limitations of the tool and opening an issue is welcome. ## Thresholds diff --git a/src/deadCode.ml b/src/deadCode.ml index b9d0098..817fa3c 100644 --- a/src/deadCode.ml +++ b/src/deadCode.ml @@ -335,7 +335,7 @@ let kind fn = `Ignore end else if DeadFlag.is_excluded fn then `Ignore else if Sys.is_directory fn then `Dir - else if Filename.check_suffix fn ".cmi" then `Cmi + else if Filename.check_suffix fn ".cmti" then `Cmti else if Filename.check_suffix fn ".cmt" then `Cmt else `Ignore @@ -347,31 +347,27 @@ let regabs state = hashtbl_add_unique_to_list main_files (Utils.unit fn) () -let read_interface fn cmi_infos state = let open Cmi_format in - try - regabs state; - if !DeadFlag.exported.DeadFlag.print - || !DeadFlag.obj.DeadFlag.print - || !DeadFlag.typ.DeadFlag.print - then - let u = - if State.File_infos.has_sourcepath state.file_infos then - State.File_infos.get_sourceunit state.file_infos - else - Utils.unit fn - in - let module_id = - State.File_infos.get_modname state.file_infos - |> Ident.create_persistent - in - let f = - collect_export [module_id] u decs - in - List.iter f cmi_infos.cmi_sign; - last_loc := Lexing.dummy_pos - with Cmi_format.Error (Wrong_version_interface _) -> - (*Printf.eprintf "cannot read cmi file: %s\n%!" fn;*) - bad_files := fn :: !bad_files +let read_interface fn signature state = + regabs state; + if !DeadFlag.exported.DeadFlag.print + || !DeadFlag.obj.DeadFlag.print + || !DeadFlag.typ.DeadFlag.print + then + let u = + if State.File_infos.has_sourcepath state.file_infos then + State.File_infos.get_sourceunit state.file_infos + else + Utils.unit fn + in + let module_id = + State.File_infos.get_modname state.file_infos + |> Ident.create_persistent + in + let f = + collect_export [module_id] u decs + in + List.iter f signature.sig_type; + last_loc := Lexing.dummy_pos (* Merge a location's references to another one's *) @@ -446,13 +442,16 @@ let rec load_file state fn = state in match kind fn with - | `Cmi when !DeadCommon.declarations -> + | `Cmti when !DeadCommon.declarations -> + let open Cmt_format in last_loc := Lexing.dummy_pos; if !DeadFlag.verbose then Printf.eprintf "Scanning %s\n%!" fn; init_and_continue state fn (fun state -> - match state.file_infos.cmi_infos with - | None -> () (* TODO error handling ? *) - | Some cmi_infos -> read_interface fn cmi_infos state + match state.file_infos.cmti_infos with + | None -> bad_files := fn :: !bad_files + | Some {cmt_annots = Interface signature; _} -> + read_interface fn signature state + | _ -> () ) | `Cmt -> @@ -502,7 +501,7 @@ let rec load_file state fn = | `Dir -> let next = Sys.readdir fn in - Array.sort compare next; + Array.sort (fun f1 f2 -> compare f2 f1) next; Array.fold_left (fun state s -> load_file state (fn ^ "/" ^ s)) state diff --git a/src/state/file_infos.ml b/src/state/file_infos.ml index 19c4948..9099df5 100644 --- a/src/state/file_infos.ml +++ b/src/state/file_infos.ml @@ -1,199 +1,116 @@ type t = { - cmti_file : string; + cm_file : string; sourcepath : string option; - builddir : string option; + builddir : string; modname : string; - cmi_infos : Cmi_format.cmi_infos option; + cmti_infos : Cmt_format.cmt_infos option; cmt_infos : Cmt_format.cmt_infos option; } let empty = { - cmti_file = ""; + cm_file = ""; sourcepath = None; - builddir = None; + builddir = "!!UNKNOWN_BUILDDIR!!"; modname = "!!UNKNOWN_MODNAME!!"; - cmi_infos = None; + cmti_infos = None; cmt_infos = None; } -(** [init_from_cmt_infos cmt_infos cmt_file] creates a [t] with: +(** [init_from_cmt_infos ~orig ~cm_file cmt_infos] creates a [t] with: - information from [cmt_infos]; - - [cmti_file = cmt_file]; - - [cmt_infos = Some cmt_infos]. *) -let init_from_cmt_infos cmt_infos cmt_file = + - [cm_file]; + - [cmt_infos = Some cmt_infos] if [orig = `Cmt] + - [cmti_infos = Some cmt_infos] if [orig = `Cmti] *) + let init_from_cmt_infos ~orig ~cm_file cmt_infos = let builddir = cmt_infos.Cmt_format.cmt_builddir in let sourcepath = Option.map (Filename.concat builddir) cmt_infos.cmt_sourcefile in let modname = cmt_infos.cmt_modname in - {empty with cmti_file = cmt_file; - builddir = Some builddir; - sourcepath; - modname; - cmt_infos = Some cmt_infos; - } + let cmt_infos, cmti_infos = + match orig with + | `Cmt -> Some cmt_infos, None + | `Cmti -> None, Some cmt_infos + in + {cm_file; sourcepath; builddir; modname; cmt_infos; cmti_infos} -(** [init_from_cmt cmt_file] returns an [Ok t] with [t] filled using - the [cmt_file] (see [init_from_cmt_infos]). +(** [init_from_cm_file ~orig cm_file] returns an [Ok t] with [t] filled using + the [cm_file] (see [init_from_cmt_infos]). In case the file does not exist or it cannot be read (see [Cmt_format.read_cmt]) then it returns an [Err msg] with msg a string describing the issue. *) -let init_from_cmt cmt_file = - if not (Sys.file_exists cmt_file) then Result.error (cmt_file ^ ": file not found") +let init_from_cm_file ~orig cm_file = + if not (Sys.file_exists cm_file) then Result.error (cm_file ^ ": file not found") else try - let cmt_infos = Cmt_format.read_cmt cmt_file in - init_from_cmt_infos cmt_infos cmt_file + let cmt_infos = Cmt_format.read_cmt cm_file in + init_from_cmt_infos ~orig ~cm_file cmt_infos |> Result.ok - with _ -> Result.error (cmt_file ^ ": cannot read cmt file") - - -let sourcefname_of_cmi_infos cmi_unit cmi_infos = - let candidate_of_fname fname = - let src_unit = Utils.unit fname in - if String.equal src_unit cmi_unit then `Identical fname - else if String.ends_with ~suffix:src_unit cmi_unit then - `Suffix fname - else if String.starts_with ~prefix:src_unit cmi_unit then - `Prefix fname - else `Different fname - in - let fname_of_candidate = function - | `Default -> None - | `Identical fname - | `Suffix fname - | `Prefix fname - | `Different fname -> Some fname - in - let get_item_loc (sig_item : Types.signature_item) = - match sig_item with - | Sig_value (_, {val_loc = loc; _}, _) - | Sig_type (_, {type_loc = loc; _}, _, _) - | Sig_typext (_, {ext_loc = loc; _}, _, _) - | Sig_module (_, _, {md_loc = loc; _}, _, _) - | Sig_modtype (_, {mtd_loc = loc; _}, _) - | Sig_class (_, {cty_loc = loc; _}, _, _) - | Sig_class_type (_, {clty_loc = loc; _}, _, _) -> - loc + with _ -> + let ext = + match orig with + | `Cmt -> ".cmt" + | `Cmti -> ".cmti" + in + Result.error (Printf.sprintf "%s: cannot read %s file" cm_file ext) + +let init cm_file = + let ( let* ) x f = Result.bind x f in + let* orig = + match Filename.extension cm_file with + | ".cmt" -> Result.ok `Cmt + | ".cmti" -> Result.ok `Cmti + | _ -> Result.error (cm_file ^ ": not a .cmti or .cmt file") in - let rec find_sourcename candidate = function - | [] -> fname_of_candidate candidate - | sig_item::items -> - let loc = get_item_loc sig_item in - if loc.Location.loc_ghost then find_sourcename candidate items - else - let fname = loc.Location.loc_start.pos_fname in - match candidate, candidate_of_fname fname with - | _, `Default -> assert false - | (`Identical _ as candidate), _ - | _, (`Identical _ as candidate) -> - (* best candidate found *) - fname_of_candidate candidate - | `Default, candidate - | `Different _, candidate - | candidate, `Different _ - | `Prefix _, (`Suffix _ as candidate) - | (`Suffix _ as candidate), `Prefix _ - | _, candidate -> - find_sourcename candidate items - in - find_sourcename `Default cmi_infos.Cmi_format.cmi_sign - -(** [init_from_cmi_infos ?with_cmt cmi_infos cmi_file] creates a [t] with: - - information from [cmt_infos]; - - [cmti_file = cmt_file]; - - [cmi_infos = Some cmi_infos]. - Because the [cmi_infos] is not as complete as [cmt_infos] (e.g. it does not - specify the [builddir]), an existing [t] filled using the correpsonding - [cmt_infos] can be passed as argument. In this case, information unavailable - in the [cmi_infos] is read from [with_cmt]. Otherwise, default values are - set for [builddir] and eventually [sourcepath]. *) -let init_from_cmi_infos ?with_cmt cmi_infos cmi_file = - let builddir = Option.bind with_cmt (fun {builddir; _} -> builddir) in - let sourcepath = - let unknown_sourcepath = - Option.bind with_cmt (fun {sourcepath; _} -> sourcepath) - in - let cmi_unit = Utils.unit cmi_file in - let sourcefname = sourcefname_of_cmi_infos cmi_unit cmi_infos in - match sourcefname, builddir with - | None, _ -> unknown_sourcepath - | Some _, None -> sourcefname - | Some fname, Some builddir -> Some (Filename.concat builddir fname) - + let* file_infos = init_from_cm_file ~orig cm_file in + let cmt_infos, cmti_infos = + let no_ext = Filename.remove_extension cm_file in + match orig with + | `Cmt -> + let cmti_infos = + init_from_cm_file ~orig:`Cmti (no_ext ^ ".cmti") + |> Result.map (fun {cmti_infos; _} -> cmti_infos) + |> Result.value ~default:file_infos.cmti_infos + in + file_infos.cmt_infos, cmti_infos + | `Cmti -> + let cmt_infos = + init_from_cm_file ~orig:`Cmt (no_ext ^ ".cmt") + |> Result.map (fun {cmt_infos; _} -> cmt_infos) + |> Result.value ~default:file_infos.cmt_infos + in + cmt_infos, file_infos.cmti_infos in - let modname = cmi_infos.cmi_name in - {empty with cmti_file = cmi_file; - builddir; - sourcepath; - modname; - cmi_infos = Some cmi_infos; - } - -(** [init_from_cmi cmi_file] returns an [Ok t] with [t] filled using - the [cmi_file] (see [init_from_cmi_infos]). - In case the file does not exist or it cannot be read (see - [Cmi_format.read_cmi]) then it returns an [Err msg] with msg a string - describing the issue. *) -let init_from_cmi ?with_cmt cmi_file = - if not (Sys.file_exists cmi_file) then Result.error (cmi_file ^ ": file not found") - else - try - let cmi_infos = Cmi_format.read_cmi cmi_file in - init_from_cmi_infos ?with_cmt cmi_infos cmi_file - |> Result.ok - with _ -> Result.error (cmi_file ^ ": cannot read cmi file") - -let init cmti_file = - let no_ext = Filename.remove_extension cmti_file in - match Filename.extension cmti_file with - | ".cmi" -> - let with_cmt = init_from_cmt (no_ext ^ ".cmt") |> Result.to_option in - init_from_cmi ?with_cmt cmti_file - | ".cmt" -> - let with_cmi_infos with_cmt = - match init_from_cmi ~with_cmt (no_ext ^ ".cmi") with - | Error _ -> with_cmt - | Ok {cmi_infos; _} -> {with_cmt with cmi_infos} - in - init_from_cmt cmti_file |> Result.map with_cmi_infos - | _ -> Result.error (cmti_file ^ ": not a .cmi or .cmt file") - -let change_file file_infos cmti_file = - let no_ext = Filename.remove_extension cmti_file in - assert(no_ext = Filename.remove_extension file_infos.cmti_file); - match Filename.extension cmti_file, file_infos with - | ".cmi", {cmi_infos=Some cmi_infos; _} -> - let res = init_from_cmi_infos ~with_cmt:file_infos cmi_infos cmti_file in - Result.ok res - | ".cmt", {cmt_infos = Some cmt_infos; cmi_infos; _} -> - let res = init_from_cmt_infos cmt_infos cmti_file in - Result.ok {res with cmi_infos} - | _ -> (* corresponding info is None *) - init cmti_file - -let has_builddir file_infos = Option.is_some file_infos.builddir + Result.ok {file_infos with cmt_infos; cmti_infos} + +let change_file file_infos cm_file = + let no_ext = Filename.remove_extension cm_file in + assert(no_ext = Filename.remove_extension file_infos.cm_file); + match Filename.extension cm_file, file_infos with + | ".cmt", {cmt_infos=Some cmt_infos; cmti_infos; _} -> + let res = init_from_cmt_infos ~orig:`Cmt ~cm_file cmt_infos in + Result.ok {res with cmti_infos} + | ".cmti", {cmti_infos=Some cmti_infos; cmt_infos; _} -> + let res = init_from_cmt_infos ~orig:`Cmti ~cm_file cmti_infos in + Result.ok {res with cmt_infos} + | _ -> (* corresponding info is None or invlaid extension *) + init cm_file let has_sourcepath file_infos = Option.is_some file_infos.sourcepath -let get_builddir t = - match t.builddir with - | Some builddir -> builddir - | None -> "!!UNKNOWN_BUILDDIR_FOR<" ^ t.cmti_file ^ ">!!" +let get_builddir t = t.builddir let get_sourcepath t = match t.sourcepath with | Some sourcepath -> sourcepath - | None -> match t.builddir with - | Some builddir -> + | None -> Printf.sprintf "!!UNKNOWN_SOURCEPATH_IN<%s>_FOR_<%s>!!" - builddir - t.cmti_file - | None -> "!!UNKNOWN_SOURCEPATH_FOR<" ^ t.cmti_file ^ ">!!" + t.builddir + t.cm_file let get_sourceunit t = match t.sourcepath with | Some sourcepath -> Utils.unit sourcepath - | None -> "!!UNKNOWN_SOURCEUNIT_FOR<" ^ t.cmti_file ^ ">!!" + | None -> "!!UNKNOWN_SOURCEUNIT_FOR<" ^ t.cm_file ^ ">!!" let get_modname t = t.modname diff --git a/src/state/file_infos.mli b/src/state/file_infos.mli index 8e29bb8..bf782ce 100644 --- a/src/state/file_infos.mli +++ b/src/state/file_infos.mli @@ -1,32 +1,31 @@ -(** Information about a analyzable file ([.cmi] or [.cmt] file) *) +(** Information about a analyzable file ([.cmti] or [.cmt] file) *) type t = { - cmti_file : string; (** The filepath currently analyzed *) + cm_file : string; (** The filepath currently analyzed *) sourcepath : string option; (** The path to the associated source file *) - builddir : string option; (** The [cmt_builddir] *) - modname : string; (** Either [cmi_name] or [cmt_modname] *) - cmi_infos : Cmi_format.cmi_infos option; + builddir : string; (** The [cmt_builddir] *) + modname : string; (** Either [cmti_name] or [cmt_modname] *) + cmti_infos : Cmt_format.cmt_infos option; cmt_infos : Cmt_format.cmt_infos option; } val empty : t (** No file info *) val init : string -> (t, string) result -(** [init cmti_file] expects either a [.cmi] or [.cmt] filepath as argument and - returns an [Ok t] with [t] filled using the [cmit_file]. +(** [init cm_file] expects either a [.cmti] or [.cmt] filepath as argument and + returns an [Ok t] with [t] filled using the [cmtit_file]. In case the file does not exist, it cannot be read, or its extension is invalid, then it returns an [Err msg] with msg a string describing the issue. *) val change_file : t -> string -> (t, string) result -(** [change_file t cmti_file] expects either a [.cmi] or a [.cmt] filepath as - argument. [cmti_file] must be the same as [t.cmti_file], ignoring the +(** [change_file t cm_file] expects either a [.cmti] or a [.cmt] filepath as + argument. [cm_file] must be the same as [t.cm_file], ignoring the extension. The returned value is either a simple update of [t] if the necessary - [cmi_infos] or [cmt_infos] is available. Otherwise, it is the result of + [cmti_infos] or [cmt_infos] is available. Otherwise, it is the result of [init t] *) -val has_builddir : t -> bool val has_sourcepath : t -> bool val get_builddir : t -> string diff --git a/src/state/state.ml b/src/state/state.ml index 65550e1..c6cbe4f 100644 --- a/src/state/state.ml +++ b/src/state/state.ml @@ -6,24 +6,24 @@ type t = { let empty = {file_infos = File_infos.empty} -let init cmti_file = - let file_infos = File_infos.init cmti_file in +let init cm_file = + let file_infos = File_infos.init cm_file in Result.map (fun file_infos -> {file_infos}) file_infos -let change_file state cmti_file = +let change_file state cm_file = let file_infos = state.file_infos in let equal_no_ext filename1 filename2 = let no_ext1 = Filename.remove_extension filename1 in let no_ext2 = Filename.remove_extension filename2 in no_ext1 = no_ext2 in - if file_infos.cmti_file = cmti_file then + if file_infos.cm_file = cm_file then Result.ok state - else if equal_no_ext file_infos.cmti_file cmti_file then - let file_infos = File_infos.change_file file_infos cmti_file in + else if equal_no_ext file_infos.cm_file cm_file then + let file_infos = File_infos.change_file file_infos cm_file in Result.map (fun file_infos -> {file_infos}) file_infos else - init cmti_file + init cm_file (** Analysis' state *) let current = ref empty From 3ec59f043587e54b8eaf4081203c865e0094e05e Mon Sep 17 00:00:00 2001 From: Corentin De Souza <9597216+fantazio@users.noreply.github.com> Date: Fri, 5 Dec 2025 23:29:22 +0100 Subject: [PATCH 4/8] [src][input][2/n] read `cmi_infos` from `.cmti` and `.cmt` If a `.ml` has a `.mli` then its interface is available as `cmi_infos` in the `.cmti`. Otherwise, there is no `.cmti` and it is available in the`.cmt`. All FN and FP introduced by the previous commit are fixed. --- check/classic/classic.ref | 106 +++---- check/internal/internal.ref | 106 +++---- check/threshold-1/threshold-1.ref | 279 +++++++++-------- check/threshold-3-0.5/threshold-3-0.5.ref | 347 ++++++++++++---------- src/deadCode.ml | 120 ++++---- src/state/file_infos.ml | 62 ++-- src/state/file_infos.mli | 3 +- 7 files changed, 543 insertions(+), 480 deletions(-) diff --git a/check/classic/classic.ref b/check/classic/classic.ref index 4f638d0..49fb144 100644 --- a/check/classic/classic.ref +++ b/check/classic/classic.ref @@ -2,7 +2,8 @@ ========================= ./examples/using_dune/preprocessed_lib/preprocessed.mli:1: unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused + ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg @@ -17,11 +18,12 @@ ./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure + ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg @@ -36,35 +38,38 @@ ./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure + ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y ./examples/using_make/advanced/val.mli:1: x: Should not be detected ./examples/using_make/advanced/val.mli:2: y: Should not be detected -./examples/using_make/bar.ml:1: x: Not detected -./examples/using_make/bar_fn.ml:3: h: Not detected +./examples/using_make/bar.ml:1: x +./examples/using_make/bar_fn.ml:3: h ./examples/using_make/baz.mli:1: z ./examples/using_make/baz.mli:3: u -./examples/using_make/cond_sel.ml:13: h: Not detected -./examples/using_make/dir/alias_opt.ml:7: y: Not detected -./examples/using_make/dir/alias_opt.ml:14: x: Not detected -./examples/using_make/dir/anon_call.ml:1: f: Not detected -./examples/using_make/dir/anon_call.ml:5: g: Not detected -./examples/using_make/dir/anon_call.ml:9: h: Not detected -./examples/using_make/dir/anon_call2.ml:1: f: Not detected -./examples/using_make/dir/anon_call2.ml:5: g: Not detected -./examples/using_make/dir/anon_call2.ml:9: h: Not detected -./examples/using_make/dir/match_opt.ml:8: l: Not detected -./examples/using_make/dir/matchopt.ml:5: w: Not detected +./examples/using_make/cond_sel.ml:13: h + +./examples/using_make/dir/alias_opt.ml:7: y +./examples/using_make/dir/alias_opt.ml:14: x +./examples/using_make/dir/anon_call.ml:1: f +./examples/using_make/dir/anon_call.ml:5: g +./examples/using_make/dir/anon_call.ml:9: h +./examples/using_make/dir/anon_call2.ml:1: f +./examples/using_make/dir/anon_call2.ml:5: g +./examples/using_make/dir/anon_call2.ml:9: h +./examples/using_make/dir/match_opt.ml:8: l +./examples/using_make/dir/matchopt.ml:5: w ./examples/using_make/dir/mod.mli:10: M.f ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x -./examples/using_make/dir/ref_opt.ml:3: no: Not detected -./examples/using_make/dir/ref_opt.ml:11: x: Not detected +./examples/using_make/dir/ref_opt.ml:3: no +./examples/using_make/dir/ref_opt.ml:11: x + ./examples/using_make/exported.mli:6: M1.five ./examples/using_make/exported.mli:10: F.plus_five ./examples/using_make/exported.mli:11: F.times_five @@ -77,9 +82,9 @@ ./examples/using_make/functor.mli:3: M.none ./examples/using_make/functor.mli:7: F.g ./examples/using_make/functor.mli:11: N.g -./examples/using_make/let_in.ml:3: parent: Not detected -./examples/using_make/let_test.ml:3: g: Not detected -./examples/using_make/matchopt.ml:5: w: Not detected +./examples/using_make/let_in.ml:3: parent +./examples/using_make/let_test.ml:3: g +./examples/using_make/matchopt.ml:5: w ./examples/using_make/mod_alias.mli:2: M1.id ./examples/using_make/mod_alias.mli:6: M2.id @@ -88,11 +93,11 @@ ./examples/using_make/obj/inher.mli:11: o ./examples/using_make/obj/inher.mli:13: f -./examples/using_make/opt_in_opt.ml:7: x: Not detected -./examples/using_make/qux.ml:1: z: Not detected -./examples/using_make/unused_fn.ml:3: g: Not detected -./examples/using_make/unused_fn.ml:5: var: Not detected -./examples/using_make/useless_opt.ml:3: x: Not detected +./examples/using_make/opt_in_opt.ml:7: x +./examples/using_make/qux.ml:1: z +./examples/using_make/unused_fn.ml:3: g +./examples/using_make/unused_fn.ml:5: var +./examples/using_make/useless_opt.ml:3: x ./examples/using_make/variant.mli:5: f Nothing else to report in this section @@ -102,7 +107,8 @@ Nothing else to report in this section .> UNUSED METHODS: ================= ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused + ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -133,23 +139,22 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected -./examples/using_make/advanced/mod.mli:4: p#f: Should not be detected ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f ./examples/using_make/obj/coerce.mli:6: p#h -./examples/using_make/obj/constraint.ml:1: p#g: Not detected +./examples/using_make/obj/constraint.ml:1: p#g ./examples/using_make/obj/fooCl.mli:1: p1#g ./examples/using_make/obj/fooCl.mli:1: p1#h ./examples/using_make/obj/fooCl.mli:7: p2#h -./examples/using_make/obj/fun_class.ml:1: c#m3: Not detected -./examples/using_make/obj/fun_obj_param.ml:1: f#n: Not detected +./examples/using_make/obj/fun_class.ml:1: c#m3 +./examples/using_make/obj/fun_obj_param.ml:1: f#n ./examples/using_make/obj/inher.mli:1: p#h ./examples/using_make/obj/named.mli:10: c#g -./examples/using_make/obj/obj_inher.ml:1: c#g: Not detected -./examples/using_make/obj/obj_inher.ml:1: c#h: Not detected -./examples/using_make/obj/obj_inher.ml:19: o3#k: Not detected -./examples/using_make/obj/object.ml:1: o#h: Not detected +./examples/using_make/obj/obj_inher.ml:1: c#g +./examples/using_make/obj/obj_inher.ml:1: c#h +./examples/using_make/obj/obj_inher.ml:19: o3#k +./examples/using_make/obj/object.ml:1: o#h ./examples/using_make/obj/overr.mli:1: p1#g ./examples/using_make/obj/overr.mli:1: p1#h ./examples/using_make/obj/overr.mli:7: p2#g @@ -164,9 +169,10 @@ Nothing else to report in this section ./examples/using_dune/preprocessed_lib/preprocessed.mli:14: constructors.Unused: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:19: constr_with_eq.Unused: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:23: record.unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused + ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:1: unused_single_no_param.Unused_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:2: unused_single_unit.Unused_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:3: unused_single_param.Unused_single_param @@ -535,7 +541,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 472 -Success: 395 -Failed: 77 -Ratio: 83.686440678% +Total: 471 +Success: 440 +Failed: 31 +Ratio: 93.4182590234% diff --git a/check/internal/internal.ref b/check/internal/internal.ref index c51f85c..554f0f2 100644 --- a/check/internal/internal.ref +++ b/check/internal/internal.ref @@ -2,7 +2,8 @@ ========================= ./examples/using_dune/preprocessed_lib/preprocessed.mli:1: unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused + ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected @@ -19,11 +20,12 @@ ./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure + ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected @@ -40,35 +42,38 @@ ./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure + ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y ./examples/using_make/advanced/val.mli:1: x: Should not be detected ./examples/using_make/advanced/val.mli:2: y: Should not be detected -./examples/using_make/bar.ml:1: x: Not detected -./examples/using_make/bar_fn.ml:3: h: Not detected +./examples/using_make/bar.ml:1: x +./examples/using_make/bar_fn.ml:3: h ./examples/using_make/baz.mli:1: z ./examples/using_make/baz.mli:3: u -./examples/using_make/cond_sel.ml:13: h: Not detected -./examples/using_make/dir/alias_opt.ml:7: y: Not detected -./examples/using_make/dir/alias_opt.ml:14: x: Not detected -./examples/using_make/dir/anon_call.ml:1: f: Not detected -./examples/using_make/dir/anon_call.ml:5: g: Not detected -./examples/using_make/dir/anon_call.ml:9: h: Not detected -./examples/using_make/dir/anon_call2.ml:1: f: Not detected -./examples/using_make/dir/anon_call2.ml:5: g: Not detected -./examples/using_make/dir/anon_call2.ml:9: h: Not detected -./examples/using_make/dir/match_opt.ml:8: l: Not detected -./examples/using_make/dir/matchopt.ml:5: w: Not detected +./examples/using_make/cond_sel.ml:13: h + +./examples/using_make/dir/alias_opt.ml:7: y +./examples/using_make/dir/alias_opt.ml:14: x +./examples/using_make/dir/anon_call.ml:1: f +./examples/using_make/dir/anon_call.ml:5: g +./examples/using_make/dir/anon_call.ml:9: h +./examples/using_make/dir/anon_call2.ml:1: f +./examples/using_make/dir/anon_call2.ml:5: g +./examples/using_make/dir/anon_call2.ml:9: h +./examples/using_make/dir/match_opt.ml:8: l +./examples/using_make/dir/matchopt.ml:5: w ./examples/using_make/dir/mod.mli:10: M.f: Should not be detected ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x -./examples/using_make/dir/ref_opt.ml:3: no: Not detected -./examples/using_make/dir/ref_opt.ml:11: x: Not detected +./examples/using_make/dir/ref_opt.ml:3: no +./examples/using_make/dir/ref_opt.ml:11: x + ./examples/using_make/exported.mli:11: F.times_five: Not detected ./examples/using_make/exported.mli:17: M2.ten: Not detected ./examples/using_make/exported.mli:6: M1.five: Should not be detected @@ -83,20 +88,20 @@ ./examples/using_make/functor.mli:3: M.none ./examples/using_make/functor.mli:7: F.g: Should not be detected ./examples/using_make/functor.mli:11: N.g: Should not be detected -./examples/using_make/let_in.ml:3: parent: Not detected -./examples/using_make/let_test.ml:3: g: Not detected -./examples/using_make/matchopt.ml:5: w: Not detected +./examples/using_make/let_in.ml:3: parent +./examples/using_make/let_test.ml:3: g +./examples/using_make/matchopt.ml:5: w ./examples/using_make/mod_alias.mli:2: M1.id: Should not be detected ./examples/using_make/mod_alias.mli:6: M2.id: Should not be detected ./examples/using_make/obj/class.mli:7: o: Should not be detected ./examples/using_make/obj/class.mli:9: f: Should not be detected ./examples/using_make/obj/inher.mli:11: o: Should not be detected ./examples/using_make/obj/inher.mli:13: f: Should not be detected -./examples/using_make/opt_in_opt.ml:7: x: Not detected -./examples/using_make/qux.ml:1: z: Not detected -./examples/using_make/unused_fn.ml:3: g: Not detected -./examples/using_make/unused_fn.ml:5: var: Not detected -./examples/using_make/useless_opt.ml:3: x: Not detected +./examples/using_make/opt_in_opt.ml:7: x +./examples/using_make/qux.ml:1: z +./examples/using_make/unused_fn.ml:3: g +./examples/using_make/unused_fn.ml:5: var +./examples/using_make/useless_opt.ml:3: x ./examples/using_make/variant.mli:5: f: Should not be detected Nothing else to report in this section -------------------------------------------------------------------------------- @@ -105,7 +110,8 @@ Nothing else to report in this section .> UNUSED METHODS: ================= ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused + ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -136,23 +142,22 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected -./examples/using_make/advanced/mod.mli:4: p#f: Should not be detected ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f ./examples/using_make/obj/coerce.mli:6: p#h -./examples/using_make/obj/constraint.ml:1: p#g: Not detected +./examples/using_make/obj/constraint.ml:1: p#g ./examples/using_make/obj/fooCl.mli:1: p1#g ./examples/using_make/obj/fooCl.mli:1: p1#h ./examples/using_make/obj/fooCl.mli:7: p2#h -./examples/using_make/obj/fun_class.ml:1: c#m3: Not detected -./examples/using_make/obj/fun_obj_param.ml:1: f#n: Not detected +./examples/using_make/obj/fun_class.ml:1: c#m3 +./examples/using_make/obj/fun_obj_param.ml:1: f#n ./examples/using_make/obj/inher.mli:1: p#h ./examples/using_make/obj/named.mli:10: c#g -./examples/using_make/obj/obj_inher.ml:1: c#g: Not detected -./examples/using_make/obj/obj_inher.ml:1: c#h: Not detected -./examples/using_make/obj/obj_inher.ml:19: o3#k: Not detected -./examples/using_make/obj/object.ml:1: o#h: Not detected +./examples/using_make/obj/obj_inher.ml:1: c#g +./examples/using_make/obj/obj_inher.ml:1: c#h +./examples/using_make/obj/obj_inher.ml:19: o3#k +./examples/using_make/obj/object.ml:1: o#h ./examples/using_make/obj/overr.mli:1: p1#g ./examples/using_make/obj/overr.mli:1: p1#h ./examples/using_make/obj/overr.mli:7: p2#g @@ -167,9 +172,10 @@ Nothing else to report in this section ./examples/using_dune/preprocessed_lib/preprocessed.mli:14: constructors.Unused: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:19: constr_with_eq.Unused: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:23: record.unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused + ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:1: unused_single_no_param.Unused_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:2: unused_single_unit.Unused_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:3: unused_single_param.Unused_single_param @@ -538,7 +544,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 480 -Success: 357 -Failed: 123 -Ratio: 74.375% +Total: 479 +Success: 402 +Failed: 77 +Ratio: 83.9248434238% diff --git a/check/threshold-1/threshold-1.ref b/check/threshold-1/threshold-1.ref index 731524e..4942959 100644 --- a/check/threshold-1/threshold-1.ref +++ b/check/threshold-1/threshold-1.ref @@ -2,7 +2,8 @@ ========================= ./examples/using_dune/preprocessed_lib/preprocessed.mli:1: unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused + ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected @@ -19,11 +20,12 @@ ./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure + ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected @@ -40,35 +42,38 @@ ./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure + ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y ./examples/using_make/advanced/val.mli:1: x: Should not be detected ./examples/using_make/advanced/val.mli:2: y: Should not be detected -./examples/using_make/bar.ml:1: x: Not detected -./examples/using_make/bar_fn.ml:3: h: Not detected +./examples/using_make/bar.ml:1: x +./examples/using_make/bar_fn.ml:3: h ./examples/using_make/baz.mli:1: z ./examples/using_make/baz.mli:3: u -./examples/using_make/cond_sel.ml:13: h: Not detected -./examples/using_make/dir/alias_opt.ml:7: y: Not detected -./examples/using_make/dir/alias_opt.ml:14: x: Not detected -./examples/using_make/dir/anon_call.ml:1: f: Not detected -./examples/using_make/dir/anon_call.ml:5: g: Not detected -./examples/using_make/dir/anon_call.ml:9: h: Not detected -./examples/using_make/dir/anon_call2.ml:1: f: Not detected -./examples/using_make/dir/anon_call2.ml:5: g: Not detected -./examples/using_make/dir/anon_call2.ml:9: h: Not detected -./examples/using_make/dir/match_opt.ml:8: l: Not detected -./examples/using_make/dir/matchopt.ml:5: w: Not detected +./examples/using_make/cond_sel.ml:13: h + +./examples/using_make/dir/alias_opt.ml:7: y +./examples/using_make/dir/alias_opt.ml:14: x +./examples/using_make/dir/anon_call.ml:1: f +./examples/using_make/dir/anon_call.ml:5: g +./examples/using_make/dir/anon_call.ml:9: h +./examples/using_make/dir/anon_call2.ml:1: f +./examples/using_make/dir/anon_call2.ml:5: g +./examples/using_make/dir/anon_call2.ml:9: h +./examples/using_make/dir/match_opt.ml:8: l +./examples/using_make/dir/matchopt.ml:5: w ./examples/using_make/dir/mod.mli:10: M.f: Should not be detected ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x -./examples/using_make/dir/ref_opt.ml:3: no: Not detected -./examples/using_make/dir/ref_opt.ml:11: x: Not detected +./examples/using_make/dir/ref_opt.ml:3: no +./examples/using_make/dir/ref_opt.ml:11: x + ./examples/using_make/exported.mli:11: F.times_five: Not detected ./examples/using_make/exported.mli:17: M2.ten: Not detected ./examples/using_make/exported.mli:6: M1.five: Should not be detected @@ -83,20 +88,20 @@ ./examples/using_make/functor.mli:3: M.none ./examples/using_make/functor.mli:7: F.g: Should not be detected ./examples/using_make/functor.mli:11: N.g: Should not be detected -./examples/using_make/let_in.ml:3: parent: Not detected -./examples/using_make/let_test.ml:3: g: Not detected -./examples/using_make/matchopt.ml:5: w: Not detected +./examples/using_make/let_in.ml:3: parent +./examples/using_make/let_test.ml:3: g +./examples/using_make/matchopt.ml:5: w ./examples/using_make/mod_alias.mli:2: M1.id: Should not be detected ./examples/using_make/mod_alias.mli:6: M2.id: Should not be detected ./examples/using_make/obj/class.mli:7: o: Should not be detected ./examples/using_make/obj/class.mli:9: f: Should not be detected ./examples/using_make/obj/inher.mli:11: o: Should not be detected ./examples/using_make/obj/inher.mli:13: f: Should not be detected -./examples/using_make/opt_in_opt.ml:7: x: Not detected -./examples/using_make/qux.ml:1: z: Not detected -./examples/using_make/unused_fn.ml:3: g: Not detected -./examples/using_make/unused_fn.ml:5: var: Not detected -./examples/using_make/useless_opt.ml:3: x: Not detected +./examples/using_make/opt_in_opt.ml:7: x +./examples/using_make/qux.ml:1: z +./examples/using_make/unused_fn.ml:3: g +./examples/using_make/unused_fn.ml:5: var +./examples/using_make/useless_opt.ml:3: x ./examples/using_make/variant.mli:5: f: Should not be detected -------- @@ -139,8 +144,9 @@ ./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:4: externally_used ./examples/using_dune/preprocessed_lib/preprocessed.mli:31: f: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:4: internally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:5: externally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:4: internally_used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:5: externally_used + ./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected @@ -161,7 +167,8 @@ ./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected -./examples/using_dune/unwrapped_lib/style/style.ml:1: all: Not detected +./examples/using_dune/unwrapped_lib/style/style.ml:1: all + ./examples/using_dune/unwrapped_lib/values/values.mli:1: used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:4: externally_used_int @@ -183,21 +190,22 @@ ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:3: internally_used_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:4: externally_used_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:8: externally_matched_option: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:15: internally_used_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:16: externally_used_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:27: internally_used_closure: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:28: externally_used_closure: Not detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:3: internally_used_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:4: externally_used_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:8: externally_matched_option +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:15: internally_used_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:16: externally_used_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:27: internally_used_closure +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:28: externally_used_closure + ./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected @@ -218,7 +226,8 @@ ./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected -./examples/using_dune/wrapped_lib/style/style.ml:1: all: Not detected +./examples/using_dune/wrapped_lib/style/style.ml:1: all + ./examples/using_dune/wrapped_lib/values/values.mli:1: used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:4: externally_used_int @@ -240,65 +249,69 @@ ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int: Not detected -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:3: internally_used_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:4: externally_used_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:8: externally_matched_option: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:15: internally_used_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:16: externally_used_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:27: internally_used_closure: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:28: externally_used_closure: Not detected -./examples/using_make/advanced/incl.ml:7: f: Not detected +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:3: internally_used_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:4: externally_used_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:8: externally_matched_option +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:15: internally_used_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:16: externally_used_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:27: internally_used_closure +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:28: externally_used_closure + +./examples/using_make/advanced/incl.ml:7: f ./examples/using_make/advanced/mod.mli:1: f ./examples/using_make/advanced/mod.mli:2: x ./examples/using_make/advanced/val.mli:1: x: Not detected ./examples/using_make/advanced/val.mli:2: y: Not detected ./examples/using_make/baz.mli:2: t -./examples/using_make/cond_sel.ml:9: f: Not detected -./examples/using_make/cond_sel.ml:11: g: Not detected -./examples/using_make/dir/alias_opt.ml:4: baz: Not detected -./examples/using_make/dir/alias_opt.ml:11: foo: Not detected -./examples/using_make/dir/alias_opt.ml:12: bar: Not detected -./examples/using_make/dir/fn_arg.ml:1: f: Not detected -./examples/using_make/dir/fn_arg.ml:3: g: Not detected -./examples/using_make/dir/fn_arg.ml:9: i: Not detected -./examples/using_make/dir/fn_arg.ml:11: j: Not detected -./examples/using_make/dir/hidden_opt_use.ml:1: f: Not detected -./examples/using_make/dir/hidden_opt_use.ml:3: apply: Not detected -./examples/using_make/dir/match_opt.ml:3: m: Not detected +./examples/using_make/cond_sel.ml:9: f +./examples/using_make/cond_sel.ml:11: g + +./examples/using_make/dir/alias_opt.ml:4: baz +./examples/using_make/dir/alias_opt.ml:11: foo +./examples/using_make/dir/alias_opt.ml:12: bar +./examples/using_make/dir/fn_arg.ml:1: f +./examples/using_make/dir/fn_arg.ml:3: g +./examples/using_make/dir/fn_arg.ml:9: i +./examples/using_make/dir/fn_arg.ml:11: j +./examples/using_make/dir/hidden_opt_use.ml:1: f +./examples/using_make/dir/hidden_opt_use.ml:3: apply +./examples/using_make/dir/match_opt.ml:3: m ./examples/using_make/dir/mod.mli:10: M.f: Not detected -./examples/using_make/dir/partial.ml:5: g: Not detected -./examples/using_make/dir/ref_fn.ml:5: g: Not detected -./examples/using_make/dir/ref_opt.ml:7: g: Not detected +./examples/using_make/dir/partial.ml:5: g +./examples/using_make/dir/ref_fn.ml:5: g +./examples/using_make/dir/ref_opt.ml:7: g + ./examples/using_make/foo.mli:1: x ./examples/using_make/fooFn.mli:1: f ./examples/using_make/functor.mli:2: M.f: Not detected -./examples/using_make/if_end.ml:1: f: Not detected -./examples/using_make/if_end.ml:3: g: Not detected -./examples/using_make/if_end.ml:5: h: Not detected +./examples/using_make/if_end.ml:1: f +./examples/using_make/if_end.ml:3: g +./examples/using_make/if_end.ml:5: h ./examples/using_make/letIn.mli:1: f ./examples/using_make/mod_alias.mli:2: M1.id: Not detected ./examples/using_make/mod_alias.mli:6: M2.id: Not detected ./examples/using_make/obj/class.mli:9: f: Not detected -./examples/using_make/obj/fun_class.ml:8: f: Not detected -./examples/using_make/obj/fun_obj_param.ml:7: app_m: Not detected +./examples/using_make/obj/fun_class.ml:8: f +./examples/using_make/obj/fun_obj_param.ml:7: app_m ./examples/using_make/obj/inher.mli:13: f: Not detected -./examples/using_make/obj/obj_inher.ml:7: o: Not detected -./examples/using_make/obj/obj_inher.ml:12: o4: Not detected -./examples/using_make/obj/obj_inher.ml:17: o2: Not detected -./examples/using_make/obj/obj_inher.ml:19: o3: Not detected -./examples/using_make/obj/obj_inher.ml:24: f: Not detected -./examples/using_make/obj/object.ml:7: f: Not detected -./examples/using_make/opt_in_opt.ml:5: baz: Not detected -./examples/using_make/partial_opt.ml:1: f: Not detected -./examples/using_make/useless_opt.ml:1: foo: Not detected +./examples/using_make/obj/obj_inher.ml:7: o +./examples/using_make/obj/obj_inher.ml:12: o4 +./examples/using_make/obj/obj_inher.ml:17: o2 +./examples/using_make/obj/obj_inher.ml:19: o3 +./examples/using_make/obj/obj_inher.ml:24: f +./examples/using_make/obj/object.ml:7: f + +./examples/using_make/opt_in_opt.ml:5: baz +./examples/using_make/partial_opt.ml:1: f +./examples/using_make/useless_opt.ml:1: foo ./examples/using_make/variant.mli:5: f: Not detected Nothing else to report in this section -------------------------------------------------------------------------------- @@ -307,7 +320,8 @@ Nothing else to report in this section .> UNUSED METHODS: ================= ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused + ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -338,23 +352,22 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected -./examples/using_make/advanced/mod.mli:4: p#f: Should not be detected ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f ./examples/using_make/obj/coerce.mli:6: p#h -./examples/using_make/obj/constraint.ml:1: p#g: Not detected +./examples/using_make/obj/constraint.ml:1: p#g ./examples/using_make/obj/fooCl.mli:1: p1#g ./examples/using_make/obj/fooCl.mli:1: p1#h ./examples/using_make/obj/fooCl.mli:7: p2#h -./examples/using_make/obj/fun_class.ml:1: c#m3: Not detected -./examples/using_make/obj/fun_obj_param.ml:1: f#n: Not detected +./examples/using_make/obj/fun_class.ml:1: c#m3 +./examples/using_make/obj/fun_obj_param.ml:1: f#n ./examples/using_make/obj/inher.mli:1: p#h ./examples/using_make/obj/named.mli:10: c#g -./examples/using_make/obj/obj_inher.ml:1: c#g: Not detected -./examples/using_make/obj/obj_inher.ml:1: c#h: Not detected -./examples/using_make/obj/obj_inher.ml:19: o3#k: Not detected -./examples/using_make/obj/object.ml:1: o#h: Not detected +./examples/using_make/obj/obj_inher.ml:1: c#g +./examples/using_make/obj/obj_inher.ml:1: c#h +./examples/using_make/obj/obj_inher.ml:19: o3#k +./examples/using_make/obj/object.ml:1: o#h ./examples/using_make/obj/overr.mli:1: p1#g ./examples/using_make/obj/overr.mli:1: p1#h ./examples/using_make/obj/overr.mli:7: p2#g @@ -366,8 +379,9 @@ Nothing else to report in this section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#externally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#internally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#externally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#internally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#externally_used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#internally_used + ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#used ./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun: Not detected @@ -397,28 +411,29 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int: Not detected ./examples/using_make/advanced/func.mli:3: M.c#f -./examples/using_make/advanced/mod.mli:4: p#f: Not detected +./examples/using_make/advanced/mod.mli:4: p#f + ./examples/using_make/obj/class.mli:1: c#f ./examples/using_make/obj/class.mli:1: c#g ./examples/using_make/obj/class_type.mli:7: p#f ./examples/using_make/obj/class_type.mli:7: p#h ./examples/using_make/obj/coerce.mli:8: c#h -./examples/using_make/obj/constraint.ml:1: p#f: Not detected -./examples/using_make/obj/depend.ml:8: M.c#f: Not detected +./examples/using_make/obj/constraint.ml:1: p#f +./examples/using_make/obj/depend.ml:8: M.c#f ./examples/using_make/obj/fooCl.mli:1: p1#f ./examples/using_make/obj/fooCl.mli:7: p2#g -./examples/using_make/obj/fun_class.ml:1: c#m1: Not detected -./examples/using_make/obj/fun_class.ml:1: c#m2: Not detected -./examples/using_make/obj/fun_class.ml:1: c#m4: Not detected -./examples/using_make/obj/fun_obj_param.ml:1: f#m: Not detected -./examples/using_make/obj/fun_obj_param.ml:1: f#x: Not detected +./examples/using_make/obj/fun_class.ml:1: c#m1 +./examples/using_make/obj/fun_class.ml:1: c#m2 +./examples/using_make/obj/fun_class.ml:1: c#m4 +./examples/using_make/obj/fun_obj_param.ml:1: f#m +./examples/using_make/obj/fun_obj_param.ml:1: f#x ./examples/using_make/obj/inher.mli:1: p#f ./examples/using_make/obj/inher.mli:1: p#g ./examples/using_make/obj/named.mli:1: p1#g ./examples/using_make/obj/named.mli:6: p2#f ./examples/using_make/obj/named.mli:10: c#f -./examples/using_make/obj/object.ml:1: o#f: Not detected -./examples/using_make/obj/object.ml:1: o#g: Not detected +./examples/using_make/obj/object.ml:1: o#f +./examples/using_make/obj/object.ml:1: o#g ./examples/using_make/obj/overr.mli:1: p1#f ./examples/using_make/obj/overr.mli:12: c#g @@ -431,9 +446,10 @@ Nothing else to report in this section ./examples/using_dune/preprocessed_lib/preprocessed.mli:14: constructors.Unused: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:19: constr_with_eq.Unused: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:23: record.unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused + ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:1: unused_single_no_param.Unused_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:2: unused_single_unit.Unused_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:3: unused_single_param.Unused_single_param @@ -507,11 +523,12 @@ Nothing else to report in this section ./examples/using_dune/preprocessed_lib/preprocessed.mli:25: record.internally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:26: record.externally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:29: record_with_eq.implicitly_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:27: constructors.Internally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:28: constructors.Externally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:41: record.internally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:42: record.externally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:45: record_with_eq.implicitly_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:27: constructors.Internally_used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:28: constructors.Externally_used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:41: record.internally_used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:42: record.externally_used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:45: record_with_eq.implicitly_used + ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:25: internally_used_single_no_param.Internally_used_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:26: internally_used_single_unit.Internally_used_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:27: internally_used_single_param.Internally_used_single_param @@ -878,7 +895,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 800 -Success: 491 -Failed: 309 -Ratio: 61.375% +Total: 799 +Success: 617 +Failed: 182 +Ratio: 77.2215269086% diff --git a/check/threshold-3-0.5/threshold-3-0.5.ref b/check/threshold-3-0.5/threshold-3-0.5.ref index d1098ea..3902208 100644 --- a/check/threshold-3-0.5/threshold-3-0.5.ref +++ b/check/threshold-3-0.5/threshold-3-0.5.ref @@ -2,7 +2,8 @@ ========================= ./examples/using_dune/preprocessed_lib/preprocessed.mli:1: unused ./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused + ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected @@ -19,11 +20,12 @@ ./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:20: unused_alias_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure + ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected @@ -40,35 +42,38 @@ ./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure: Not detected +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:20: unused_alias_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:25: unused_closure + ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y ./examples/using_make/advanced/val.mli:1: x: Should not be detected ./examples/using_make/advanced/val.mli:2: y: Should not be detected -./examples/using_make/bar.ml:1: x: Not detected -./examples/using_make/bar_fn.ml:3: h: Not detected +./examples/using_make/bar.ml:1: x +./examples/using_make/bar_fn.ml:3: h ./examples/using_make/baz.mli:1: z ./examples/using_make/baz.mli:3: u -./examples/using_make/cond_sel.ml:13: h: Not detected -./examples/using_make/dir/alias_opt.ml:7: y: Not detected -./examples/using_make/dir/alias_opt.ml:14: x: Not detected -./examples/using_make/dir/anon_call.ml:1: f: Not detected -./examples/using_make/dir/anon_call.ml:5: g: Not detected -./examples/using_make/dir/anon_call.ml:9: h: Not detected -./examples/using_make/dir/anon_call2.ml:1: f: Not detected -./examples/using_make/dir/anon_call2.ml:5: g: Not detected -./examples/using_make/dir/anon_call2.ml:9: h: Not detected -./examples/using_make/dir/match_opt.ml:8: l: Not detected -./examples/using_make/dir/matchopt.ml:5: w: Not detected +./examples/using_make/cond_sel.ml:13: h + +./examples/using_make/dir/alias_opt.ml:7: y +./examples/using_make/dir/alias_opt.ml:14: x +./examples/using_make/dir/anon_call.ml:1: f +./examples/using_make/dir/anon_call.ml:5: g +./examples/using_make/dir/anon_call.ml:9: h +./examples/using_make/dir/anon_call2.ml:1: f +./examples/using_make/dir/anon_call2.ml:5: g +./examples/using_make/dir/anon_call2.ml:9: h +./examples/using_make/dir/match_opt.ml:8: l +./examples/using_make/dir/matchopt.ml:5: w ./examples/using_make/dir/mod.mli:10: M.f: Should not be detected ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x -./examples/using_make/dir/ref_opt.ml:3: no: Not detected -./examples/using_make/dir/ref_opt.ml:11: x: Not detected +./examples/using_make/dir/ref_opt.ml:3: no +./examples/using_make/dir/ref_opt.ml:11: x + ./examples/using_make/exported.mli:11: F.times_five: Not detected ./examples/using_make/exported.mli:17: M2.ten: Not detected ./examples/using_make/exported.mli:6: M1.five: Should not be detected @@ -83,20 +88,20 @@ ./examples/using_make/functor.mli:3: M.none ./examples/using_make/functor.mli:7: F.g: Should not be detected ./examples/using_make/functor.mli:11: N.g: Should not be detected -./examples/using_make/let_in.ml:3: parent: Not detected -./examples/using_make/let_test.ml:3: g: Not detected -./examples/using_make/matchopt.ml:5: w: Not detected +./examples/using_make/let_in.ml:3: parent +./examples/using_make/let_test.ml:3: g +./examples/using_make/matchopt.ml:5: w ./examples/using_make/mod_alias.mli:2: M1.id: Should not be detected ./examples/using_make/mod_alias.mli:6: M2.id: Should not be detected ./examples/using_make/obj/class.mli:7: o: Should not be detected ./examples/using_make/obj/class.mli:9: f: Should not be detected ./examples/using_make/obj/inher.mli:11: o: Should not be detected ./examples/using_make/obj/inher.mli:13: f: Should not be detected -./examples/using_make/opt_in_opt.ml:7: x: Not detected -./examples/using_make/qux.ml:1: z: Not detected -./examples/using_make/unused_fn.ml:3: g: Not detected -./examples/using_make/unused_fn.ml:5: var: Not detected -./examples/using_make/useless_opt.ml:3: x: Not detected +./examples/using_make/opt_in_opt.ml:7: x +./examples/using_make/qux.ml:1: z +./examples/using_make/unused_fn.ml:3: g +./examples/using_make/unused_fn.ml:5: var +./examples/using_make/useless_opt.ml:3: x ./examples/using_make/variant.mli:5: f: Should not be detected -------- @@ -139,8 +144,9 @@ ./examples/using_dune/preprocessed_lib/preprocessed.mli:3: internally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:4: externally_used ./examples/using_dune/preprocessed_lib/preprocessed.mli:31: f: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:4: internally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:5: externally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:4: internally_used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:5: externally_used + ./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected @@ -161,7 +167,8 @@ ./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected ./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected -./examples/using_dune/unwrapped_lib/style/style.ml:1: all: Not detected +./examples/using_dune/unwrapped_lib/style/style.ml:1: all + ./examples/using_dune/unwrapped_lib/values/values.mli:1: used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:4: externally_used_int @@ -183,21 +190,22 @@ ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:3: internally_used_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:4: externally_used_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:8: externally_matched_option: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:15: internally_used_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:16: externally_used_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:27: internally_used_closure: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:28: externally_used_closure: Not detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:3: internally_used_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:4: externally_used_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:8: externally_matched_option +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:15: internally_used_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:16: externally_used_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:27: internally_used_closure +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:28: externally_used_closure + ./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected @@ -218,7 +226,8 @@ ./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected ./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected -./examples/using_dune/wrapped_lib/style/style.ml:1: all: Not detected +./examples/using_dune/wrapped_lib/style/style.ml:1: all + ./examples/using_dune/wrapped_lib/values/values.mli:1: used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:4: externally_used_int @@ -240,65 +249,69 @@ ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int: Not detected -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:3: internally_used_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:4: externally_used_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:8: externally_matched_option: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:15: internally_used_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:16: externally_used_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:27: internally_used_closure: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:28: externally_used_closure: Not detected -./examples/using_make/advanced/incl.ml:7: f: Not detected +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:3: internally_used_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:4: externally_used_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:5: externally_used_as_parameter_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:7: externally_written_bool_ref +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:8: externally_matched_option +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:10: externally_stored_in_ref_bool +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:11: externally_stored_in_option_bool +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:15: internally_used_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:16: externally_used_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:17: externally_used_as_parameter_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:22: externally_used_alias_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:27: internally_used_closure +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:28: externally_used_closure + +./examples/using_make/advanced/incl.ml:7: f ./examples/using_make/advanced/mod.mli:1: f ./examples/using_make/advanced/mod.mli:2: x ./examples/using_make/advanced/val.mli:1: x: Not detected ./examples/using_make/advanced/val.mli:2: y: Not detected ./examples/using_make/baz.mli:2: t -./examples/using_make/cond_sel.ml:9: f: Not detected -./examples/using_make/cond_sel.ml:11: g: Not detected -./examples/using_make/dir/alias_opt.ml:4: baz: Not detected -./examples/using_make/dir/alias_opt.ml:11: foo: Not detected -./examples/using_make/dir/alias_opt.ml:12: bar: Not detected -./examples/using_make/dir/fn_arg.ml:1: f: Not detected -./examples/using_make/dir/fn_arg.ml:3: g: Not detected -./examples/using_make/dir/fn_arg.ml:9: i: Not detected -./examples/using_make/dir/fn_arg.ml:11: j: Not detected -./examples/using_make/dir/hidden_opt_use.ml:1: f: Not detected -./examples/using_make/dir/hidden_opt_use.ml:3: apply: Not detected -./examples/using_make/dir/match_opt.ml:3: m: Not detected +./examples/using_make/cond_sel.ml:9: f +./examples/using_make/cond_sel.ml:11: g + +./examples/using_make/dir/alias_opt.ml:4: baz +./examples/using_make/dir/alias_opt.ml:11: foo +./examples/using_make/dir/alias_opt.ml:12: bar +./examples/using_make/dir/fn_arg.ml:1: f +./examples/using_make/dir/fn_arg.ml:3: g +./examples/using_make/dir/fn_arg.ml:9: i +./examples/using_make/dir/fn_arg.ml:11: j +./examples/using_make/dir/hidden_opt_use.ml:1: f +./examples/using_make/dir/hidden_opt_use.ml:3: apply +./examples/using_make/dir/match_opt.ml:3: m ./examples/using_make/dir/mod.mli:10: M.f: Not detected -./examples/using_make/dir/partial.ml:5: g: Not detected -./examples/using_make/dir/ref_fn.ml:5: g: Not detected -./examples/using_make/dir/ref_opt.ml:7: g: Not detected +./examples/using_make/dir/partial.ml:5: g +./examples/using_make/dir/ref_fn.ml:5: g +./examples/using_make/dir/ref_opt.ml:7: g + ./examples/using_make/foo.mli:1: x ./examples/using_make/fooFn.mli:1: f ./examples/using_make/functor.mli:2: M.f: Not detected -./examples/using_make/if_end.ml:1: f: Not detected -./examples/using_make/if_end.ml:3: g: Not detected -./examples/using_make/if_end.ml:5: h: Not detected +./examples/using_make/if_end.ml:1: f +./examples/using_make/if_end.ml:3: g +./examples/using_make/if_end.ml:5: h ./examples/using_make/letIn.mli:1: f ./examples/using_make/mod_alias.mli:2: M1.id: Not detected ./examples/using_make/mod_alias.mli:6: M2.id: Not detected ./examples/using_make/obj/class.mli:9: f: Not detected -./examples/using_make/obj/fun_class.ml:8: f: Not detected -./examples/using_make/obj/fun_obj_param.ml:7: app_m: Not detected +./examples/using_make/obj/fun_class.ml:8: f +./examples/using_make/obj/fun_obj_param.ml:7: app_m ./examples/using_make/obj/inher.mli:13: f: Not detected -./examples/using_make/obj/obj_inher.ml:7: o: Not detected -./examples/using_make/obj/obj_inher.ml:12: o4: Not detected -./examples/using_make/obj/obj_inher.ml:17: o2: Not detected -./examples/using_make/obj/obj_inher.ml:19: o3: Not detected -./examples/using_make/obj/obj_inher.ml:24: f: Not detected -./examples/using_make/obj/object.ml:7: f: Not detected -./examples/using_make/opt_in_opt.ml:5: baz: Not detected -./examples/using_make/partial_opt.ml:1: f: Not detected -./examples/using_make/useless_opt.ml:1: foo: Not detected +./examples/using_make/obj/obj_inher.ml:7: o +./examples/using_make/obj/obj_inher.ml:12: o4 +./examples/using_make/obj/obj_inher.ml:17: o2 +./examples/using_make/obj/obj_inher.ml:19: o3 +./examples/using_make/obj/obj_inher.ml:24: f +./examples/using_make/obj/object.ml:7: f + +./examples/using_make/opt_in_opt.ml:5: baz +./examples/using_make/partial_opt.ml:1: f +./examples/using_make/useless_opt.ml:1: foo ./examples/using_make/variant.mli:5: f: Not detected -------- @@ -308,8 +321,9 @@ ./examples/using_dune/preprocessed_lib/preprocessed.mli:2: used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:31: f: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:3: used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: f: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:3: used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: f + ./examples/using_dune/unwrapped_lib/obj/with_class.mli:21: basics_factory: Should not be detected ./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory: Not detected ./examples/using_dune/unwrapped_lib/opt_args/mixed_args.mli:1: interlaced_mandatory_and_opt: Should not be detected @@ -344,11 +358,12 @@ ./examples/using_dune/unwrapped_lib/values/values.mli:19: used_alias_fun: Not detected ./examples/using_dune/unwrapped_lib/values/values.mli:24: used_closure: Not detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:2: Exported.used_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:1: used_int: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:14: used_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:21: used_alias_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:26: used_closure: Not detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:2: Exported.used_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:1: used_int +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:14: used_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:21: used_alias_fun +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:26: used_closure + ./examples/using_dune/wrapped_lib/obj/with_class.mli:21: basics_factory: Should not be detected ./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory: Not detected ./examples/using_dune/wrapped_lib/opt_args/mixed_args.mli:1: interlaced_mandatory_and_opt: Should not be detected @@ -383,45 +398,53 @@ ./examples/using_dune/wrapped_lib/values/values.mli:19: used_alias_fun: Not detected ./examples/using_dune/wrapped_lib/values/values.mli:24: used_closure: Not detected ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Not detected -./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:2: Exported.used_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:1: used_int: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:14: used_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:21: used_alias_fun: Not detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:26: used_closure: Not detected +./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:2: Exported.used_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:1: used_int +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:14: used_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:21: used_alias_fun +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:26: used_closure + ./examples/using_make/dir/anonFn.mli:1: f ./examples/using_make/dir/anonFn.mli:2: g ./examples/using_make/dir/anonFn.mli:3: h -./examples/using_make/dir/fn_arg.ml:7: h: Not detected -./examples/using_make/dir/partial.ml:1: f: Not detected -./examples/using_make/dir/ref_opt.ml:1: f: Not detected -./examples/using_make/dir/ref_opt.ml:5: r: Not detected +./examples/using_make/dir/fn_arg.ml:7: h +./examples/using_make/dir/partial.ml:1: f +./examples/using_make/dir/ref_opt.ml:1: f +./examples/using_make/dir/ref_opt.ml:5: r + ./examples/using_make/exported.mli:6: M1.five: Not detected ./examples/using_make/exported.mli:15: M2.five: Not detected ./examples/using_make/functor.mli:7: F.g: Not detected ./examples/using_make/functor.mli:11: N.g: Not detected ./examples/using_make/obj/class.mli:7: o: Not detected -./examples/using_make/obj/fun_obj_param.ml:1: f: Not detected +./examples/using_make/obj/fun_obj_param.ml:1: f ./examples/using_make/obj/inher.mli:11: o: Not detected -./examples/using_make/obj/object.ml:1: o: Not detected -./examples/using_make/opt_in_opt.ml:1: foo: Not detected -./examples/using_make/unused_fn.ml:1: f: Not detected +./examples/using_make/obj/object.ml:1: o + +./examples/using_make/opt/sig_struct.ml:6: f: Should not be detected +./examples/using_make/opt_in_opt.ml:1: foo +./examples/using_make/unused_fn.ml:1: f -------- .>-> ALMOST UNUSED EXPORTED VALUES: Called 3 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:24: multiple_sometimes_used_opt_args: Should not be detected -./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:19: aliased_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:19: aliased_fun + ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:24: multiple_sometimes_used_opt_args: Should not be detected -./examples/using_dune/wrapped_lib/values/values_no_intf.ml:19: aliased_fun: Not detected +./examples/using_dune/wrapped_lib/values/values_no_intf.ml:19: aliased_fun + ./examples/using_make/dir/anonFn2.mli:1: f ./examples/using_make/dir/anonFn2.mli:2: g -./examples/using_make/dir/match_opt.ml:1: f: Not detected +./examples/using_make/dir/match_opt.ml:1: f ./examples/using_make/dir/refFn.mli:1: r: Should not be detected -./examples/using_make/dir/ref_fn.ml:1: f: Not detected +./examples/using_make/dir/ref_fn.ml:1: f + ./examples/using_make/exported.mli:10: F.plus_five: Not detected ./examples/using_make/exported.mli:16: M2.plus_five: Not detected -./examples/using_make/let_in.ml:1: complicated: Not detected +./examples/using_make/let_in.ml:1: complicated + ./examples/using_make/opt/sig_struct.ml:6: f: Not detected Nothing else to report in this section -------------------------------------------------------------------------------- @@ -430,7 +453,8 @@ Nothing else to report in this section .> UNUSED METHODS: ================= ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused + ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -461,23 +485,22 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected -./examples/using_make/advanced/mod.mli:4: p#f: Should not be detected ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f ./examples/using_make/obj/coerce.mli:6: p#h -./examples/using_make/obj/constraint.ml:1: p#g: Not detected +./examples/using_make/obj/constraint.ml:1: p#g ./examples/using_make/obj/fooCl.mli:1: p1#g ./examples/using_make/obj/fooCl.mli:1: p1#h ./examples/using_make/obj/fooCl.mli:7: p2#h -./examples/using_make/obj/fun_class.ml:1: c#m3: Not detected -./examples/using_make/obj/fun_obj_param.ml:1: f#n: Not detected +./examples/using_make/obj/fun_class.ml:1: c#m3 +./examples/using_make/obj/fun_obj_param.ml:1: f#n ./examples/using_make/obj/inher.mli:1: p#h ./examples/using_make/obj/named.mli:10: c#g -./examples/using_make/obj/obj_inher.ml:1: c#g: Not detected -./examples/using_make/obj/obj_inher.ml:1: c#h: Not detected -./examples/using_make/obj/obj_inher.ml:19: o3#k: Not detected -./examples/using_make/obj/object.ml:1: o#h: Not detected +./examples/using_make/obj/obj_inher.ml:1: c#g +./examples/using_make/obj/obj_inher.ml:1: c#h +./examples/using_make/obj/obj_inher.ml:19: o3#k +./examples/using_make/obj/object.ml:1: o#h ./examples/using_make/obj/overr.mli:1: p1#g ./examples/using_make/obj/overr.mli:1: p1#h ./examples/using_make/obj/overr.mli:7: p2#g @@ -489,8 +512,9 @@ Nothing else to report in this section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#externally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#internally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#externally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#internally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#externally_used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#internally_used + ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#used ./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun: Not detected @@ -520,28 +544,29 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun: Not detected ./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int: Not detected ./examples/using_make/advanced/func.mli:3: M.c#f -./examples/using_make/advanced/mod.mli:4: p#f: Not detected +./examples/using_make/advanced/mod.mli:4: p#f + ./examples/using_make/obj/class.mli:1: c#f ./examples/using_make/obj/class.mli:1: c#g ./examples/using_make/obj/class_type.mli:7: p#f ./examples/using_make/obj/class_type.mli:7: p#h ./examples/using_make/obj/coerce.mli:8: c#h -./examples/using_make/obj/constraint.ml:1: p#f: Not detected -./examples/using_make/obj/depend.ml:8: M.c#f: Not detected +./examples/using_make/obj/constraint.ml:1: p#f +./examples/using_make/obj/depend.ml:8: M.c#f ./examples/using_make/obj/fooCl.mli:1: p1#f ./examples/using_make/obj/fooCl.mli:7: p2#g -./examples/using_make/obj/fun_class.ml:1: c#m1: Not detected -./examples/using_make/obj/fun_class.ml:1: c#m2: Not detected -./examples/using_make/obj/fun_class.ml:1: c#m4: Not detected -./examples/using_make/obj/fun_obj_param.ml:1: f#m: Not detected -./examples/using_make/obj/fun_obj_param.ml:1: f#x: Not detected +./examples/using_make/obj/fun_class.ml:1: c#m1 +./examples/using_make/obj/fun_class.ml:1: c#m2 +./examples/using_make/obj/fun_class.ml:1: c#m4 +./examples/using_make/obj/fun_obj_param.ml:1: f#m +./examples/using_make/obj/fun_obj_param.ml:1: f#x ./examples/using_make/obj/inher.mli:1: p#f ./examples/using_make/obj/inher.mli:1: p#g ./examples/using_make/obj/named.mli:1: p1#g ./examples/using_make/obj/named.mli:6: p2#f ./examples/using_make/obj/named.mli:10: c#f -./examples/using_make/obj/object.ml:1: o#f: Not detected -./examples/using_make/obj/object.ml:1: o#g: Not detected +./examples/using_make/obj/object.ml:1: o#f +./examples/using_make/obj/object.ml:1: o#g ./examples/using_make/obj/overr.mli:1: p1#f ./examples/using_make/obj/overr.mli:12: c#g -------- @@ -550,7 +575,8 @@ Nothing else to report in this section .>-> ALMOST UNUSED METHODS: Called 2 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#used + ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#externally_used_fun ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#externally_used_int ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#internally_used_fun @@ -576,7 +602,7 @@ Nothing else to report in this section ./examples/using_make/obj/class_type.mli:7: p#g ./examples/using_make/obj/coerce.mli:8: c#f ./examples/using_make/obj/named.mli:1: p1#f -./examples/using_make/obj/obj_inher.ml:1: c#f: Not detected +./examples/using_make/obj/obj_inher.ml:1: c#f -------- @@ -590,9 +616,10 @@ Nothing else to report in this section ./examples/using_dune/preprocessed_lib/preprocessed.mli:14: constructors.Unused: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:19: constr_with_eq.Unused: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:23: record.unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:25: constructors.Unused +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:30: constr_with_eq.Unused +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:39: record.unused + ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:1: unused_single_no_param.Unused_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:2: unused_single_unit.Unused_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:3: unused_single_param.Unused_single_param @@ -666,11 +693,12 @@ Nothing else to report in this section ./examples/using_dune/preprocessed_lib/preprocessed.mli:25: record.internally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:26: record.externally_used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:29: record_with_eq.implicitly_used -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:27: constructors.Internally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:28: constructors.Externally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:41: record.internally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:42: record.externally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:45: record_with_eq.implicitly_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:27: constructors.Internally_used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:28: constructors.Externally_used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:41: record.internally_used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:42: record.externally_used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:45: record_with_eq.implicitly_used + ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:25: internally_used_single_no_param.Internally_used_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:26: internally_used_single_unit.Internally_used_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:27: internally_used_single_param.Internally_used_single_param @@ -740,8 +768,9 @@ Nothing else to report in this section ./examples/using_dune/preprocessed_lib/preprocessed.mli:24: record.used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:25: record.internally_used: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:26: record.externally_used: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:26: constructors.Used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:40: record.used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:26: constructors.Used +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:40: record.used + ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:17: used_single_no_param.Used_single_no_param ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:18: used_single_unit.Used_single_unit ./examples/using_dune/unwrapped_lib/constructors_and_records/constructors.mli:19: used_single_param.Used_single_param @@ -1256,6 +1285,6 @@ Nothing else to report in this section Total: 1123 -Success: 680 -Failed: 443 -Ratio: 60.5520926091% +Success: 835 +Failed: 288 +Ratio: 74.3544078362% diff --git a/src/deadCode.ml b/src/deadCode.ml index 817fa3c..47d86f5 100644 --- a/src/deadCode.ml +++ b/src/deadCode.ml @@ -336,7 +336,10 @@ let kind fn = end else if DeadFlag.is_excluded fn then `Ignore else if Sys.is_directory fn then `Dir else if Filename.check_suffix fn ".cmti" then `Cmti - else if Filename.check_suffix fn ".cmt" then `Cmt + else if Filename.check_suffix fn ".cmt" then + let cmti = Filename.remove_extension fn ^ ".cmti" in + if Sys.file_exists cmti then `Cmt_with_mli + else `Cmt_without_mli else `Ignore @@ -366,7 +369,7 @@ let read_interface fn signature state = let f = collect_export [module_id] u decs in - List.iter f signature.sig_type; + List.iter f signature; last_loc := Lexing.dummy_pos @@ -441,64 +444,64 @@ let rec load_file state fn = (* TODO: stateful computations should take and return the state when possible *) state in - match kind fn with - | `Cmti when !DeadCommon.declarations -> - let open Cmt_format in - last_loc := Lexing.dummy_pos; - if !DeadFlag.verbose then Printf.eprintf "Scanning %s\n%!" fn; - init_and_continue state fn (fun state -> - match state.file_infos.cmti_infos with - | None -> bad_files := fn :: !bad_files - | Some {cmt_annots = Interface signature; _} -> - read_interface fn signature state - | _ -> () - ) - - | `Cmt -> - let open Cmt_format in - last_loc := Lexing.dummy_pos; - if !DeadFlag.verbose then Printf.eprintf "Scanning %s\n%!" fn; - init_and_continue state fn (fun state -> - regabs state; - match state.file_infos.cmt_infos with - | None -> bad_files := fn :: !bad_files - | Some ({cmt_annots = Implementation x; _} as cmt_infos) -> - let uid_decl_dep_to_loc_pair (_dep_kind, uid_def, uid_decl) = - let ( let* ) x f = Option.bind x f in - let loc_opt_of_uid uid = - let* decl = - Uid.Tbl.find_opt cmt_infos.cmt_uid_to_decl uid - in - match decl with - | Value {val_loc = {loc_start; loc_ghost = false; _}; _} -> - Some loc_start - | _ -> None + let process_interface fn = + last_loc := Lexing.dummy_pos; + if !DeadFlag.verbose then Printf.eprintf "Scanning interface from %s\n%!" fn; + init_and_continue state fn (fun state -> + match state.file_infos.cmi_infos with + | None -> bad_files := fn :: !bad_files + | Some {cmi_sign; _} -> + read_interface fn cmi_sign state + ) + in + let process_implementation fn = + last_loc := Lexing.dummy_pos; + if !DeadFlag.verbose then Printf.eprintf "Scanning implementation %s\n%!" fn; + init_and_continue state fn (fun state -> + match state.file_infos.cmt_infos with + | None -> bad_files := fn :: !bad_files + | Some ({cmt_annots = Implementation x; _} as cmt_infos) -> + regabs state; + let uid_decl_dep_to_loc_pair (_dep_kind, uid_def, uid_decl) = + let ( let* ) x f = Option.bind x f in + let loc_opt_of_uid uid = + let* decl = + Uid.Tbl.find_opt cmt_infos.cmt_uid_to_decl uid in - let* def_loc = loc_opt_of_uid uid_def in - let* decl_loc = loc_opt_of_uid uid_decl in - Some (def_loc, decl_loc) - in - let value_dep = - cmt_infos.cmt_declaration_dependencies - |> List.filter_map uid_decl_dep_to_loc_pair - in - let prepare (loc1, loc2) = - DeadObj.add_equal loc1 loc2; - VdNode.merge_locs ~force:true loc2 loc1 - in - List.iter prepare value_dep; - - ignore (collect_references.Tast_mapper.structure collect_references x); - - let loc_dep = - if !DeadFlag.exported.DeadFlag.print then - value_dep - else [] + match decl with + | Value {val_loc = {loc_start; loc_ghost = false; _}; _} -> + Some loc_start + | _ -> None in - eof loc_dep - | _ -> () (* todo: support partial_implementation? *) - ) - + let* def_loc = loc_opt_of_uid uid_def in + let* decl_loc = loc_opt_of_uid uid_decl in + Some (def_loc, decl_loc) + in + let value_dep = + cmt_infos.cmt_declaration_dependencies + |> List.filter_map uid_decl_dep_to_loc_pair + in + let prepare (loc1, loc2) = + DeadObj.add_equal loc1 loc2; + VdNode.merge_locs ~force:true loc2 loc1 + in + List.iter prepare value_dep; + ignore (collect_references.Tast_mapper.structure collect_references x); + let loc_dep = + if !DeadFlag.exported.DeadFlag.print then + value_dep + else [] + in + eof loc_dep + | _ -> () (* todo: support partial_implementation? *) + ) + in + match kind fn with + | `Cmti when !DeadCommon.declarations -> process_interface fn + | `Cmt_with_mli -> process_implementation fn + | `Cmt_without_mli -> + let _state = process_interface fn in + process_implementation fn | `Dir -> let next = Sys.readdir fn in Array.sort (fun f1 f2 -> compare f2 f1) next; @@ -507,7 +510,6 @@ let rec load_file state fn = state next (* else Printf.eprintf "skipping directory %s\n" fn *) - | _ -> state diff --git a/src/state/file_infos.ml b/src/state/file_infos.ml index 9099df5..d4ca778 100644 --- a/src/state/file_infos.ml +++ b/src/state/file_infos.ml @@ -3,8 +3,9 @@ type t = { sourcepath : string option; builddir : string; modname : string; - cmti_infos : Cmt_format.cmt_infos option; + cmi_infos : Cmi_format.cmi_infos option; cmt_infos : Cmt_format.cmt_infos option; + cmti_infos : Cmt_format.cmt_infos option; } let empty = { @@ -12,16 +13,18 @@ let empty = { sourcepath = None; builddir = "!!UNKNOWN_BUILDDIR!!"; modname = "!!UNKNOWN_MODNAME!!"; - cmti_infos = None; + cmi_infos = None; cmt_infos = None; + cmti_infos = None; } -(** [init_from_cmt_infos ~orig ~cm_file cmt_infos] creates a [t] with: +(** [init_from_all_cm_infos ~orig ~cm_file cmi_infos cmt_infos] creates a [t] with: - information from [cmt_infos]; - [cm_file]; - - [cmt_infos = Some cmt_infos] if [orig = `Cmt] - - [cmti_infos = Some cmt_infos] if [orig = `Cmti] *) - let init_from_cmt_infos ~orig ~cm_file cmt_infos = + - [cmi_infos]; + - [cmt_infos = Some cmt_infos] if [orig = `Cmt]; + - [cmti_infos = Some cmt_infos] if [orig = `Cmti]. *) + let init_from_all_cm_infos ~orig ~cm_file cmi_infos cmt_infos = let builddir = cmt_infos.Cmt_format.cmt_builddir in let sourcepath = Option.map (Filename.concat builddir) cmt_infos.cmt_sourcefile @@ -32,7 +35,7 @@ let empty = { | `Cmt -> Some cmt_infos, None | `Cmti -> None, Some cmt_infos in - {cm_file; sourcepath; builddir; modname; cmt_infos; cmti_infos} + {cm_file; sourcepath; builddir; modname; cmi_infos; cmt_infos; cmti_infos} (** [init_from_cm_file ~orig cm_file] returns an [Ok t] with [t] filled using the [cm_file] (see [init_from_cmt_infos]). @@ -42,17 +45,12 @@ let empty = { let init_from_cm_file ~orig cm_file = if not (Sys.file_exists cm_file) then Result.error (cm_file ^ ": file not found") else - try - let cmt_infos = Cmt_format.read_cmt cm_file in - init_from_cmt_infos ~orig ~cm_file cmt_infos - |> Result.ok - with _ -> - let ext = - match orig with - | `Cmt -> ".cmt" - | `Cmti -> ".cmti" - in - Result.error (Printf.sprintf "%s: cannot read %s file" cm_file ext) + match Cmt_format.read cm_file with + | exception _ -> Result.error (cm_file ^ ": error reading file") + | _, None -> Result.error (cm_file ^ ": cmt_infos not found") + | cmi_infos, Some cmt_infos -> + init_from_all_cm_infos ~orig ~cm_file cmi_infos cmt_infos + |> Result.ok let init cm_file = let ( let* ) x f = Result.bind x f in @@ -63,35 +61,39 @@ let init cm_file = | _ -> Result.error (cm_file ^ ": not a .cmti or .cmt file") in let* file_infos = init_from_cm_file ~orig cm_file in - let cmt_infos, cmti_infos = + let cmi_infos, cmt_infos, cmti_infos = let no_ext = Filename.remove_extension cm_file in match orig with | `Cmt -> - let cmti_infos = + let cmi_infos, cmti_infos = init_from_cm_file ~orig:`Cmti (no_ext ^ ".cmti") - |> Result.map (fun {cmti_infos; _} -> cmti_infos) - |> Result.value ~default:file_infos.cmti_infos + |> Result.map (fun {cmi_infos; cmti_infos; _} -> cmi_infos, cmti_infos) + |> Result.value ~default:(file_infos.cmi_infos, file_infos.cmti_infos) in - file_infos.cmt_infos, cmti_infos + cmi_infos, file_infos.cmt_infos, cmti_infos | `Cmti -> let cmt_infos = init_from_cm_file ~orig:`Cmt (no_ext ^ ".cmt") |> Result.map (fun {cmt_infos; _} -> cmt_infos) |> Result.value ~default:file_infos.cmt_infos in - cmt_infos, file_infos.cmti_infos + file_infos.cmi_infos, cmt_infos, file_infos.cmti_infos in - Result.ok {file_infos with cmt_infos; cmti_infos} + Result.ok {file_infos with cmi_infos; cmt_infos; cmti_infos} let change_file file_infos cm_file = let no_ext = Filename.remove_extension cm_file in assert(no_ext = Filename.remove_extension file_infos.cm_file); match Filename.extension cm_file, file_infos with - | ".cmt", {cmt_infos=Some cmt_infos; cmti_infos; _} -> - let res = init_from_cmt_infos ~orig:`Cmt ~cm_file cmt_infos in - Result.ok {res with cmti_infos} - | ".cmti", {cmti_infos=Some cmti_infos; cmt_infos; _} -> - let res = init_from_cmt_infos ~orig:`Cmti ~cm_file cmti_infos in + | ".cmt", {cmt_infos=Some cmt_infos; cmi_infos; cmti_infos; _} -> + let res = + init_from_all_cm_infos ~orig:`Cmt ~cm_file cmi_infos cmt_infos + in + Result.ok {res with cmi_infos; cmti_infos} + | ".cmti", {cmti_infos=Some cmti_infos; cmi_infos; cmt_infos; _} -> + let res = + init_from_all_cm_infos ~orig:`Cmti ~cm_file cmi_infos cmti_infos + in Result.ok {res with cmt_infos} | _ -> (* corresponding info is None or invlaid extension *) init cm_file diff --git a/src/state/file_infos.mli b/src/state/file_infos.mli index bf782ce..2807c9e 100644 --- a/src/state/file_infos.mli +++ b/src/state/file_infos.mli @@ -5,8 +5,9 @@ type t = { sourcepath : string option; (** The path to the associated source file *) builddir : string; (** The [cmt_builddir] *) modname : string; (** Either [cmti_name] or [cmt_modname] *) - cmti_infos : Cmt_format.cmt_infos option; + cmi_infos : Cmi_format.cmi_infos option; cmt_infos : Cmt_format.cmt_infos option; + cmti_infos : Cmt_format.cmt_infos option; } val empty : t (** No file info *) From 306b299474c6613ad9dc5ed8d6fa24062ee5a25d Mon Sep 17 00:00:00 2001 From: Corentin De Souza <9597216+fantazio@users.noreply.github.com> Date: Mon, 8 Dec 2025 19:12:40 +0100 Subject: [PATCH 5/8] [src][input][3/n] store uid's loc for values Using information available in the `.cmt`, store locations of uids coming from `include`s in a new state field : `state.signature.uid_to_loc`. Using `.cmt` and `.cmti`, store locations of values' (and patterns in value bindings) uids at the same location for easier lookup. This is done as soon as the files are loaded, before the analysis. The new table tries to be semantically equivalent to the usage of `cmt_value_dependencies` instead of `cmt_declaration_dependencies` before OCaml 5.3. This fixes the FP and FN introduced when moving to OCaml 5.3. --- check/classic/classic.ref | 56 ++- check/internal/internal.ref | 112 ++---- check/threshold-1/threshold-1.ref | 264 +++++-------- check/threshold-3-0.5/threshold-3-0.5.ref | 432 +++++++++------------- src/deadCode.ml | 10 +- src/state/file_infos.ml | 16 +- src/state/signature.ml | 69 ++++ src/state/signature.mli | 15 + src/state/state.ml | 18 +- src/state/state.mli | 2 + 10 files changed, 428 insertions(+), 566 deletions(-) create mode 100644 src/state/signature.ml create mode 100644 src/state/signature.mli diff --git a/check/classic/classic.ref b/check/classic/classic.ref index 49fb144..bc6999b 100644 --- a/check/classic/classic.ref +++ b/check/classic/classic.ref @@ -46,8 +46,7 @@ ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y -./examples/using_make/advanced/val.mli:1: x: Should not be detected -./examples/using_make/advanced/val.mli:2: y: Should not be detected + ./examples/using_make/bar.ml:1: x ./examples/using_make/bar_fn.ml:3: h ./examples/using_make/baz.mli:1: z @@ -106,7 +105,7 @@ Nothing else to report in this section .> UNUSED METHODS: ================= -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused @@ -116,14 +115,15 @@ Nothing else to report in this section ./examples/using_dune/unwrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int + ./examples/using_dune/wrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -131,14 +131,15 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int + ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f @@ -241,9 +242,6 @@ Nothing else to report in this section .> OPTIONAL ARGUMENTS: ALWAYS: ============================= ./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?always -./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?internally: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?always: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?externally: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: ?always ./examples/using_dune/unwrapped_lib/opt_args/mixed_args.ml:1: ?always @@ -367,8 +365,6 @@ Nothing else to report in this section ./examples/using_make/if_end.ml:5: ?b ./examples/using_make/letIn.mli:1: ?a ./examples/using_make/let_in.ml:1: ?a -./examples/using_make/opt/sig_struct.ml:6: ?x: Should not be detected -./examples/using_make/opt/sig_struct.ml:11: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:1: ?a ./examples/using_make/opt_in_opt.ml:5: ?a ./examples/using_make/partial_opt.ml:1: ?a @@ -382,11 +378,8 @@ Nothing else to report in this section .> OPTIONAL ARGUMENTS: NEVER: ============================ -./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?externally: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?never ./examples/using_dune/preprocessed_lib/preprocessed.ml:65: ?opt -./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?internally: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?never: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: ?never ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:65: ?opt @@ -483,7 +476,6 @@ Nothing else to report in this section ./examples/using_make/foo.ml:1: ?a ./examples/using_make/letIn.mli:1: ?b ./examples/using_make/let_in.ml:1: ?c -./examples/using_make/opt/sig_struct.ml:2: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:2: ?a ./examples/using_make/opt_in_opt.ml:2: ?b ./examples/using_make/record.ml:12: ?b @@ -541,7 +533,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 471 -Success: 440 -Failed: 31 -Ratio: 93.4182590234% +Total: 460 +Success: 457 +Failed: 3 +Ratio: 99.347826087% diff --git a/check/internal/internal.ref b/check/internal/internal.ref index 554f0f2..34c097b 100644 --- a/check/internal/internal.ref +++ b/check/internal/internal.ref @@ -5,21 +5,12 @@ ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected + ./examples/using_dune/unwrapped_lib/values/values.mli:2: unused_int -./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values.mli:20: unused_alias_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure: Not detected -./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:20: unused_alias_fun: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun +./examples/using_dune/unwrapped_lib/values/values.mli:20: unused_alias_fun +./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int -./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun @@ -27,21 +18,12 @@ ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected + ./examples/using_dune/wrapped_lib/values/values.mli:2: unused_int -./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun: Not detected -./examples/using_dune/wrapped_lib/values/values.mli:20: unused_alias_fun: Not detected -./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure: Not detected -./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:20: unused_alias_fun: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun +./examples/using_dune/wrapped_lib/values/values.mli:20: unused_alias_fun +./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int -./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun @@ -50,8 +32,7 @@ ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y -./examples/using_make/advanced/val.mli:1: x: Should not be detected -./examples/using_make/advanced/val.mli:2: y: Should not be detected + ./examples/using_make/bar.ml:1: x ./examples/using_make/bar_fn.ml:3: h ./examples/using_make/baz.mli:1: z @@ -68,48 +49,32 @@ ./examples/using_make/dir/anon_call2.ml:9: h ./examples/using_make/dir/match_opt.ml:8: l ./examples/using_make/dir/matchopt.ml:5: w -./examples/using_make/dir/mod.mli:10: M.f: Should not be detected ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x ./examples/using_make/dir/ref_opt.ml:3: no ./examples/using_make/dir/ref_opt.ml:11: x -./examples/using_make/exported.mli:11: F.times_five: Not detected -./examples/using_make/exported.mli:17: M2.ten: Not detected -./examples/using_make/exported.mli:6: M1.five: Should not be detected -./examples/using_make/exported.mli:10: F.plus_five: Should not be detected -./examples/using_make/exported.mli:11: F.times_five: Should not be detected -./examples/using_make/exported.mli:15: M2.five: Should not be detected -./examples/using_make/exported.mli:16: M2.plus_five: Should not be detected -./examples/using_make/exported.mli:17: M2.ten: Should not be detected +./examples/using_make/exported.mli:11: F.times_five +./examples/using_make/exported.mli:17: M2.ten ./examples/using_make/foo.mli:2: y ./examples/using_make/fooFn.mli:2: g -./examples/using_make/functor.mli:2: M.f: Should not be detected ./examples/using_make/functor.mli:3: M.none -./examples/using_make/functor.mli:7: F.g: Should not be detected -./examples/using_make/functor.mli:11: N.g: Should not be detected ./examples/using_make/let_in.ml:3: parent ./examples/using_make/let_test.ml:3: g ./examples/using_make/matchopt.ml:5: w -./examples/using_make/mod_alias.mli:2: M1.id: Should not be detected -./examples/using_make/mod_alias.mli:6: M2.id: Should not be detected -./examples/using_make/obj/class.mli:7: o: Should not be detected -./examples/using_make/obj/class.mli:9: f: Should not be detected -./examples/using_make/obj/inher.mli:11: o: Should not be detected -./examples/using_make/obj/inher.mli:13: f: Should not be detected ./examples/using_make/opt_in_opt.ml:7: x ./examples/using_make/qux.ml:1: z ./examples/using_make/unused_fn.ml:3: g ./examples/using_make/unused_fn.ml:5: var ./examples/using_make/useless_opt.ml:3: x -./examples/using_make/variant.mli:5: f: Should not be detected + Nothing else to report in this section -------------------------------------------------------------------------------- .> UNUSED METHODS: ================= -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused @@ -119,14 +84,15 @@ Nothing else to report in this section ./examples/using_dune/unwrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int + ./examples/using_dune/wrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -134,14 +100,15 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int + ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f @@ -244,9 +211,6 @@ Nothing else to report in this section .> OPTIONAL ARGUMENTS: ALWAYS: ============================= ./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?always -./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?internally: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?always: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?externally: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: ?always ./examples/using_dune/unwrapped_lib/opt_args/mixed_args.ml:1: ?always @@ -370,8 +334,6 @@ Nothing else to report in this section ./examples/using_make/if_end.ml:5: ?b ./examples/using_make/letIn.mli:1: ?a ./examples/using_make/let_in.ml:1: ?a -./examples/using_make/opt/sig_struct.ml:6: ?x: Should not be detected -./examples/using_make/opt/sig_struct.ml:11: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:1: ?a ./examples/using_make/opt_in_opt.ml:5: ?a ./examples/using_make/partial_opt.ml:1: ?a @@ -385,11 +347,8 @@ Nothing else to report in this section .> OPTIONAL ARGUMENTS: NEVER: ============================ -./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?externally: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?never ./examples/using_dune/preprocessed_lib/preprocessed.ml:65: ?opt -./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?internally: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?never: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: ?never ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:65: ?opt @@ -486,7 +445,6 @@ Nothing else to report in this section ./examples/using_make/foo.ml:1: ?a ./examples/using_make/letIn.mli:1: ?b ./examples/using_make/let_in.ml:1: ?c -./examples/using_make/opt/sig_struct.ml:2: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:2: ?a ./examples/using_make/opt_in_opt.ml:2: ?b ./examples/using_make/record.ml:12: ?b @@ -544,7 +502,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 479 -Success: 402 -Failed: 77 -Ratio: 83.9248434238% +Total: 431 +Success: 427 +Failed: 4 +Ratio: 99.0719257541% diff --git a/check/threshold-1/threshold-1.ref b/check/threshold-1/threshold-1.ref index 4942959..da07c7d 100644 --- a/check/threshold-1/threshold-1.ref +++ b/check/threshold-1/threshold-1.ref @@ -5,21 +5,12 @@ ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected + ./examples/using_dune/unwrapped_lib/values/values.mli:2: unused_int -./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values.mli:20: unused_alias_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure: Not detected -./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:20: unused_alias_fun: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun +./examples/using_dune/unwrapped_lib/values/values.mli:20: unused_alias_fun +./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int -./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun @@ -27,21 +18,12 @@ ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected + ./examples/using_dune/wrapped_lib/values/values.mli:2: unused_int -./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun: Not detected -./examples/using_dune/wrapped_lib/values/values.mli:20: unused_alias_fun: Not detected -./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure: Not detected -./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:20: unused_alias_fun: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun +./examples/using_dune/wrapped_lib/values/values.mli:20: unused_alias_fun +./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int -./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun @@ -50,8 +32,7 @@ ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y -./examples/using_make/advanced/val.mli:1: x: Should not be detected -./examples/using_make/advanced/val.mli:2: y: Should not be detected + ./examples/using_make/bar.ml:1: x ./examples/using_make/bar_fn.ml:3: h ./examples/using_make/baz.mli:1: z @@ -68,41 +49,24 @@ ./examples/using_make/dir/anon_call2.ml:9: h ./examples/using_make/dir/match_opt.ml:8: l ./examples/using_make/dir/matchopt.ml:5: w -./examples/using_make/dir/mod.mli:10: M.f: Should not be detected ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x ./examples/using_make/dir/ref_opt.ml:3: no ./examples/using_make/dir/ref_opt.ml:11: x -./examples/using_make/exported.mli:11: F.times_five: Not detected -./examples/using_make/exported.mli:17: M2.ten: Not detected -./examples/using_make/exported.mli:6: M1.five: Should not be detected -./examples/using_make/exported.mli:10: F.plus_five: Should not be detected -./examples/using_make/exported.mli:11: F.times_five: Should not be detected -./examples/using_make/exported.mli:15: M2.five: Should not be detected -./examples/using_make/exported.mli:16: M2.plus_five: Should not be detected -./examples/using_make/exported.mli:17: M2.ten: Should not be detected +./examples/using_make/exported.mli:11: F.times_five +./examples/using_make/exported.mli:17: M2.ten ./examples/using_make/foo.mli:2: y ./examples/using_make/fooFn.mli:2: g -./examples/using_make/functor.mli:2: M.f: Should not be detected ./examples/using_make/functor.mli:3: M.none -./examples/using_make/functor.mli:7: F.g: Should not be detected -./examples/using_make/functor.mli:11: N.g: Should not be detected ./examples/using_make/let_in.ml:3: parent ./examples/using_make/let_test.ml:3: g ./examples/using_make/matchopt.ml:5: w -./examples/using_make/mod_alias.mli:2: M1.id: Should not be detected -./examples/using_make/mod_alias.mli:6: M2.id: Should not be detected -./examples/using_make/obj/class.mli:7: o: Should not be detected -./examples/using_make/obj/class.mli:9: f: Should not be detected -./examples/using_make/obj/inher.mli:11: o: Should not be detected -./examples/using_make/obj/inher.mli:13: f: Should not be detected ./examples/using_make/opt_in_opt.ml:7: x ./examples/using_make/qux.ml:1: z ./examples/using_make/unused_fn.ml:3: g ./examples/using_make/unused_fn.ml:5: var ./examples/using_make/useless_opt.ml:3: x -./examples/using_make/variant.mli:5: f: Should not be detected -------- @@ -147,48 +111,27 @@ ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:4: internally_used ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:5: externally_used -./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg + ./examples/using_dune/unwrapped_lib/style/style.ml:1: all -./examples/using_dune/unwrapped_lib/values/values.mli:1: used_int: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int ./examples/using_dune/unwrapped_lib/values/values.mli:4: externally_used_int ./examples/using_dune/unwrapped_lib/values/values.mli:5: externally_used_as_parameter_int ./examples/using_dune/unwrapped_lib/values/values.mli:7: externally_written_bool_ref ./examples/using_dune/unwrapped_lib/values/values.mli:8: externally_matched_option ./examples/using_dune/unwrapped_lib/values/values.mli:10: externally_stored_in_ref_bool ./examples/using_dune/unwrapped_lib/values/values.mli:11: externally_stored_in_option_bool -./examples/using_dune/unwrapped_lib/values/values.mli:13: used_fun: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun ./examples/using_dune/unwrapped_lib/values/values.mli:16: externally_used_fun ./examples/using_dune/unwrapped_lib/values/values.mli:17: externally_used_as_parameter_fun -./examples/using_dune/unwrapped_lib/values/values.mli:19: used_alias_fun: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:21: externally_used_alias_fun -./examples/using_dune/unwrapped_lib/values/values.mli:23: partially_used_fun: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:24: used_closure: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure ./examples/using_dune/unwrapped_lib/values/values.mli:27: externally_used_closure -./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected -./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int @@ -206,48 +149,27 @@ ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:27: internally_used_closure ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:28: externally_used_closure -./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg + ./examples/using_dune/wrapped_lib/style/style.ml:1: all -./examples/using_dune/wrapped_lib/values/values.mli:1: used_int: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int ./examples/using_dune/wrapped_lib/values/values.mli:4: externally_used_int ./examples/using_dune/wrapped_lib/values/values.mli:5: externally_used_as_parameter_int ./examples/using_dune/wrapped_lib/values/values.mli:7: externally_written_bool_ref ./examples/using_dune/wrapped_lib/values/values.mli:8: externally_matched_option ./examples/using_dune/wrapped_lib/values/values.mli:10: externally_stored_in_ref_bool ./examples/using_dune/wrapped_lib/values/values.mli:11: externally_stored_in_option_bool -./examples/using_dune/wrapped_lib/values/values.mli:13: used_fun: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun ./examples/using_dune/wrapped_lib/values/values.mli:16: externally_used_fun ./examples/using_dune/wrapped_lib/values/values.mli:17: externally_used_as_parameter_fun -./examples/using_dune/wrapped_lib/values/values.mli:19: used_alias_fun: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:21: externally_used_alias_fun -./examples/using_dune/wrapped_lib/values/values.mli:23: partially_used_fun: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:24: used_closure: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure ./examples/using_dune/wrapped_lib/values/values.mli:27: externally_used_closure -./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected -./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected +./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int @@ -268,8 +190,9 @@ ./examples/using_make/advanced/incl.ml:7: f ./examples/using_make/advanced/mod.mli:1: f ./examples/using_make/advanced/mod.mli:2: x -./examples/using_make/advanced/val.mli:1: x: Not detected -./examples/using_make/advanced/val.mli:2: y: Not detected +./examples/using_make/advanced/val.mli:1: x +./examples/using_make/advanced/val.mli:2: y + ./examples/using_make/baz.mli:2: t ./examples/using_make/cond_sel.ml:9: f ./examples/using_make/cond_sel.ml:11: g @@ -284,24 +207,25 @@ ./examples/using_make/dir/hidden_opt_use.ml:1: f ./examples/using_make/dir/hidden_opt_use.ml:3: apply ./examples/using_make/dir/match_opt.ml:3: m -./examples/using_make/dir/mod.mli:10: M.f: Not detected +./examples/using_make/dir/mod.mli:10: M.f ./examples/using_make/dir/partial.ml:5: g ./examples/using_make/dir/ref_fn.ml:5: g ./examples/using_make/dir/ref_opt.ml:7: g ./examples/using_make/foo.mli:1: x ./examples/using_make/fooFn.mli:1: f -./examples/using_make/functor.mli:2: M.f: Not detected +./examples/using_make/functor.mli:2: M.f ./examples/using_make/if_end.ml:1: f ./examples/using_make/if_end.ml:3: g ./examples/using_make/if_end.ml:5: h ./examples/using_make/letIn.mli:1: f -./examples/using_make/mod_alias.mli:2: M1.id: Not detected -./examples/using_make/mod_alias.mli:6: M2.id: Not detected -./examples/using_make/obj/class.mli:9: f: Not detected +./examples/using_make/mod_alias.mli:2: M1.id +./examples/using_make/mod_alias.mli:6: M2.id + +./examples/using_make/obj/class.mli:9: f ./examples/using_make/obj/fun_class.ml:8: f ./examples/using_make/obj/fun_obj_param.ml:7: app_m -./examples/using_make/obj/inher.mli:13: f: Not detected +./examples/using_make/obj/inher.mli:13: f ./examples/using_make/obj/obj_inher.ml:7: o ./examples/using_make/obj/obj_inher.ml:12: o4 ./examples/using_make/obj/obj_inher.ml:17: o2 @@ -312,14 +236,15 @@ ./examples/using_make/opt_in_opt.ml:5: baz ./examples/using_make/partial_opt.ml:1: f ./examples/using_make/useless_opt.ml:1: foo -./examples/using_make/variant.mli:5: f: Not detected +./examples/using_make/variant.mli:5: f + Nothing else to report in this section -------------------------------------------------------------------------------- .> UNUSED METHODS: ================= -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused @@ -329,14 +254,15 @@ Nothing else to report in this section ./examples/using_dune/unwrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int + ./examples/using_dune/wrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -344,14 +270,15 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int + ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f @@ -377,39 +304,41 @@ Nothing else to report in this section .>-> ALMOST UNUSED METHODS: Called 1 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#externally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#internally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#externally_used +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#internally_used ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#externally_used ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#internally_used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#used -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int + ./examples/using_dune/wrapped_lib/obj/with_class.mli:35: _self_used#used ./examples/using_dune/wrapped_lib/obj/with_class.mli:41: _self_used_fun_class#used -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int + ./examples/using_make/advanced/func.mli:3: M.c#f ./examples/using_make/advanced/mod.mli:4: p#f @@ -595,9 +524,6 @@ Nothing else to report in this section .> OPTIONAL ARGUMENTS: ALWAYS: ============================= ./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?always -./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?internally: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?always: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?externally: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: ?always ./examples/using_dune/unwrapped_lib/opt_args/mixed_args.ml:1: ?always @@ -721,8 +647,6 @@ Nothing else to report in this section ./examples/using_make/if_end.ml:5: ?b ./examples/using_make/letIn.mli:1: ?a ./examples/using_make/let_in.ml:1: ?a -./examples/using_make/opt/sig_struct.ml:6: ?x: Should not be detected -./examples/using_make/opt/sig_struct.ml:11: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:1: ?a ./examples/using_make/opt_in_opt.ml:5: ?a ./examples/using_make/partial_opt.ml:1: ?a @@ -736,11 +660,8 @@ Nothing else to report in this section .> OPTIONAL ARGUMENTS: NEVER: ============================ -./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?externally: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?never ./examples/using_dune/preprocessed_lib/preprocessed.ml:65: ?opt -./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?internally: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?never: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: ?never ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:65: ?opt @@ -837,7 +758,6 @@ Nothing else to report in this section ./examples/using_make/foo.ml:1: ?a ./examples/using_make/letIn.mli:1: ?b ./examples/using_make/let_in.ml:1: ?c -./examples/using_make/opt/sig_struct.ml:2: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:2: ?a ./examples/using_make/opt_in_opt.ml:2: ?b ./examples/using_make/record.ml:12: ?b @@ -895,7 +815,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 799 -Success: 617 -Failed: 182 -Ratio: 77.2215269086% +Total: 707 +Success: 693 +Failed: 14 +Ratio: 98.0198019802% diff --git a/check/threshold-3-0.5/threshold-3-0.5.ref b/check/threshold-3-0.5/threshold-3-0.5.ref index 3902208..fcc40be 100644 --- a/check/threshold-3-0.5/threshold-3-0.5.ref +++ b/check/threshold-3-0.5/threshold-3-0.5.ref @@ -5,21 +5,12 @@ ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected + ./examples/using_dune/unwrapped_lib/values/values.mli:2: unused_int -./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values.mli:20: unused_alias_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure: Not detected -./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:20: unused_alias_fun: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected +./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun +./examples/using_dune/unwrapped_lib/values/values.mli:20: unused_alias_fun +./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int -./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:2: unused_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:13: unused_fun @@ -27,21 +18,12 @@ ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:25: unused_closure ./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected + ./examples/using_dune/wrapped_lib/values/values.mli:2: unused_int -./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun: Not detected -./examples/using_dune/wrapped_lib/values/values.mli:20: unused_alias_fun: Not detected -./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure: Not detected -./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:20: unused_alias_fun: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Should not be detected +./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun +./examples/using_dune/wrapped_lib/values/values.mli:20: unused_alias_fun +./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:3: Exported.unused_int -./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:3: Exported.unused_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:2: unused_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:13: unused_fun @@ -50,8 +32,7 @@ ./examples/using_make/advanced/inc_val.mli:1: x ./examples/using_make/advanced/inc_val.mli:2: y -./examples/using_make/advanced/val.mli:1: x: Should not be detected -./examples/using_make/advanced/val.mli:2: y: Should not be detected + ./examples/using_make/bar.ml:1: x ./examples/using_make/bar_fn.ml:3: h ./examples/using_make/baz.mli:1: z @@ -68,41 +49,24 @@ ./examples/using_make/dir/anon_call2.ml:9: h ./examples/using_make/dir/match_opt.ml:8: l ./examples/using_make/dir/matchopt.ml:5: w -./examples/using_make/dir/mod.mli:10: M.f: Should not be detected ./examples/using_make/dir/mod.mli:11: M.g ./examples/using_make/dir/refFn.mli:3: x ./examples/using_make/dir/ref_opt.ml:3: no ./examples/using_make/dir/ref_opt.ml:11: x -./examples/using_make/exported.mli:11: F.times_five: Not detected -./examples/using_make/exported.mli:17: M2.ten: Not detected -./examples/using_make/exported.mli:6: M1.five: Should not be detected -./examples/using_make/exported.mli:10: F.plus_five: Should not be detected -./examples/using_make/exported.mli:11: F.times_five: Should not be detected -./examples/using_make/exported.mli:15: M2.five: Should not be detected -./examples/using_make/exported.mli:16: M2.plus_five: Should not be detected -./examples/using_make/exported.mli:17: M2.ten: Should not be detected +./examples/using_make/exported.mli:11: F.times_five +./examples/using_make/exported.mli:17: M2.ten ./examples/using_make/foo.mli:2: y ./examples/using_make/fooFn.mli:2: g -./examples/using_make/functor.mli:2: M.f: Should not be detected ./examples/using_make/functor.mli:3: M.none -./examples/using_make/functor.mli:7: F.g: Should not be detected -./examples/using_make/functor.mli:11: N.g: Should not be detected ./examples/using_make/let_in.ml:3: parent ./examples/using_make/let_test.ml:3: g ./examples/using_make/matchopt.ml:5: w -./examples/using_make/mod_alias.mli:2: M1.id: Should not be detected -./examples/using_make/mod_alias.mli:6: M2.id: Should not be detected -./examples/using_make/obj/class.mli:7: o: Should not be detected -./examples/using_make/obj/class.mli:9: f: Should not be detected -./examples/using_make/obj/inher.mli:11: o: Should not be detected -./examples/using_make/obj/inher.mli:13: f: Should not be detected ./examples/using_make/opt_in_opt.ml:7: x ./examples/using_make/qux.ml:1: z ./examples/using_make/unused_fn.ml:3: g ./examples/using_make/unused_fn.ml:5: var ./examples/using_make/useless_opt.ml:3: x -./examples/using_make/variant.mli:5: f: Should not be detected -------- @@ -147,48 +111,27 @@ ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:4: internally_used ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:5: externally_used -./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg + ./examples/using_dune/unwrapped_lib/style/style.ml:1: all -./examples/using_dune/unwrapped_lib/values/values.mli:1: used_int: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:3: internally_used_int ./examples/using_dune/unwrapped_lib/values/values.mli:4: externally_used_int ./examples/using_dune/unwrapped_lib/values/values.mli:5: externally_used_as_parameter_int ./examples/using_dune/unwrapped_lib/values/values.mli:7: externally_written_bool_ref ./examples/using_dune/unwrapped_lib/values/values.mli:8: externally_matched_option ./examples/using_dune/unwrapped_lib/values/values.mli:10: externally_stored_in_ref_bool ./examples/using_dune/unwrapped_lib/values/values.mli:11: externally_stored_in_option_bool -./examples/using_dune/unwrapped_lib/values/values.mli:13: used_fun: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:15: internally_used_fun ./examples/using_dune/unwrapped_lib/values/values.mli:16: externally_used_fun ./examples/using_dune/unwrapped_lib/values/values.mli:17: externally_used_as_parameter_fun -./examples/using_dune/unwrapped_lib/values/values.mli:19: used_alias_fun: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:21: externally_used_alias_fun -./examples/using_dune/unwrapped_lib/values/values.mli:23: partially_used_fun: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:24: used_closure: Should not be detected -./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure: Not detected +./examples/using_dune/unwrapped_lib/values/values.mli:26: internally_used_closure ./examples/using_dune/unwrapped_lib/values/values.mli:27: externally_used_closure -./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected -./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected +./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int @@ -206,48 +149,27 @@ ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:27: internally_used_closure ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:28: externally_used_closure -./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Should not be detected +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:8: internally_used_fun_with_single_never_used_opt_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:10: internally_used_fun_with_single_always_used_opt_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:14: externally_used_fun_with_single_never_used_opt_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:16: externally_used_fun_with_single_always_used_opt_arg + ./examples/using_dune/wrapped_lib/style/style.ml:1: all -./examples/using_dune/wrapped_lib/values/values.mli:1: used_int: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:3: internally_used_int ./examples/using_dune/wrapped_lib/values/values.mli:4: externally_used_int ./examples/using_dune/wrapped_lib/values/values.mli:5: externally_used_as_parameter_int ./examples/using_dune/wrapped_lib/values/values.mli:7: externally_written_bool_ref ./examples/using_dune/wrapped_lib/values/values.mli:8: externally_matched_option ./examples/using_dune/wrapped_lib/values/values.mli:10: externally_stored_in_ref_bool ./examples/using_dune/wrapped_lib/values/values.mli:11: externally_stored_in_option_bool -./examples/using_dune/wrapped_lib/values/values.mli:13: used_fun: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:15: internally_used_fun ./examples/using_dune/wrapped_lib/values/values.mli:16: externally_used_fun ./examples/using_dune/wrapped_lib/values/values.mli:17: externally_used_as_parameter_fun -./examples/using_dune/wrapped_lib/values/values.mli:19: used_alias_fun: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:21: externally_used_alias_fun -./examples/using_dune/wrapped_lib/values/values.mli:23: partially_used_fun: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:24: used_closure: Should not be detected -./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure: Not detected +./examples/using_dune/wrapped_lib/values/values.mli:26: internally_used_closure ./examples/using_dune/wrapped_lib/values/values.mli:27: externally_used_closure -./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Should not be detected -./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int: Not detected +./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:4: Exported.internally_used_int ./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:5: Exported.externally_used_int ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:4: Exported.internally_used_int ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:5: Exported.externally_used_int @@ -268,8 +190,9 @@ ./examples/using_make/advanced/incl.ml:7: f ./examples/using_make/advanced/mod.mli:1: f ./examples/using_make/advanced/mod.mli:2: x -./examples/using_make/advanced/val.mli:1: x: Not detected -./examples/using_make/advanced/val.mli:2: y: Not detected +./examples/using_make/advanced/val.mli:1: x +./examples/using_make/advanced/val.mli:2: y + ./examples/using_make/baz.mli:2: t ./examples/using_make/cond_sel.ml:9: f ./examples/using_make/cond_sel.ml:11: g @@ -284,24 +207,25 @@ ./examples/using_make/dir/hidden_opt_use.ml:1: f ./examples/using_make/dir/hidden_opt_use.ml:3: apply ./examples/using_make/dir/match_opt.ml:3: m -./examples/using_make/dir/mod.mli:10: M.f: Not detected +./examples/using_make/dir/mod.mli:10: M.f ./examples/using_make/dir/partial.ml:5: g ./examples/using_make/dir/ref_fn.ml:5: g ./examples/using_make/dir/ref_opt.ml:7: g ./examples/using_make/foo.mli:1: x ./examples/using_make/fooFn.mli:1: f -./examples/using_make/functor.mli:2: M.f: Not detected +./examples/using_make/functor.mli:2: M.f ./examples/using_make/if_end.ml:1: f ./examples/using_make/if_end.ml:3: g ./examples/using_make/if_end.ml:5: h ./examples/using_make/letIn.mli:1: f -./examples/using_make/mod_alias.mli:2: M1.id: Not detected -./examples/using_make/mod_alias.mli:6: M2.id: Not detected -./examples/using_make/obj/class.mli:9: f: Not detected +./examples/using_make/mod_alias.mli:2: M1.id +./examples/using_make/mod_alias.mli:6: M2.id + +./examples/using_make/obj/class.mli:9: f ./examples/using_make/obj/fun_class.ml:8: f ./examples/using_make/obj/fun_obj_param.ml:7: app_m -./examples/using_make/obj/inher.mli:13: f: Not detected +./examples/using_make/obj/inher.mli:13: f ./examples/using_make/obj/obj_inher.ml:7: o ./examples/using_make/obj/obj_inher.ml:12: o4 ./examples/using_make/obj/obj_inher.ml:17: o2 @@ -312,7 +236,7 @@ ./examples/using_make/opt_in_opt.ml:5: baz ./examples/using_make/partial_opt.ml:1: f ./examples/using_make/useless_opt.ml:1: foo -./examples/using_make/variant.mli:5: f: Not detected +./examples/using_make/variant.mli:5: f -------- @@ -324,80 +248,58 @@ ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:3: used ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: f -./examples/using_dune/unwrapped_lib/obj/with_class.mli:21: basics_factory: Should not be detected -./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory: Not detected -./examples/using_dune/unwrapped_lib/opt_args/mixed_args.mli:1: interlaced_mandatory_and_opt: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/mixed_args.mli:3: interlaced_labeled_and_opt: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/mixed_args.mli:7: interlaced_mandatory_labeled_and_opt: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:18: externally_used_fun_with_single_sometimes_used_opt_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:6: used_fun_with_single_sometimes_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:18: externally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:26: multiple_nas_used_opt_args: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:28: multiple_ans_used_opt_args: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:30: multiple_sna_used_opt_args: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:32: multiple_san_used_opt_args: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:34: multiple_nsa_used_opt_args: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:36: multiple_asn_used_opt_args: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:5: partially_applied_with_sometimes_used_opt_arg: Should not be detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Not detected -./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Not detected -./examples/using_dune/unwrapped_lib/values/values.mli:1: used_int: Not detected -./examples/using_dune/unwrapped_lib/values/values.mli:13: used_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values.mli:19: used_alias_fun: Not detected -./examples/using_dune/unwrapped_lib/values/values.mli:24: used_closure: Not detected -./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory + +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:18: externally_used_fun_with_single_sometimes_used_opt_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args +./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig +./examples/using_dune/unwrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig + +./examples/using_dune/unwrapped_lib/values/values.mli:1: used_int +./examples/using_dune/unwrapped_lib/values/values.mli:13: used_fun +./examples/using_dune/unwrapped_lib/values/values.mli:19: used_alias_fun +./examples/using_dune/unwrapped_lib/values/values.mli:24: used_closure +./examples/using_dune/unwrapped_lib/values/values_in_submodules.mli:2: Exported.used_int ./examples/using_dune/unwrapped_lib/values/values_in_submodules_no_intf.ml:2: Exported.used_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:1: used_int ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:14: used_fun ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:21: used_alias_fun ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:26: used_closure -./examples/using_dune/wrapped_lib/obj/with_class.mli:21: basics_factory: Should not be detected -./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory: Not detected -./examples/using_dune/wrapped_lib/opt_args/mixed_args.mli:1: interlaced_mandatory_and_opt: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/mixed_args.mli:3: interlaced_labeled_and_opt: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/mixed_args.mli:7: interlaced_mandatory_labeled_and_opt: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:18: externally_used_fun_with_single_sometimes_used_opt_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:6: used_fun_with_single_sometimes_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:18: externally_used_fun_with_single_sometimes_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:26: multiple_nas_used_opt_args: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:28: multiple_ans_used_opt_args: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:30: multiple_sna_used_opt_args: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:32: multiple_san_used_opt_args: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:34: multiple_nsa_used_opt_args: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:36: multiple_asn_used_opt_args: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:5: partially_applied_with_sometimes_used_opt_arg: Should not be detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig: Not detected -./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig: Not detected -./examples/using_dune/wrapped_lib/values/values.mli:1: used_int: Not detected -./examples/using_dune/wrapped_lib/values/values.mli:13: used_fun: Not detected -./examples/using_dune/wrapped_lib/values/values.mli:19: used_alias_fun: Not detected -./examples/using_dune/wrapped_lib/values/values.mli:24: used_closure: Not detected -./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int: Not detected +./examples/using_dune/wrapped_lib/obj/with_class.mli:33: fun_class_factory + +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:2: used_fun_with_single_explicitly_discarded_opt_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:4: used_fun_with_single_never_used_opt_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:5: used_fun_with_single_always_used_opt_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:12: internally_used_fun_with_single_sometimes_used_opt_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:18: externally_used_fun_with_single_sometimes_used_opt_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:20: multiple_never_used_opt_args +./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:22: multiple_always_used_opt_args +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:1: partially_applied_with_never_used_opt_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:3: partially_applied_with_always_used_opt_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:7: shadowing_never_used_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:8: shadowing_always_used_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:10: expect_fun_with_never_used_opt_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:11: expect_fun_with_always_used_opt_arg +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:13: expect_fun_with_never_used_opt_arg_with_sig +./examples/using_dune/wrapped_lib/opt_args/opt_args_in_higher_order_fun.mli:15: expect_fun_with_always_used_opt_arg_with_sig + +./examples/using_dune/wrapped_lib/values/values.mli:1: used_int +./examples/using_dune/wrapped_lib/values/values.mli:13: used_fun +./examples/using_dune/wrapped_lib/values/values.mli:19: used_alias_fun +./examples/using_dune/wrapped_lib/values/values.mli:24: used_closure +./examples/using_dune/wrapped_lib/values/values_in_submodules.mli:2: Exported.used_int ./examples/using_dune/wrapped_lib/values/values_in_submodules_no_intf.ml:2: Exported.used_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:1: used_int ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:14: used_fun @@ -412,16 +314,16 @@ ./examples/using_make/dir/ref_opt.ml:1: f ./examples/using_make/dir/ref_opt.ml:5: r -./examples/using_make/exported.mli:6: M1.five: Not detected -./examples/using_make/exported.mli:15: M2.five: Not detected -./examples/using_make/functor.mli:7: F.g: Not detected -./examples/using_make/functor.mli:11: N.g: Not detected -./examples/using_make/obj/class.mli:7: o: Not detected +./examples/using_make/exported.mli:6: M1.five +./examples/using_make/exported.mli:15: M2.five +./examples/using_make/functor.mli:7: F.g +./examples/using_make/functor.mli:11: N.g + +./examples/using_make/obj/class.mli:7: o ./examples/using_make/obj/fun_obj_param.ml:1: f -./examples/using_make/obj/inher.mli:11: o: Not detected +./examples/using_make/obj/inher.mli:11: o ./examples/using_make/obj/object.ml:1: o -./examples/using_make/opt/sig_struct.ml:6: f: Should not be detected ./examples/using_make/opt_in_opt.ml:1: foo ./examples/using_make/unused_fn.ml:1: f -------- @@ -429,30 +331,28 @@ .>-> ALMOST UNUSED EXPORTED VALUES: Called 3 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:24: multiple_sometimes_used_opt_args: Should not be detected ./examples/using_dune/unwrapped_lib/values/values_no_intf.ml:19: aliased_fun -./examples/using_dune/wrapped_lib/opt_args/opt_args.mli:24: multiple_sometimes_used_opt_args: Should not be detected ./examples/using_dune/wrapped_lib/values/values_no_intf.ml:19: aliased_fun ./examples/using_make/dir/anonFn2.mli:1: f ./examples/using_make/dir/anonFn2.mli:2: g ./examples/using_make/dir/match_opt.ml:1: f -./examples/using_make/dir/refFn.mli:1: r: Should not be detected ./examples/using_make/dir/ref_fn.ml:1: f -./examples/using_make/exported.mli:10: F.plus_five: Not detected -./examples/using_make/exported.mli:16: M2.plus_five: Not detected +./examples/using_make/exported.mli:10: F.plus_five +./examples/using_make/exported.mli:16: M2.plus_five ./examples/using_make/let_in.ml:1: complicated -./examples/using_make/opt/sig_struct.ml:6: f: Not detected +./examples/using_make/opt/sig_struct.ml:6: f + Nothing else to report in this section -------------------------------------------------------------------------------- .> UNUSED METHODS: ================= -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:1: unused#unused @@ -462,14 +362,15 @@ Nothing else to report in this section ./examples/using_dune/unwrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#unused_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#unused_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int + ./examples/using_dune/wrapped_lib/obj/with_class.mli:1: unused#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_fun ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#never_used_int @@ -477,14 +378,15 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/with_class.mli:25: fun_class#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:35: _self_used#unused ./examples/using_dune/wrapped_lib/obj/with_class.mli:41: _self_used_fun_class#unused -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#unused_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#unused_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#unused_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#unused_int + ./examples/using_make/obj/class.mli:1: c#h ./examples/using_make/obj/class_type.mli:9: c#h ./examples/using_make/obj/coerce.mli:6: p#f @@ -510,39 +412,41 @@ Nothing else to report in this section .>-> ALMOST UNUSED METHODS: Called 1 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#externally_used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#internally_used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#externally_used +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#internally_used ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#externally_used ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#internally_used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:35: _self_used#used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:41: _self_used_fun_class#used -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#externally_used_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#internally_used_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#externally_used_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#internally_used_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int + ./examples/using_dune/wrapped_lib/obj/with_class.mli:35: _self_used#used ./examples/using_dune/wrapped_lib/obj/with_class.mli:41: _self_used_fun_class#used -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#externally_used_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#internally_used_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#externally_used_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#internally_used_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:22: _self_used_immediate#used_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:28: _self_used_factory#used_int + ./examples/using_make/advanced/func.mli:3: M.c#f ./examples/using_make/advanced/mod.mli:4: p#f @@ -574,7 +478,7 @@ Nothing else to report in this section .>-> ALMOST UNUSED METHODS: Called 2 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#used ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:12: immediate#used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#externally_used_fun @@ -584,10 +488,11 @@ Nothing else to report in this section ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#sometimes_used_fun ./examples/using_dune/unwrapped_lib/obj/with_class.mli:5: basics#sometimes_used_int ./examples/using_dune/unwrapped_lib/obj/with_class.mli:25: fun_class#used -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#used_int: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#used_fun: Not detected -./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#used_int: Not detected +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:1: immediate#used_int +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#used_fun +./examples/using_dune/unwrapped_lib/obj/without_class.mli:11: factory#used_int + ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#externally_used_fun ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#externally_used_int ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#internally_used_fun @@ -595,10 +500,11 @@ Nothing else to report in this section ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#sometimes_used_fun ./examples/using_dune/wrapped_lib/obj/with_class.mli:5: basics#sometimes_used_int ./examples/using_dune/wrapped_lib/obj/with_class.mli:25: fun_class#used -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#used_int: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#used_fun: Not detected -./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#used_int: Not detected +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:1: immediate#used_int +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#used_fun +./examples/using_dune/wrapped_lib/obj/without_class.mli:11: factory#used_int + ./examples/using_make/obj/class_type.mli:7: p#g ./examples/using_make/obj/coerce.mli:8: c#f ./examples/using_make/obj/named.mli:1: p1#f @@ -815,9 +721,6 @@ Nothing else to report in this section .> OPTIONAL ARGUMENTS: ALWAYS: ============================= ./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?always -./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?internally: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?always: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?externally: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: ?always ./examples/using_dune/unwrapped_lib/opt_args/mixed_args.ml:1: ?always @@ -941,8 +844,6 @@ Nothing else to report in this section ./examples/using_make/if_end.ml:5: ?b ./examples/using_make/letIn.mli:1: ?a ./examples/using_make/let_in.ml:1: ?a -./examples/using_make/opt/sig_struct.ml:6: ?x: Should not be detected -./examples/using_make/opt/sig_struct.ml:11: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:1: ?a ./examples/using_make/opt_in_opt.ml:5: ?a ./examples/using_make/partial_opt.ml:1: ?a @@ -954,8 +855,8 @@ Nothing else to report in this section .>-> OPTIONAL ARGUMENTS: ALMOST ALWAYS: Except 1 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?externally (1/2 calls): Not detected -./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?internally (1/2 calls): Not detected +./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?externally (1/2 calls) +./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?internally (1/2 calls) ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: ?externally (1/2 calls) ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: ?internally (1/2 calls) @@ -1035,7 +936,8 @@ Nothing else to report in this section ./examples/using_make/dir/ref_fn.ml:1: ?b (2/3 calls) ./examples/using_make/matchopt.ml:1: ?x (3/4 calls) -./examples/using_make/opt/sig_struct.ml:2: ?x (2/3 calls): Not detected +./examples/using_make/opt/sig_struct.ml:2: ?x (2/3 calls) + ./examples/using_make/opt_in_opt.ml:1: ?b (1/2 calls) -------- @@ -1047,11 +949,8 @@ Nothing else to report in this section .> OPTIONAL ARGUMENTS: NEVER: ============================ -./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?externally: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?never ./examples/using_dune/preprocessed_lib/preprocessed.ml:65: ?opt -./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?internally: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed.mli:31: ?never: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: ?never ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:65: ?opt @@ -1148,7 +1047,6 @@ Nothing else to report in this section ./examples/using_make/foo.ml:1: ?a ./examples/using_make/letIn.mli:1: ?b ./examples/using_make/let_in.ml:1: ?c -./examples/using_make/opt/sig_struct.ml:2: ?x: Should not be detected ./examples/using_make/opt_in_opt.ml:2: ?a ./examples/using_make/opt_in_opt.ml:2: ?b ./examples/using_make/record.ml:12: ?b @@ -1157,8 +1055,8 @@ Nothing else to report in this section .>-> OPTIONAL ARGUMENTS: ALMOST NEVER: Except 1 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?externally (1/2 calls): Not detected -./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?internally (1/2 calls): Not detected +./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?externally (1/2 calls) +./examples/using_dune/preprocessed_lib/preprocessed.ml:53: ?internally (1/2 calls) ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: ?externally (1/2 calls) ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: ?internally (1/2 calls) @@ -1284,7 +1182,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 1123 -Success: 835 -Failed: 288 -Ratio: 74.3544078362% +Total: 1001 +Success: 976 +Failed: 25 +Ratio: 97.5024975025% diff --git a/src/deadCode.ml b/src/deadCode.ml index 47d86f5..2306b6a 100644 --- a/src/deadCode.ml +++ b/src/deadCode.ml @@ -456,7 +456,7 @@ let rec load_file state fn = in let process_implementation fn = last_loc := Lexing.dummy_pos; - if !DeadFlag.verbose then Printf.eprintf "Scanning implementation %s\n%!" fn; + if !DeadFlag.verbose then Printf.eprintf "Scanning implementation from %s\n%!" fn; init_and_continue state fn (fun state -> match state.file_infos.cmt_infos with | None -> bad_files := fn :: !bad_files @@ -465,13 +465,7 @@ let rec load_file state fn = let uid_decl_dep_to_loc_pair (_dep_kind, uid_def, uid_decl) = let ( let* ) x f = Option.bind x f in let loc_opt_of_uid uid = - let* decl = - Uid.Tbl.find_opt cmt_infos.cmt_uid_to_decl uid - in - match decl with - | Value {val_loc = {loc_start; loc_ghost = false; _}; _} -> - Some loc_start - | _ -> None + Uid.Tbl.find_opt state.signature.uid_to_loc uid in let* def_loc = loc_opt_of_uid uid_def in let* decl_loc = loc_opt_of_uid uid_decl in diff --git a/src/state/file_infos.ml b/src/state/file_infos.ml index d4ca778..bbc1836 100644 --- a/src/state/file_infos.ml +++ b/src/state/file_infos.ml @@ -52,8 +52,9 @@ let init_from_cm_file ~orig cm_file = init_from_all_cm_infos ~orig ~cm_file cmi_infos cmt_infos |> Result.ok +let ( let* ) x f = Result.bind x f + let init cm_file = - let ( let* ) x f = Result.bind x f in let* orig = match Filename.extension cm_file with | ".cmt" -> Result.ok `Cmt @@ -88,15 +89,22 @@ let change_file file_infos cm_file = | ".cmt", {cmt_infos=Some cmt_infos; cmi_infos; cmti_infos; _} -> let res = init_from_all_cm_infos ~orig:`Cmt ~cm_file cmi_infos cmt_infos - in + in Result.ok {res with cmi_infos; cmti_infos} | ".cmti", {cmti_infos=Some cmti_infos; cmi_infos; cmt_infos; _} -> let res = init_from_all_cm_infos ~orig:`Cmti ~cm_file cmi_infos cmti_infos in Result.ok {res with cmt_infos} - | _ -> (* corresponding info is None or invlaid extension *) - init cm_file + | _, {cmi_infos; cmt_infos; cmti_infos; _} -> (* corresponding info is None or invalid extension *) + let* res = init cm_file in + let choose opt1 opt2 = + if Option.is_some opt1 then opt1 else opt2 + in + let cmi_infos = choose res.cmi_infos cmi_infos in + let cmt_infos = choose res.cmt_infos cmt_infos in + let cmti_infos = choose res.cmti_infos cmti_infos in + Result.ok {res with cmi_infos; cmt_infos; cmti_infos} let has_sourcepath file_infos = Option.is_some file_infos.sourcepath diff --git a/src/state/signature.ml b/src/state/signature.ml new file mode 100644 index 0000000..efd295e --- /dev/null +++ b/src/state/signature.ml @@ -0,0 +1,69 @@ +module UidTbl = Shape.Uid.Tbl + +type t = { + uid_to_loc : Lexing.position Shape.Uid.Tbl.t; +} + +let empty () = + let uid_to_loc = + (* TODO: 512 is completely arbitrary. Evaluate a generally good size ? *) + UidTbl.create 512 + in + {uid_to_loc} + +let fill_from_structure t (structure : Typedtree.structure) = + let open Types in + let rec fill_from_signature_item = function + | Sig_value (_, {val_loc; val_uid; _}, _) -> + UidTbl.replace t.uid_to_loc val_uid val_loc.loc_start + | Sig_module (_, _, {md_type = modtype; _}, _, _) + | Sig_modtype (_, {mtd_type = Some modtype; _}, _) -> + Utils.signature_of_modtype modtype + |> fill_from_signature + | _ -> () + and fill_from_signature s = + List.iter fill_from_signature_item s + in + let iterator = + let super = Tast_iterator.default_iterator in + let structure_item self struct_item = + let open Typedtree in + begin match struct_item.str_desc with + | Tstr_include {incl_type; _} -> fill_from_signature incl_type + | _ -> () + end; + super.Tast_iterator.structure_item self struct_item + in + {super with structure_item} + in + iterator.structure iterator structure; + t + +let fill_from_cmt_infos t cmt_infos = + let open Typedtree in + let loc_of_item_decl = function + | Value {val_loc = loc; _} + | Value_binding {vb_pat = {pat_loc = loc; _}; _} -> + Some loc.loc_start + | _ -> None + in + let add_uid_loc uid item_decl = + let loc = loc_of_item_decl item_decl in + Option.iter (UidTbl.replace t.uid_to_loc uid) loc + in + Uid.Tbl.iter add_uid_loc cmt_infos.Cmt_format.cmt_uid_to_decl; + t + +let init file_infos = + match file_infos.File_infos.cmt_infos with + | None -> Result.error "No cmt_infos available" + | Some ({cmt_annots = Implementation structure; _} as cmt_infos) -> ( + let res = fill_from_structure (empty ()) structure in + let res = fill_from_cmt_infos res cmt_infos in + match file_infos.cmti_infos with + | None -> Result.ok res + | Some cmti_infos -> + fill_from_cmt_infos res cmti_infos + |> Result.ok + ) + | Some _ -> Result.error "No implementation found in cmt_infos" diff --git a/src/state/signature.mli b/src/state/signature.mli new file mode 100644 index 0000000..2a3738f --- /dev/null +++ b/src/state/signature.mli @@ -0,0 +1,15 @@ +type t = { + uid_to_loc : Lexing.position Shape.Uid.Tbl.t; + (** Maps from uids found in the [cmt]'s structure and the + [cmt_uid_decl_to_dep] fields in [.cmt] and [.cmti] to their locations + in source files. *) +} + +val empty : unit -> t (** No signature read *) + +val init : File_infos.t -> (t, string) result +(** [init file_infos] expects [file_infos] to be properly [Filen_infos.init]'ed. + It reads the [cmt_infos] to fill out the [uid_to_loc] table. + It returns an [Ok t] with [t] on success. + In case the [cmt_infos] is missing, it returns an [Err msg] with msg a string + describing the issue. *) diff --git a/src/state/state.ml b/src/state/state.ml index c6cbe4f..625cbb1 100644 --- a/src/state/state.ml +++ b/src/state/state.ml @@ -2,26 +2,32 @@ module File_infos = File_infos type t = { file_infos : File_infos.t; + signature : Signature.t } -let empty = {file_infos = File_infos.empty} +let empty = { + file_infos = File_infos.empty; + signature = Signature.empty (); +} let init cm_file = - let file_infos = File_infos.init cm_file in - Result.map (fun file_infos -> {file_infos}) file_infos + let ( let* ) x f = Result.bind x f in + let* file_infos = File_infos.init cm_file in + let* signature = Signature.init file_infos in + Result.ok {file_infos; signature} let change_file state cm_file = let file_infos = state.file_infos in let equal_no_ext filename1 filename2 = let no_ext1 = Filename.remove_extension filename1 in let no_ext2 = Filename.remove_extension filename2 in - no_ext1 = no_ext2 + String.equal no_ext1 no_ext2 in - if file_infos.cm_file = cm_file then + if String.equal file_infos.cm_file cm_file then Result.ok state else if equal_no_ext file_infos.cm_file cm_file then let file_infos = File_infos.change_file file_infos cm_file in - Result.map (fun file_infos -> {file_infos}) file_infos + Result.map (fun file_infos -> {state with file_infos}) file_infos else init cm_file diff --git a/src/state/state.mli b/src/state/state.mli index a313e24..f9b5258 100644 --- a/src/state/state.mli +++ b/src/state/state.mli @@ -4,6 +4,8 @@ module File_infos = File_infos type t = { file_infos : File_infos.t; (** Info about the file being analyzed *) + signature : Signature.t; (** Data extracted or built using the current + compiltion unit's signature *) } val empty : t (** The empty state *) From 0d5e0f456118ea51de8f60a07d2c0a06c433bd3d Mon Sep 17 00:00:00 2001 From: Corentin De Souza <9597216+fantazio@users.noreply.github.com> Date: Thu, 11 Dec 2025 11:59:48 +0100 Subject: [PATCH 6/8] [src][state] expose `location_dependencies` through `state.file_infos` Rather than adding a `signature` field to the state to hold a `uid_to_loc` table to then use in `DeadCode.load_file` to convert uids into locations, to then convert `cmt_declaration_dependencies` into a list of pairs of locations, directly construct that list and store along with the `file_infos`. This move is more consistent with the nature, usage and provenance of the information : it is created using info in `cmt_infos` and `cmti_infos` to replace the `cmt_value_dependencies` field that existed prior to OCaml 5.3, and should only live as long the corresponding `cmt_infos` live. --- src/deadCode.ml | 19 ++----- src/state/file_infos.ml | 38 ++++++++++---- src/state/file_infos.mli | 8 +-- src/state/location_dependencies.ml | 79 +++++++++++++++++++++++++++++ src/state/location_dependencies.mli | 12 +++++ src/state/signature.ml | 69 ------------------------- src/state/signature.mli | 15 ------ src/state/state.ml | 7 +-- src/state/state.mli | 4 +- 9 files changed, 131 insertions(+), 120 deletions(-) create mode 100644 src/state/location_dependencies.ml create mode 100644 src/state/location_dependencies.mli delete mode 100644 src/state/signature.ml delete mode 100644 src/state/signature.mli diff --git a/src/deadCode.ml b/src/deadCode.ml index 2306b6a..dd9c9ce 100644 --- a/src/deadCode.ml +++ b/src/deadCode.ml @@ -460,30 +460,17 @@ let rec load_file state fn = init_and_continue state fn (fun state -> match state.file_infos.cmt_infos with | None -> bad_files := fn :: !bad_files - | Some ({cmt_annots = Implementation x; _} as cmt_infos) -> + | Some {cmt_annots = Implementation x; _} -> regabs state; - let uid_decl_dep_to_loc_pair (_dep_kind, uid_def, uid_decl) = - let ( let* ) x f = Option.bind x f in - let loc_opt_of_uid uid = - Uid.Tbl.find_opt state.signature.uid_to_loc uid - in - let* def_loc = loc_opt_of_uid uid_def in - let* decl_loc = loc_opt_of_uid uid_decl in - Some (def_loc, decl_loc) - in - let value_dep = - cmt_infos.cmt_declaration_dependencies - |> List.filter_map uid_decl_dep_to_loc_pair - in let prepare (loc1, loc2) = DeadObj.add_equal loc1 loc2; VdNode.merge_locs ~force:true loc2 loc1 in - List.iter prepare value_dep; + List.iter prepare state.file_infos.location_dependencies; ignore (collect_references.Tast_mapper.structure collect_references x); let loc_dep = if !DeadFlag.exported.DeadFlag.print then - value_dep + state.file_infos.location_dependencies else [] in eof loc_dep diff --git a/src/state/file_infos.ml b/src/state/file_infos.ml index bbc1836..b899909 100644 --- a/src/state/file_infos.ml +++ b/src/state/file_infos.ml @@ -1,21 +1,23 @@ type t = { - cm_file : string; - sourcepath : string option; builddir : string; - modname : string; + cm_file : string; cmi_infos : Cmi_format.cmi_infos option; cmt_infos : Cmt_format.cmt_infos option; cmti_infos : Cmt_format.cmt_infos option; + location_dependencies : Location_dependencies.t; + modname : string; + sourcepath : string option; } let empty = { - cm_file = ""; - sourcepath = None; builddir = "!!UNKNOWN_BUILDDIR!!"; - modname = "!!UNKNOWN_MODNAME!!"; + cm_file = ""; cmi_infos = None; cmt_infos = None; cmti_infos = None; + location_dependencies = Location_dependencies.empty; + modname = "!!UNKNOWN_MODNAME!!"; + sourcepath = None; } (** [init_from_all_cm_infos ~orig ~cm_file cmi_infos cmt_infos] creates a [t] with: @@ -35,7 +37,13 @@ let empty = { | `Cmt -> Some cmt_infos, None | `Cmti -> None, Some cmt_infos in - {cm_file; sourcepath; builddir; modname; cmi_infos; cmt_infos; cmti_infos} + {empty with builddir; + cm_file; + cmi_infos; + cmt_infos; + cmti_infos; + modname; + sourcepath} (** [init_from_cm_file ~orig cm_file] returns an [Ok t] with [t] filled using the [cm_file] (see [init_from_cmt_infos]). @@ -80,7 +88,15 @@ let init cm_file = in file_infos.cmi_infos, cmt_infos, file_infos.cmti_infos in - Result.ok {file_infos with cmi_infos; cmt_infos; cmti_infos} + let* location_dependencies = + match orig with + | `Cmt -> Location_dependencies.init cmt_infos cmti_infos + | `Cmti -> Result.ok Location_dependencies.empty + in + Result.ok {file_infos with cmi_infos; + cmt_infos; + cmti_infos; + location_dependencies} let change_file file_infos cm_file = let no_ext = Filename.remove_extension cm_file in @@ -90,7 +106,11 @@ let change_file file_infos cm_file = let res = init_from_all_cm_infos ~orig:`Cmt ~cm_file cmi_infos cmt_infos in - Result.ok {res with cmi_infos; cmti_infos} + let res = {res with cmi_infos; cmti_infos} in + let* location_dependencies = + Location_dependencies.init res.cmt_infos res.cmti_infos + in + Result.ok {res with location_dependencies} | ".cmti", {cmti_infos=Some cmti_infos; cmi_infos; cmt_infos; _} -> let res = init_from_all_cm_infos ~orig:`Cmti ~cm_file cmi_infos cmti_infos diff --git a/src/state/file_infos.mli b/src/state/file_infos.mli index 2807c9e..9ec37d5 100644 --- a/src/state/file_infos.mli +++ b/src/state/file_infos.mli @@ -1,13 +1,15 @@ (** Information about a analyzable file ([.cmti] or [.cmt] file) *) type t = { - cm_file : string; (** The filepath currently analyzed *) - sourcepath : string option; (** The path to the associated source file *) builddir : string; (** The [cmt_builddir] *) - modname : string; (** Either [cmti_name] or [cmt_modname] *) + cm_file : string; (** The filepath currently analyzed *) cmi_infos : Cmi_format.cmi_infos option; cmt_infos : Cmt_format.cmt_infos option; cmti_infos : Cmt_format.cmt_infos option; + location_dependencies : Location_dependencies.t; + (** Dependencies similar to [cmt_infos.cmt_value_dependencies] in OCaml 5.2 *) + modname : string; (** Either [cmti_name] or [cmt_modname] *) + sourcepath : string option; (** The path to the associated source file *) } val empty : t (** No file info *) diff --git a/src/state/location_dependencies.ml b/src/state/location_dependencies.ml new file mode 100644 index 0000000..44ca015 --- /dev/null +++ b/src/state/location_dependencies.ml @@ -0,0 +1,79 @@ +type t = (Lexing.position * Lexing.position) list + +let empty = [] + +module UidTbl = Shape.Uid.Tbl + +let fill_from_structure (structure : Typedtree.structure) res_uid_to_loc = + let open Types in + let rec fill_from_signature_item = function + | Sig_value (_, {val_loc; val_uid; _}, _) -> + UidTbl.replace res_uid_to_loc val_uid val_loc.loc_start + | Sig_module (_, _, {md_type = modtype; _}, _, _) + | Sig_modtype (_, {mtd_type = Some modtype; _}, _) -> + Utils.signature_of_modtype modtype + |> fill_from_signature + | _ -> () + and fill_from_signature s = + List.iter fill_from_signature_item s + in + let iterator = + let super = Tast_iterator.default_iterator in + let structure_item self struct_item = + let open Typedtree in + begin match struct_item.str_desc with + | Tstr_include {incl_type; _} -> fill_from_signature incl_type + | _ -> () + end; + super.Tast_iterator.structure_item self struct_item + in + {super with structure_item} + in + iterator.structure iterator structure; + res_uid_to_loc + +let fill_from_cmt_infos cmt_infos res_uid_to_loc = + let open Typedtree in + let loc_of_item_decl = function + | Value {val_loc = loc; _} + | Value_binding {vb_pat = {pat_loc = loc; _}; _} -> + Some loc.loc_start + | _ -> None + in + let add_uid_loc uid item_decl = + let loc = loc_of_item_decl item_decl in + Option.iter (UidTbl.replace res_uid_to_loc uid) loc + in + UidTbl.iter add_uid_loc cmt_infos.Cmt_format.cmt_uid_to_decl; + res_uid_to_loc + +let cmt_decl_dep_to_loc_dep cmt_decl_dep uid_to_loc = + let convert_pair (_dep_kind, uid_def, uid_decl) = + let ( let* ) x f = Option.bind x f in + let loc_opt_of_uid uid = + UidTbl.find_opt uid_to_loc uid + in + let* def_loc = loc_opt_of_uid uid_def in + let* decl_loc = loc_opt_of_uid uid_decl in + Some (def_loc, decl_loc) + in + List.filter_map convert_pair cmt_decl_dep + +let init cmt_infos cmti_infos = + match cmt_infos with + | None -> Result.error "No cmt_infos available" + | Some (Cmt_format.{cmt_annots = Implementation structure; _} as cmt_infos) -> ( + let fill_from_cmti_infos tbl = + match cmti_infos with + | None -> tbl + | Some cmti_infos -> fill_from_cmt_infos cmti_infos tbl + in + (* TODO: Evaluate a generally good size for the tbl ? *) + UidTbl.create 512 + |> fill_from_structure structure + |> fill_from_cmt_infos cmt_infos + |> fill_from_cmti_infos + |> cmt_decl_dep_to_loc_dep cmt_infos.cmt_declaration_dependencies + |> Result.ok + ) + | Some _ -> Result.error "No implementation found in cmt_infos" diff --git a/src/state/location_dependencies.mli b/src/state/location_dependencies.mli new file mode 100644 index 0000000..1b142b5 --- /dev/null +++ b/src/state/location_dependencies.mli @@ -0,0 +1,12 @@ +type t = (Lexing.position * Lexing.position) list + (** Dependencies similar to [cmt_infos.cmt_value_dependencies] in OCaml 5.2 *) + +val empty : t (** No signature read *) + +val init : Cmt_format.cmt_infos option -> Cmt_format.cmt_infos option -> (t, string) result +(** [init cmt_infos cmti_infos] expects [cmt_infos = Some _]. + It reads the [cmt_infos] and the |cmti_infos] to retrieve their + [cmt_declaration_dependencies] and convert them into a single [t]. + It returns an [Ok t] with [t] on success. + In case the [cmt_infos] is missing or does not contain an implementation, + it returns an [Err msg] with msg a string describing the issue. *) diff --git a/src/state/signature.ml b/src/state/signature.ml deleted file mode 100644 index efd295e..0000000 --- a/src/state/signature.ml +++ /dev/null @@ -1,69 +0,0 @@ -module UidTbl = Shape.Uid.Tbl - -type t = { - uid_to_loc : Lexing.position Shape.Uid.Tbl.t; -} - -let empty () = - let uid_to_loc = - (* TODO: 512 is completely arbitrary. Evaluate a generally good size ? *) - UidTbl.create 512 - in - {uid_to_loc} - -let fill_from_structure t (structure : Typedtree.structure) = - let open Types in - let rec fill_from_signature_item = function - | Sig_value (_, {val_loc; val_uid; _}, _) -> - UidTbl.replace t.uid_to_loc val_uid val_loc.loc_start - | Sig_module (_, _, {md_type = modtype; _}, _, _) - | Sig_modtype (_, {mtd_type = Some modtype; _}, _) -> - Utils.signature_of_modtype modtype - |> fill_from_signature - | _ -> () - and fill_from_signature s = - List.iter fill_from_signature_item s - in - let iterator = - let super = Tast_iterator.default_iterator in - let structure_item self struct_item = - let open Typedtree in - begin match struct_item.str_desc with - | Tstr_include {incl_type; _} -> fill_from_signature incl_type - | _ -> () - end; - super.Tast_iterator.structure_item self struct_item - in - {super with structure_item} - in - iterator.structure iterator structure; - t - -let fill_from_cmt_infos t cmt_infos = - let open Typedtree in - let loc_of_item_decl = function - | Value {val_loc = loc; _} - | Value_binding {vb_pat = {pat_loc = loc; _}; _} -> - Some loc.loc_start - | _ -> None - in - let add_uid_loc uid item_decl = - let loc = loc_of_item_decl item_decl in - Option.iter (UidTbl.replace t.uid_to_loc uid) loc - in - Uid.Tbl.iter add_uid_loc cmt_infos.Cmt_format.cmt_uid_to_decl; - t - -let init file_infos = - match file_infos.File_infos.cmt_infos with - | None -> Result.error "No cmt_infos available" - | Some ({cmt_annots = Implementation structure; _} as cmt_infos) -> ( - let res = fill_from_structure (empty ()) structure in - let res = fill_from_cmt_infos res cmt_infos in - match file_infos.cmti_infos with - | None -> Result.ok res - | Some cmti_infos -> - fill_from_cmt_infos res cmti_infos - |> Result.ok - ) - | Some _ -> Result.error "No implementation found in cmt_infos" diff --git a/src/state/signature.mli b/src/state/signature.mli deleted file mode 100644 index 2a3738f..0000000 --- a/src/state/signature.mli +++ /dev/null @@ -1,15 +0,0 @@ -type t = { - uid_to_loc : Lexing.position Shape.Uid.Tbl.t; - (** Maps from uids found in the [cmt]'s structure and the - [cmt_uid_decl_to_dep] fields in [.cmt] and [.cmti] to their locations - in source files. *) -} - -val empty : unit -> t (** No signature read *) - -val init : File_infos.t -> (t, string) result -(** [init file_infos] expects [file_infos] to be properly [Filen_infos.init]'ed. - It reads the [cmt_infos] to fill out the [uid_to_loc] table. - It returns an [Ok t] with [t] on success. - In case the [cmt_infos] is missing, it returns an [Err msg] with msg a string - describing the issue. *) diff --git a/src/state/state.ml b/src/state/state.ml index 625cbb1..eeb4966 100644 --- a/src/state/state.ml +++ b/src/state/state.ml @@ -2,19 +2,16 @@ module File_infos = File_infos type t = { file_infos : File_infos.t; - signature : Signature.t } let empty = { file_infos = File_infos.empty; - signature = Signature.empty (); } let init cm_file = let ( let* ) x f = Result.bind x f in let* file_infos = File_infos.init cm_file in - let* signature = Signature.init file_infos in - Result.ok {file_infos; signature} + Result.ok {file_infos} let change_file state cm_file = let file_infos = state.file_infos in @@ -27,7 +24,7 @@ let change_file state cm_file = Result.ok state else if equal_no_ext file_infos.cm_file cm_file then let file_infos = File_infos.change_file file_infos cm_file in - Result.map (fun file_infos -> {state with file_infos}) file_infos + Result.map (fun file_infos -> {file_infos}) file_infos else init cm_file diff --git a/src/state/state.mli b/src/state/state.mli index f9b5258..5db6e8f 100644 --- a/src/state/state.mli +++ b/src/state/state.mli @@ -4,15 +4,13 @@ module File_infos = File_infos type t = { file_infos : File_infos.t; (** Info about the file being analyzed *) - signature : Signature.t; (** Data extracted or built using the current - compiltion unit's signature *) } val empty : t (** The empty state *) val init : string -> (t, string) result (** [init cmti_file] initialize a state to analyze [cmti_file]. - See [File_infos.init] for error cases. *) + See the fields respective [init]s for error cases. *) val change_file : t -> string -> (t, string) result (** [cahnge_file t cmti_file] prepare the analysis to move on to [cmti_file]. From 86a2452b809f890bfcdddf389b941b94c3c087f3 Mon Sep 17 00:00:00 2001 From: Corentin De Souza <9597216+fantazio@users.noreply.github.com> Date: Thu, 11 Dec 2025 16:03:49 +0100 Subject: [PATCH 7/8] [src][state][file_infos] update to more precise fields Only keep useful information from the cm*_infos rather than the whole structure. This makes clearer what is actually used from those and reduces the error surface. --- src/deadCode.ml | 12 +- src/state/file_infos.ml | 164 ++++++++++++++-------------- src/state/file_infos.mli | 8 +- src/state/location_dependencies.ml | 41 +++---- src/state/location_dependencies.mli | 15 ++- 5 files changed, 126 insertions(+), 114 deletions(-) diff --git a/src/deadCode.ml b/src/deadCode.ml index dd9c9ce..2a95d8c 100644 --- a/src/deadCode.ml +++ b/src/deadCode.ml @@ -448,9 +448,9 @@ let rec load_file state fn = last_loc := Lexing.dummy_pos; if !DeadFlag.verbose then Printf.eprintf "Scanning interface from %s\n%!" fn; init_and_continue state fn (fun state -> - match state.file_infos.cmi_infos with + match state.file_infos.cmi_sign with | None -> bad_files := fn :: !bad_files - | Some {cmi_sign; _} -> + | Some cmi_sign -> read_interface fn cmi_sign state ) in @@ -458,23 +458,23 @@ let rec load_file state fn = last_loc := Lexing.dummy_pos; if !DeadFlag.verbose then Printf.eprintf "Scanning implementation from %s\n%!" fn; init_and_continue state fn (fun state -> - match state.file_infos.cmt_infos with + match state.file_infos.cmt_struct with | None -> bad_files := fn :: !bad_files - | Some {cmt_annots = Implementation x; _} -> + | Some structure -> regabs state; let prepare (loc1, loc2) = DeadObj.add_equal loc1 loc2; VdNode.merge_locs ~force:true loc2 loc1 in List.iter prepare state.file_infos.location_dependencies; - ignore (collect_references.Tast_mapper.structure collect_references x); + collect_references.Tast_mapper.structure collect_references structure + |> ignore; let loc_dep = if !DeadFlag.exported.DeadFlag.print then state.file_infos.location_dependencies else [] in eof loc_dep - | _ -> () (* todo: support partial_implementation? *) ) in match kind fn with diff --git a/src/state/file_infos.ml b/src/state/file_infos.ml index b899909..c96d8ad 100644 --- a/src/state/file_infos.ml +++ b/src/state/file_infos.ml @@ -1,9 +1,9 @@ type t = { builddir : string; cm_file : string; - cmi_infos : Cmi_format.cmi_infos option; - cmt_infos : Cmt_format.cmt_infos option; - cmti_infos : Cmt_format.cmt_infos option; + cmi_sign : Types.signature option; + cmt_struct : Typedtree.structure option; + cmti_uid_to_decl : Location_dependencies.uid_to_decl option; location_dependencies : Location_dependencies.t; modname : string; sourcepath : string option; @@ -12,119 +12,125 @@ type t = { let empty = { builddir = "!!UNKNOWN_BUILDDIR!!"; cm_file = ""; - cmi_infos = None; - cmt_infos = None; - cmti_infos = None; + cmi_sign = None; + cmt_struct = None; + cmti_uid_to_decl = None; location_dependencies = Location_dependencies.empty; modname = "!!UNKNOWN_MODNAME!!"; sourcepath = None; } -(** [init_from_all_cm_infos ~orig ~cm_file cmi_infos cmt_infos] creates a [t] with: - - information from [cmt_infos]; +(** [init_from_all_cm_infos ~cm_file ~cmi_infos cmt_infos] creates a [t] with: + - information from [cmt_infos] : [builddir], [modname], [sourcepath]; - [cm_file]; - - [cmi_infos]; - - [cmt_infos = Some cmt_infos] if [orig = `Cmt]; - - [cmti_infos = Some cmt_infos] if [orig = `Cmti]. *) - let init_from_all_cm_infos ~orig ~cm_file cmi_infos cmt_infos = + - [cmi_sign = Some cm_infos.cmi_sign] if [cmi_infos = Some _]; *) + let init_from_all_cm_infos ~cm_file ~cmi_infos cmt_infos = let builddir = cmt_infos.Cmt_format.cmt_builddir in let sourcepath = Option.map (Filename.concat builddir) cmt_infos.cmt_sourcefile in let modname = cmt_infos.cmt_modname in - let cmt_infos, cmti_infos = - match orig with - | `Cmt -> Some cmt_infos, None - | `Cmti -> None, Some cmt_infos - in + let cmi_sign = Option.map (fun Cmi_format.{cmi_sign; _} -> cmi_sign) cmi_infos in {empty with builddir; cm_file; - cmi_infos; - cmt_infos; - cmti_infos; + cmi_sign; modname; sourcepath} -(** [init_from_cm_file ~orig cm_file] returns an [Ok t] with [t] filled using - the [cm_file] (see [init_from_cmt_infos]). +(** [init_from_cm_file cm_file] returns an [Ok t] with [t] filled with general + info expected for both cmt and cmti files, using the [cm_file] (see + [init_from_all_cm_infos]). In case the file does not exist or it cannot be read (see [Cmt_format.read_cmt]) then it returns an [Err msg] with msg a string describing the issue. *) -let init_from_cm_file ~orig cm_file = +let init_from_cm_file cm_file = if not (Sys.file_exists cm_file) then Result.error (cm_file ^ ": file not found") else match Cmt_format.read cm_file with | exception _ -> Result.error (cm_file ^ ": error reading file") | _, None -> Result.error (cm_file ^ ": cmt_infos not found") | cmi_infos, Some cmt_infos -> - init_from_all_cm_infos ~orig ~cm_file cmi_infos cmt_infos - |> Result.ok + let file_infos = + init_from_all_cm_infos ~cm_file ~cmi_infos cmt_infos + in + Result.ok (file_infos, cmt_infos) let ( let* ) x f = Result.bind x f +let ( let+ ) x f = Result.map f x -let init cm_file = - let* orig = - match Filename.extension cm_file with - | ".cmt" -> Result.ok `Cmt - | ".cmti" -> Result.ok `Cmti - | _ -> Result.error (cm_file ^ ": not a .cmti or .cmt file") +let init_from_cmti_file cmti_file = + let+ file_infos, cmt_infos = init_from_cm_file cmti_file in + let cmti_uid_to_decl = Some cmt_infos.cmt_uid_to_decl in + {file_infos with cmti_uid_to_decl} + +let init_from_cmt_file cmt_file = + let* file_infos, cmt_infos = init_from_cm_file cmt_file in + let* cmt_struct = + match cmt_infos.cmt_annots with + | Implementation structure -> Result.ok structure + | _ -> Result.error (cmt_file ^ ": does not contain an implementation") in - let* file_infos = init_from_cm_file ~orig cm_file in - let cmi_infos, cmt_infos, cmti_infos = - let no_ext = Filename.remove_extension cm_file in - match orig with - | `Cmt -> - let cmi_infos, cmti_infos = - init_from_cm_file ~orig:`Cmti (no_ext ^ ".cmti") - |> Result.map (fun {cmi_infos; cmti_infos; _} -> cmi_infos, cmti_infos) - |> Result.value ~default:(file_infos.cmi_infos, file_infos.cmti_infos) - in - cmi_infos, file_infos.cmt_infos, cmti_infos - | `Cmti -> - let cmt_infos = - init_from_cm_file ~orig:`Cmt (no_ext ^ ".cmt") - |> Result.map (fun {cmt_infos; _} -> cmt_infos) - |> Result.value ~default:file_infos.cmt_infos - in - file_infos.cmi_infos, cmt_infos, file_infos.cmti_infos + let cmt_struct = Some cmt_struct in + (* Read the cmti if it exists. We always want to do it in case a user + specified the cmt before the cmti to ensure the location_dependencies + are idempotent. *) + let cmti_uid_to_decl = + let cmti_file = Filename.remove_extension cmt_file ^ ".cmti" in + match init_from_cmti_file cmti_file with + | Error _ -> None + | Ok file_infos -> file_infos.cmti_uid_to_decl + in + let+ location_dependencies = + Location_dependencies.init cmt_infos cmti_uid_to_decl in - let* location_dependencies = - match orig with - | `Cmt -> Location_dependencies.init cmt_infos cmti_infos - | `Cmti -> Result.ok Location_dependencies.empty + let file_infos = + {file_infos with cmt_struct; cmti_uid_to_decl; location_dependencies} in - Result.ok {file_infos with cmi_infos; - cmt_infos; - cmti_infos; - location_dependencies} + file_infos, cmt_infos + +let init cm_file = + match Filename.extension cm_file with + | ".cmt" -> + let+ file_infos, _ = init_from_cmt_file cm_file in + file_infos + | ".cmti" -> ( + (* Using cmt_infos is not critical. The intent is to mirror the behavior + on cmt files, where both cmt and cmti are read. *) + let filled_with_cmt_infos = + let cmt_file = Filename.remove_extension cm_file ^ ".cmt" in + let* file_infos, cmt_infos = init_from_cmt_file cmt_file in + let+ location_dependencies = + Location_dependencies.init cmt_infos file_infos.cmti_uid_to_decl + in + {file_infos with location_dependencies} + in + match filled_with_cmt_infos with + | Ok {cmt_struct; cmti_uid_to_decl; location_dependencies; _} -> + let+ res, _ = init_from_cm_file cm_file in + {res with cmt_struct; cmti_uid_to_decl; location_dependencies} + | Error _ -> init_from_cmti_file cm_file + ) + | _ -> Result.error (cm_file ^ ": not a .cmti or .cmt file") let change_file file_infos cm_file = let no_ext = Filename.remove_extension cm_file in assert(no_ext = Filename.remove_extension file_infos.cm_file); match Filename.extension cm_file, file_infos with - | ".cmt", {cmt_infos=Some cmt_infos; cmi_infos; cmti_infos; _} -> - let res = - init_from_all_cm_infos ~orig:`Cmt ~cm_file cmi_infos cmt_infos - in - let res = {res with cmi_infos; cmti_infos} in - let* location_dependencies = - Location_dependencies.init res.cmt_infos res.cmti_infos - in - Result.ok {res with location_dependencies} - | ".cmti", {cmti_infos=Some cmti_infos; cmi_infos; cmt_infos; _} -> - let res = - init_from_all_cm_infos ~orig:`Cmti ~cm_file cmi_infos cmti_infos - in - Result.ok {res with cmt_infos} - | _, {cmi_infos; cmt_infos; cmti_infos; _} -> (* corresponding info is None or invalid extension *) - let* res = init cm_file in - let choose opt1 opt2 = - if Option.is_some opt1 then opt1 else opt2 + | ".cmt", {cmt_struct = (Some _ as cs); cmi_sign; cmti_uid_to_decl; _} -> + let* res, cmt_infos = init_from_cm_file cm_file in + let+ location_dependencies = + match file_infos.location_dependencies with + | [] -> Location_dependencies.init cmt_infos cmti_uid_to_decl + | loc_dep -> (* They have already been computed *) + Result.ok loc_dep in - let cmi_infos = choose res.cmi_infos cmi_infos in - let cmt_infos = choose res.cmt_infos cmt_infos in - let cmti_infos = choose res.cmti_infos cmti_infos in - Result.ok {res with cmi_infos; cmt_infos; cmti_infos} + {res with cmt_struct = cs; cmi_sign; cmti_uid_to_decl; location_dependencies} + | ".cmti", {cmti_uid_to_decl = (Some _ as cutd); cmt_struct; location_dependencies; _} -> + let+ res, _ = init_from_cm_file cm_file in + {res with cmti_uid_to_decl = cutd; cmt_struct; location_dependencies} + | _ -> + (* invalid extension or the corresponding info is None *) + init cm_file let has_sourcepath file_infos = Option.is_some file_infos.sourcepath diff --git a/src/state/file_infos.mli b/src/state/file_infos.mli index 9ec37d5..9e38133 100644 --- a/src/state/file_infos.mli +++ b/src/state/file_infos.mli @@ -3,9 +3,11 @@ type t = { builddir : string; (** The [cmt_builddir] *) cm_file : string; (** The filepath currently analyzed *) - cmi_infos : Cmi_format.cmi_infos option; - cmt_infos : Cmt_format.cmt_infos option; - cmti_infos : Cmt_format.cmt_infos option; + cmi_sign : Types.signature option; (** Extracted from [cmi_infos] *) + cmt_struct : Typedtree.structure option; + (** Extracted from a cmt's [cmt_infos.cmt_annots] *) + cmti_uid_to_decl : Location_dependencies.uid_to_decl option; + (** Extracted from a cmti's [cmt_infos] *) location_dependencies : Location_dependencies.t; (** Dependencies similar to [cmt_infos.cmt_value_dependencies] in OCaml 5.2 *) modname : string; (** Either [cmti_name] or [cmt_modname] *) diff --git a/src/state/location_dependencies.ml b/src/state/location_dependencies.ml index 44ca015..2ade7ff 100644 --- a/src/state/location_dependencies.ml +++ b/src/state/location_dependencies.ml @@ -4,6 +4,8 @@ let empty = [] module UidTbl = Shape.Uid.Tbl +type uid_to_decl = Typedtree.item_declaration UidTbl.t + let fill_from_structure (structure : Typedtree.structure) res_uid_to_loc = let open Types in let rec fill_from_signature_item = function @@ -32,7 +34,7 @@ let fill_from_structure (structure : Typedtree.structure) res_uid_to_loc = iterator.structure iterator structure; res_uid_to_loc -let fill_from_cmt_infos cmt_infos res_uid_to_loc = +let fill_from_cmt_tbl uid_to_decl res_uid_to_loc = let open Typedtree in let loc_of_item_decl = function | Value {val_loc = loc; _} @@ -44,7 +46,7 @@ let fill_from_cmt_infos cmt_infos res_uid_to_loc = let loc = loc_of_item_decl item_decl in Option.iter (UidTbl.replace res_uid_to_loc uid) loc in - UidTbl.iter add_uid_loc cmt_infos.Cmt_format.cmt_uid_to_decl; + UidTbl.iter add_uid_loc uid_to_decl; res_uid_to_loc let cmt_decl_dep_to_loc_dep cmt_decl_dep uid_to_loc = @@ -59,21 +61,20 @@ let cmt_decl_dep_to_loc_dep cmt_decl_dep uid_to_loc = in List.filter_map convert_pair cmt_decl_dep -let init cmt_infos cmti_infos = - match cmt_infos with - | None -> Result.error "No cmt_infos available" - | Some (Cmt_format.{cmt_annots = Implementation structure; _} as cmt_infos) -> ( - let fill_from_cmti_infos tbl = - match cmti_infos with - | None -> tbl - | Some cmti_infos -> fill_from_cmt_infos cmti_infos tbl - in - (* TODO: Evaluate a generally good size for the tbl ? *) - UidTbl.create 512 - |> fill_from_structure structure - |> fill_from_cmt_infos cmt_infos - |> fill_from_cmti_infos - |> cmt_decl_dep_to_loc_dep cmt_infos.cmt_declaration_dependencies - |> Result.ok - ) - | Some _ -> Result.error "No implementation found in cmt_infos" +let init cmt_infos cmti_uid_to_decl = + match cmt_infos.Cmt_format.cmt_annots with + | Implementation structure -> + let fill_from_cmti_tbl tbl = + match cmti_uid_to_decl with + | None -> tbl + | Some cmti_uid_to_decl -> + fill_from_cmt_tbl cmti_uid_to_decl tbl + in + (* TODO: Evaluate a generally good size for the tbl ? *) + UidTbl.create 512 + |> fill_from_structure structure + |> fill_from_cmt_tbl cmt_infos.cmt_uid_to_decl + |> fill_from_cmti_tbl + |> cmt_decl_dep_to_loc_dep cmt_infos.cmt_declaration_dependencies + |> Result.ok + | _ -> Result.error "No implementation found in cmt_infos" diff --git a/src/state/location_dependencies.mli b/src/state/location_dependencies.mli index 1b142b5..c6dc3fb 100644 --- a/src/state/location_dependencies.mli +++ b/src/state/location_dependencies.mli @@ -3,10 +3,13 @@ type t = (Lexing.position * Lexing.position) list val empty : t (** No signature read *) -val init : Cmt_format.cmt_infos option -> Cmt_format.cmt_infos option -> (t, string) result -(** [init cmt_infos cmti_infos] expects [cmt_infos = Some _]. - It reads the [cmt_infos] and the |cmti_infos] to retrieve their - [cmt_declaration_dependencies] and convert them into a single [t]. +type uid_to_decl = Typedtree.item_declaration Shape.Uid.Tbl.t + +val init : Cmt_format.cmt_infos -> uid_to_decl option -> (t, string) result +(** [init cmt_infos cmti_infos cmti_uid_to_decl] expects + [cmt_infos.cmt_annots = Implementation _]. + It reads the [cmt_infos] and the [cmti_uid_to_decl] to retrieve their + and converts [cmt_infos.cmt_declaration_dependencies] into a single [t]. It returns an [Ok t] with [t] on success. - In case the [cmt_infos] is missing or does not contain an implementation, - it returns an [Err msg] with msg a string describing the issue. *) + In case the [cmt_infos] does not contain an implementation, it returns an + [Err msg] with msg a string describing the issue. *) From 4be5ae3b373088bf34abe0e09865204bc08d6af0 Mon Sep 17 00:00:00 2001 From: Corentin De Souza <9597216+fantazio@users.noreply.github.com> Date: Wed, 17 Dec 2025 15:22:17 +0100 Subject: [PATCH 8/8] [src][verbose] print error on missing cmi_infos and cmt_struct --- src/deadCode.ml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/deadCode.ml b/src/deadCode.ml index 2a95d8c..4504bf3 100644 --- a/src/deadCode.ml +++ b/src/deadCode.ml @@ -444,12 +444,17 @@ let rec load_file state fn = (* TODO: stateful computations should take and return the state when possible *) state in + let add_bad_file err fn = + if !DeadFlag.verbose then + Printf.eprintf "%s\n%!" err; + bad_files := fn :: !bad_files + in let process_interface fn = last_loc := Lexing.dummy_pos; if !DeadFlag.verbose then Printf.eprintf "Scanning interface from %s\n%!" fn; init_and_continue state fn (fun state -> match state.file_infos.cmi_sign with - | None -> bad_files := fn :: !bad_files + | None -> add_bad_file "Missing cmi_sign" fn | Some cmi_sign -> read_interface fn cmi_sign state ) @@ -459,7 +464,7 @@ let rec load_file state fn = if !DeadFlag.verbose then Printf.eprintf "Scanning implementation from %s\n%!" fn; init_and_continue state fn (fun state -> match state.file_infos.cmt_struct with - | None -> bad_files := fn :: !bad_files + | None -> add_bad_file "Missing cmt_struct" fn | Some structure -> regabs state; let prepare (loc1, loc2) =