From 910e1232a1f41c502f32a707dbdc1c19635f3c02 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 01/15] [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 | 75 +-- check/internal/internal.ref | 122 +++-- check/threshold-1/threshold-1.ref | 341 +++++++++----- check/threshold-3-0.5/threshold-3-0.5.ref | 533 +++++++++++++--------- dead_code_analyzer.opam | 2 +- dune-project | 2 +- src/deadCode.ml | 48 +- src/deadLexiFi.ml | 3 +- src/utils.ml | 2 +- 11 files changed, 707 insertions(+), 429 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index ef090779..190eb0aa 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 4715a114..14812492 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ For more information, see the [User documentation](docs/USER_DOC.md) ## Requirements -- Currently tested and working on **OCaml 5.2** +- Currently tested and working on **OCaml 5.3** - **dune >= 3.20** diff --git a/check/classic/classic.ref b/check/classic/classic.ref index 35ae2f3d..17b34ba4 100644 --- a/check/classic/classic.ref +++ b/check/classic/classic.ref @@ -20,6 +20,7 @@ ./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement @@ -63,11 +64,23 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:19: Values_in_submodules.Exported.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:27: Values_in_submodules_no_intf.Exported.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:28: Values_in_submodules_no_intf.Exported.internally_used +./examples/using_dune/reduced_lib/values.mli:1: used: Should not be detected +./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values.mli:3: internally_used: Should not be detected +./examples/using_dune/reduced_lib/values.mli:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:7: lib_internal_unused ./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used +./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused +./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg @@ -112,7 +125,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 @@ -174,27 +188,23 @@ Nothing else to report in this section ./examples/docs/methods/code_constructs/class/class_bin.ml:2: unused_class#unused_method ./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#reset -./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#unused - +./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#unused: Not detected ./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:2: unused_class#unused_method ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#reset ./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory#unused_method -./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#reset - +./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#reset: Not detected ./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj#unused_method -./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#reset - +./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#reset: Not detected ./examples/docs/methods/code_constructs/inheritance/inheritance_lib.mli:2: parent#unused ./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_lib.mli:2: stack#reset -./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#unused -./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#used_by_alias: Should not be detected +./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#unused: Not detected ./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding#m: Not detected ./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m -./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 @@ -204,15 +214,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 @@ -220,15 +229,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 @@ -488,6 +496,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 @@ -618,6 +628,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 @@ -719,7 +730,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 593 -Success: 586 -Failed: 7 -Ratio: 98.8195615514% +Total: 610 +Success: 565 +Failed: 45 +Ratio: 92.6229508197% diff --git a/check/internal/internal.ref b/check/internal/internal.ref index 5c83976b..5797a18e 100644 --- a/check/internal/internal.ref +++ b/check/internal/internal.ref @@ -10,19 +10,29 @@ ./examples/docs/exported_values/code_constructs/function/function_lib.mli:7: unused +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:10: F.unused +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required: Should not be detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required: Should not be detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement +./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused +./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/module/module_lib.mli:6: M.unused +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Should not be detected +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Should not be detected +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected @@ -37,7 +47,11 @@ ./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:9: add_index +./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:2: max: Should not be detected +./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:3: min: Should not be detected ./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.mli:38: internally_used_f: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused ./examples/using_dune/reduced_lib/reduced_lib.mli:3: Values.used_by_API @@ -48,18 +62,38 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:19: Values_in_submodules.Exported.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:27: Values_in_submodules_no_intf.Exported.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:28: Values_in_submodules_no_intf.Exported.internally_used +./examples/using_dune/reduced_lib/values.mli:1: used: Should not be detected +./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values.mli:3: internally_used: Should not be detected +./examples/using_dune/reduced_lib/values.mli:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:7: lib_internal_unused +./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused +./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused +./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_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:3: internally_used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun +./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 ./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure +./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 @@ -67,12 +101,18 @@ ./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:3: internally_used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun +./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 ./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure +./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 @@ -81,7 +121,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 @@ -98,25 +139,39 @@ ./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: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 +./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 ./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 -------------------------------------------------------------------------------- @@ -126,27 +181,23 @@ Nothing else to report in this section ./examples/docs/methods/code_constructs/class/class_bin.ml:2: unused_class#unused_method ./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#reset -./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#unused - +./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#unused: Not detected ./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:2: unused_class#unused_method ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#reset ./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory#unused_method -./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#reset - +./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#reset: Not detected ./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj#unused_method -./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#reset - +./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#reset: Not detected ./examples/docs/methods/code_constructs/inheritance/inheritance_lib.mli:2: parent#unused ./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_lib.mli:2: stack#reset -./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#unused -./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#used_by_alias: Should not be detected +./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#unused: Not detected ./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding#m: Not detected ./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m -./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 @@ -156,15 +207,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 @@ -172,15 +222,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 @@ -440,6 +489,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 @@ -570,6 +621,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 @@ -671,7 +723,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 549 -Success: 542 -Failed: 7 -Ratio: 98.7249544627% +Total: 610 +Success: 521 +Failed: 89 +Ratio: 85.4098360656% diff --git a/check/threshold-1/threshold-1.ref b/check/threshold-1/threshold-1.ref index eb6e1268..dc510dd0 100644 --- a/check/threshold-1/threshold-1.ref +++ b/check/threshold-1/threshold-1.ref @@ -10,19 +10,29 @@ ./examples/docs/exported_values/code_constructs/function/function_lib.mli:7: unused +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:10: F.unused +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required: Should not be detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required: Should not be detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement +./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused +./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/module/module_lib.mli:6: M.unused +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Should not be detected +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Should not be detected +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected @@ -37,7 +47,11 @@ ./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:9: add_index +./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:2: max: Should not be detected +./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:3: min: Should not be detected ./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.mli:38: internally_used_f: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused ./examples/using_dune/reduced_lib/reduced_lib.mli:3: Values.used_by_API @@ -48,18 +62,38 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:19: Values_in_submodules.Exported.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:27: Values_in_submodules_no_intf.Exported.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:28: Values_in_submodules_no_intf.Exported.internally_used +./examples/using_dune/reduced_lib/values.mli:1: used: Should not be detected +./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values.mli:3: internally_used: Should not be detected +./examples/using_dune/reduced_lib/values.mli:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:7: lib_internal_unused +./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused +./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused +./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_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:3: internally_used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun +./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 ./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure +./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 @@ -67,12 +101,18 @@ ./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:3: internally_used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun +./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 ./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure +./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 @@ -81,7 +121,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 @@ -98,24 +139,39 @@ ./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: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 +./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 ./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 -------- @@ -128,32 +184,28 @@ ./examples/docs/exported_values/code_constructs/function/function_lib.mli:9: do_nothing ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:8: F.externally_used -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used: Not detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required: Not detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required: Not detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:19: External_param.used_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:20: External_param.unused_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:24: Internal_app.externally_used -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used - +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Not detected ./examples/docs/exported_values/code_constructs/include/include_lib.ml:3: Original.used_directly ./examples/docs/exported_values/code_constructs/include/include_lib.ml:4: Original.used_indirectly ./examples/docs/exported_values/code_constructs/include/include_lib.ml:14: Redefine.used_directly ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:3: Original.used_directly ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:4: Original.used_indirectly -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement - +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Not detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:17: M_redef.externally_used -./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used - +./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Not detected ./examples/docs/exported_values/code_constructs/module/module_lib.mli:4: M.externally_used -./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used - +./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used: Not detected ./examples/docs/exported_values/hello_world/hello_world_lib.mli:2: hello ./examples/docs/exported_values/hello_world/hello_world_lib.mli:3: goodbye -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Not detected +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Not detected ./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:2: hello ./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:3: goodbye @@ -184,6 +236,7 @@ ./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_bin.ml:2: push_n_times +./examples/docs/methods/limitations/alias/alias_lib.mli:2: original: Should not be detected ./examples/docs/methods/limitations/alias/alias_lib.mli:8: alias ./examples/docs/optional_arguments/code_constructs/external_app/external_app_lib.mli:2: max @@ -191,9 +244,10 @@ ./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:2: map_with_index -./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:2: max -./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:3: min - +./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:2: max: Not detected +./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:3: min: Not detected +./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:2: max: Should not be detected +./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:3: min: Should not be detected ./examples/docs/optional_arguments/code_constructs/partial_app/partial_app_bin.ml:2: sum ./examples/docs/optional_arguments/code_constructs/total_app/total_app_bin.ml:2: sum @@ -242,8 +296,10 @@ ./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: exported_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 @@ -255,44 +311,69 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:20: Values_in_submodules.Exported.externally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:26: Values_in_submodules_no_intf.Exported.used ./examples/using_dune/reduced_lib/reduced_lib.mli:29: Values_in_submodules_no_intf.Exported.externally_used -./examples/using_dune/reduced_lib/values.mli:2: used_by_API -./examples/using_dune/reduced_lib/values.mli:4: externally_used -./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used +./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Not detected +./examples/using_dune/reduced_lib/values.mli:4: externally_used: Not detected +./examples/using_dune/reduced_lib/values.mli:6: lib_internal_used: Should not be detected +./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used: Not detected ./examples/using_dune/reduced_lib/values.mli:9: lib_internal_externally_used -./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API -./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used -./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used +./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:10: Exported.lib_internal_externally_used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:9: Exported.lib_internal_internally_used ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:10: Exported.lib_internal_externally_used -./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API -./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used +./examples/using_dune/reduced_lib/values_no_intf.ml:1: used: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Not detected ./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used ./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_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/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: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 ./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/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_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 @@ -310,27 +391,46 @@ ./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/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: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 ./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/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_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 @@ -351,9 +451,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 @@ -368,25 +467,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 @@ -397,8 +495,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 - +./examples/using_make/variant.mli:5: f: Not detected Nothing else to report in this section -------------------------------------------------------------------------------- @@ -408,27 +505,23 @@ Nothing else to report in this section ./examples/docs/methods/code_constructs/class/class_bin.ml:2: unused_class#unused_method ./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#reset -./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#unused - +./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#unused: Not detected ./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:2: unused_class#unused_method ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#reset ./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory#unused_method -./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#reset - +./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#reset: Not detected ./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj#unused_method -./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#reset - +./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#reset: Not detected ./examples/docs/methods/code_constructs/inheritance/inheritance_lib.mli:2: parent#unused ./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_lib.mli:2: stack#reset -./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#unused -./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#used_by_alias: Should not be detected +./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#unused: Not detected ./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding#m: Not detected ./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m -./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 @@ -438,15 +531,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 @@ -454,15 +546,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 @@ -492,20 +583,17 @@ Nothing else to report in this section ./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#pop ./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#push -./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#used_by_requirement - +./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#used_by_requirement: Not detected ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#peek ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#pop ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#push -./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#peek -./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#pop -./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#push - -./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#peek -./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#pop -./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#push - +./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#peek: Not detected +./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#pop: Not detected +./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#push: Not detected +./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#peek: Not detected +./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#pop: Not detected +./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#push: Not detected ./examples/docs/methods/code_constructs/inheritance/inheritance_lib.mli:2: parent#used ./examples/docs/methods/code_constructs/inheritance/inheritance_lib.mli:2: parent#used_by_child @@ -513,43 +601,41 @@ Nothing else to report in this section ./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_lib.mli:2: stack#pop ./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_lib.mli:2: stack#push -./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#used +./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#used: Not detected ./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#used_by_alias: 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.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 @@ -896,6 +982,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 @@ -1026,6 +1114,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 @@ -1127,7 +1216,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 929 -Success: 921 -Failed: 8 -Ratio: 99.1388589882% +Total: 1041 +Success: 823 +Failed: 218 +Ratio: 79.0585975024% 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 f3f1da53..39884f21 100644 --- a/check/threshold-3-0.5/threshold-3-0.5.ref +++ b/check/threshold-3-0.5/threshold-3-0.5.ref @@ -10,19 +10,29 @@ ./examples/docs/exported_values/code_constructs/function/function_lib.mli:7: unused +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:10: F.unused +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required: Should not be detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required: Should not be detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement +./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused +./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/module/module_lib.mli:6: M.unused +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Should not be detected +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Should not be detected +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected @@ -37,7 +47,11 @@ ./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:9: add_index +./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:2: max: Should not be detected +./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:3: min: Should not be detected ./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.mli:38: internally_used_f: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused ./examples/using_dune/reduced_lib/reduced_lib.mli:3: Values.used_by_API @@ -48,18 +62,38 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:19: Values_in_submodules.Exported.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:27: Values_in_submodules_no_intf.Exported.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:28: Values_in_submodules_no_intf.Exported.internally_used +./examples/using_dune/reduced_lib/values.mli:1: used: Should not be detected +./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values.mli:3: internally_used: Should not be detected +./examples/using_dune/reduced_lib/values.mli:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:7: lib_internal_unused +./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused +./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused +./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_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:3: internally_used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun +./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 ./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure +./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 @@ -67,12 +101,18 @@ ./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:3: internally_used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun +./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 ./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure +./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 @@ -81,7 +121,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 @@ -98,24 +139,39 @@ ./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: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 +./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 ./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 -------- @@ -128,32 +184,28 @@ ./examples/docs/exported_values/code_constructs/function/function_lib.mli:9: do_nothing ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:8: F.externally_used -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used: Not detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required: Not detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required: Not detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:19: External_param.used_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:20: External_param.unused_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:24: Internal_app.externally_used -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used - +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Not detected ./examples/docs/exported_values/code_constructs/include/include_lib.ml:3: Original.used_directly ./examples/docs/exported_values/code_constructs/include/include_lib.ml:4: Original.used_indirectly ./examples/docs/exported_values/code_constructs/include/include_lib.ml:14: Redefine.used_directly ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:3: Original.used_directly ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:4: Original.used_indirectly -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement - +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Not detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:17: M_redef.externally_used -./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used - +./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Not detected ./examples/docs/exported_values/code_constructs/module/module_lib.mli:4: M.externally_used -./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used - +./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used: Not detected ./examples/docs/exported_values/hello_world/hello_world_lib.mli:2: hello ./examples/docs/exported_values/hello_world/hello_world_lib.mli:3: goodbye -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Not detected +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Not detected ./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:2: hello ./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:3: goodbye @@ -184,6 +236,7 @@ ./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_bin.ml:2: push_n_times +./examples/docs/methods/limitations/alias/alias_lib.mli:2: original: Should not be detected ./examples/docs/methods/limitations/alias/alias_lib.mli:8: alias ./examples/docs/optional_arguments/code_constructs/external_app/external_app_lib.mli:2: max @@ -191,9 +244,10 @@ ./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:2: map_with_index -./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:2: max -./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:3: min - +./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:2: max: Not detected +./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:3: min: Not detected +./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:2: max: Should not be detected +./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:3: min: Should not be detected ./examples/docs/optional_arguments/code_constructs/partial_app/partial_app_bin.ml:2: sum ./examples/docs/optional_arguments/code_constructs/total_app/total_app_bin.ml:2: sum @@ -242,8 +296,10 @@ ./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: exported_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 @@ -255,44 +311,69 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:20: Values_in_submodules.Exported.externally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:26: Values_in_submodules_no_intf.Exported.used ./examples/using_dune/reduced_lib/reduced_lib.mli:29: Values_in_submodules_no_intf.Exported.externally_used -./examples/using_dune/reduced_lib/values.mli:2: used_by_API -./examples/using_dune/reduced_lib/values.mli:4: externally_used -./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used +./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Not detected +./examples/using_dune/reduced_lib/values.mli:4: externally_used: Not detected +./examples/using_dune/reduced_lib/values.mli:6: lib_internal_used: Should not be detected +./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used: Not detected ./examples/using_dune/reduced_lib/values.mli:9: lib_internal_externally_used -./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API -./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used -./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used +./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:10: Exported.lib_internal_externally_used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:9: Exported.lib_internal_internally_used ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:10: Exported.lib_internal_externally_used -./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API -./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used +./examples/using_dune/reduced_lib/values_no_intf.ml:1: used: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Not detected ./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used ./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_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/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: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 ./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/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_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 @@ -310,27 +391,46 @@ ./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/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: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 ./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/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_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 @@ -351,9 +451,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 @@ -368,25 +467,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 @@ -397,97 +495,116 @@ ./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/docs/exported_values/hello_world/hello_world_lib.mli:4: world -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Not detected ./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:4: world -./examples/docs/methods/limitations/alias/alias_lib.mli:2: original - -./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:2: max -./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:3: min - +./examples/docs/methods/limitations/alias/alias_lib.mli:2: original: Not detected +./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:2: max: Not detected +./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:3: min: Not detected ./examples/docs/optional_arguments/limitations/relaying/relaying_bin.ml:2: f -./examples/using_dune/preprocessed_lib/preprocessed.mli:2: used -./examples/using_dune/preprocessed_lib/preprocessed.mli:31: exported_f -./examples/using_dune/preprocessed_lib/preprocessed.mli:38: internally_used_f +./examples/using_dune/preprocessed_lib/preprocessed.mli:2: used: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate: Should not be detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:31: exported_f: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:38: internally_used_f: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:44: externally_used_f ./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:59: internally_used_f ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:64: externally_used_f -./examples/using_dune/reduced_lib/values.mli:1: used -./examples/using_dune/reduced_lib/values.mli:3: internally_used -./examples/using_dune/reduced_lib/values.mli:6: lib_internal_used -./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used -./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used -./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used +./examples/using_dune/reduced_lib/values.mli:1: used: Not detected +./examples/using_dune/reduced_lib/values.mli:3: internally_used: Not detected +./examples/using_dune/reduced_lib/values.mli:6: lib_internal_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:7: Exported.lib_internal_used -./examples/using_dune/reduced_lib/values_no_intf.ml:1: used -./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used +./examples/using_dune/reduced_lib/values_no_intf.ml:1: used: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used: Not detected ./examples/using_dune/reduced_lib/values_no_intf.ml:10: lib_internal_used -./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/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:6: used_fun_with_single_sometimes_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: Not detected ./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/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: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/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:6: used_fun_with_single_sometimes_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: Not detected ./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/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: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 @@ -502,16 +619,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 -------- @@ -527,21 +644,23 @@ ./examples/docs/methods/code_constructs/object_type/object_type_lib.mli:9: int_stack +./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 -------------------------------------------------------------------------------- @@ -551,27 +670,23 @@ Nothing else to report in this section ./examples/docs/methods/code_constructs/class/class_bin.ml:2: unused_class#unused_method ./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#reset -./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#unused - +./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#unused: Not detected ./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:2: unused_class#unused_method ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#reset ./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory#unused_method -./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#reset - +./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#reset: Not detected ./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj#unused_method -./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#reset - +./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#reset: Not detected ./examples/docs/methods/code_constructs/inheritance/inheritance_lib.mli:2: parent#unused ./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_lib.mli:2: stack#reset -./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#unused -./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#used_by_alias: Should not be detected +./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#unused: Not detected ./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding#m: Not detected ./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m -./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 @@ -581,15 +696,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 @@ -597,15 +711,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 @@ -635,20 +748,17 @@ Nothing else to report in this section ./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#pop ./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#push -./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#used_by_requirement - +./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#used_by_requirement: Not detected ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#peek ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#pop ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#push -./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#peek -./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#pop -./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#push - -./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#peek -./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#pop -./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#push - +./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#peek: Not detected +./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#pop: Not detected +./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#push: Not detected +./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#peek: Not detected +./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#pop: Not detected +./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#push: Not detected ./examples/docs/methods/code_constructs/inheritance/inheritance_lib.mli:2: parent#used ./examples/docs/methods/code_constructs/inheritance/inheritance_lib.mli:2: parent#used_by_child @@ -656,43 +766,41 @@ Nothing else to report in this section ./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_lib.mli:2: stack#pop ./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_lib.mli:2: stack#push -./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#used +./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#used: Not detected ./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#used_by_alias: 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.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 @@ -724,7 +832,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 @@ -734,11 +842,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 @@ -746,11 +853,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 @@ -1121,6 +1227,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 @@ -1220,9 +1328,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) -------- @@ -1351,6 +1457,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 @@ -1535,7 +1642,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 1251 -Success: 1243 -Failed: 8 -Ratio: 99.3605115907% +Total: 1392 +Success: 1069 +Failed: 323 +Ratio: 76.7959770115% diff --git a/dead_code_analyzer.opam b/dead_code_analyzer.opam index 16050699..2c8e9350 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 3bc414fe..70c47b7a 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 600f221b..fe7df2b4 100644 --- a/src/deadCode.ml +++ b/src/deadCode.ml @@ -112,8 +112,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; @@ -302,7 +306,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 && sections.style.seq -> begin match c_lhs.pat_desc with | Tpat_value tpat_arg -> @@ -502,15 +506,31 @@ let load_file fn state = 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); @@ -523,14 +543,12 @@ let load_file fn state = String.equal (Utils.Filepath.unit pos.pos_fname) sourceunit in List.filter_map - (fun (vd1, vd2) -> - let loc1 = vd1.Types.val_loc.Location.loc_start in - let loc2 = vd2.Types.val_loc.Location.loc_start in + (fun (loc1, loc2) -> if in_sourceunit loc1 || in_sourceunit loc2 then Some (loc1, loc2) else None ) - cmt_value_dependencies + value_dep else [] in eof loc_dep diff --git a/src/deadLexiFi.ml b/src/deadLexiFi.ml index 8b06f971..6f1446ea 100644 --- a/src/deadLexiFi.ml +++ b/src/deadLexiFi.ml @@ -47,7 +47,8 @@ module Extension = struct let sig_value (value : Types.value_description) = 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 diff --git a/src/utils.ml b/src/utils.ml index bb524456..8c015531 100644 --- a/src/utils.ml +++ b/src/utils.ml @@ -10,7 +10,7 @@ module Filepath = struct | _ -> filepath let unit filepath = - Unit_info.modname_from_source filepath + Unit_info.lax_modname_from_source filepath type kind = | Cmi From 1c996525b7acfb91fae444cb53b4a371c1b5d207 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 02/15] [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 | 8 ++++++++ src/utils.mli | 9 +++++++++ 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/deadCode.ml b/src/deadCode.ml index fe7df2b4..277600ea 100644 --- a/src/deadCode.ml +++ b/src/deadCode.ml @@ -98,7 +98,7 @@ let rec collect_export ~context path u stock = function | Sig_modtype _, _ -> in_modtype, In_modtyp (id, loc) | _, _ -> stock, In_module (id, loc) in - DeadMod.sign t + Utils.signature_of_modtype t |> List.iter (collect_export ~context (id :: path) u stock) | _ -> () @@ -195,9 +195,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 84742948..6d0fd9a3 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 8c015531..59bbb0a0 100644 --- a/src/utils.ml +++ b/src/utils.ml @@ -31,4 +31,12 @@ module Filepath = struct else Ignore end +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 + | _ -> [] + module StringSet = Set.Make(String) diff --git a/src/utils.mli b/src/utils.mli index f9fe1424..86407a5d 100644 --- a/src/utils.mli +++ b/src/utils.mli @@ -22,4 +22,13 @@ module Filepath : sig Other kinds are self explanatory. *) end +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. *) + module StringSet : Set.S with type elt = String.t From 50a08c1addc3ad6c467a5177b08cd36a81edcd04 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 03/15] [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 | 167 +++----- check/internal/internal.ref | 167 +++----- check/threshold-1/threshold-1.ref | 407 ++++++++---------- check/threshold-3-0.5/threshold-3-0.5.ref | 497 +++++++++------------- docs/USAGE.md | 14 +- docs/exported_values/HELLO_WORLD.md | 33 +- src/config/config.ml | 2 +- src/deadCode.ml | 62 +-- src/deadCommon.ml | 2 +- src/state/file_infos.ml | 246 ++++------- src/state/file_infos.mli | 21 +- src/state/state.ml | 10 +- src/utils.ml | 4 +- src/utils.mli | 2 +- 15 files changed, 677 insertions(+), 959 deletions(-) diff --git a/README.md b/README.md index 14812492..1e77bcae 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Dead-code analyzer for OCaml The tool assumes that **.mli** files are compiled with **-keep-locs** (activated by default) and **.ml** files with **-bin-annot**. -Tracked elements of code are collected by reading **.cmi** and **.cmt** files. +Tracked elements of code are collected by reading **.cmti** and **.cmt** files. Uses of such elements are collected by reading typed trees from **.cmt** files diff --git a/check/classic/classic.ref b/check/classic/classic.ref index 17b34ba4..6307404f 100644 --- a/check/classic/classic.ref +++ b/check/classic/classic.ref @@ -1,13 +1,9 @@ .> UNUSED EXPORTED VALUES: ========================= -./examples/docs/coding_style/bind/bind.ml:2: v - -./examples/docs/coding_style/opt/opt.ml:14: add_index_to_negative - -./examples/docs/coding_style/seq/seq.ml:2: compute_answer - -./examples/docs/coding_style/unit/unit.ml:2: compute_answer - +./examples/docs/coding_style/bind/bind.ml:2: v: Not detected +./examples/docs/coding_style/opt/opt.ml:14: add_index_to_negative: Not detected +./examples/docs/coding_style/seq/seq.ml:2: compute_answer: Not detected +./examples/docs/coding_style/unit/unit.ml:2: compute_answer: Not detected ./examples/docs/exported_values/code_constructs/function/function_lib.mli:7: unused ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used @@ -17,13 +13,10 @@ ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused -./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused -./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused - -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement - +./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement: Not detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused @@ -34,28 +27,19 @@ ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:41: public_method_label: Should not be detected ./examples/docs/exported_values/limitations/sigincl/sigincl_lib.mli:10: I.x: Should not be detected -./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory - -./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj - -./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding -./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory - -./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:9: add_index - +./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory: Not detected +./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj: Not detected +./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding: Not detected +./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory: Not detected +./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:9: add_index: Not detected ./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:2: max ./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:3: min ./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.mli:38: internally_used_f -./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/reduced_lib/reduced_lib.mli:3: Values.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:4: Values.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:10: Values_no_intf.used_by_API @@ -76,13 +60,8 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused - +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_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 @@ -97,12 +76,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 @@ -117,38 +95,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 @@ -161,9 +136,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 @@ -172,11 +147,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 @@ -185,16 +160,16 @@ Nothing else to report in this section .> UNUSED METHODS: ================= -./examples/docs/methods/code_constructs/class/class_bin.ml:2: unused_class#unused_method +./examples/docs/methods/code_constructs/class/class_bin.ml:2: unused_class#unused_method: Not detected ./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#reset ./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#unused: Not detected -./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:2: unused_class#unused_method +./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:2: unused_class#unused_method: Not detected ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#reset -./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory#unused_method +./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory#unused_method: Not detected ./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#reset: Not detected -./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj#unused_method +./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj#unused_method: Not detected ./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#reset: Not detected ./examples/docs/methods/code_constructs/inheritance/inheritance_lib.mli:2: parent#unused @@ -202,11 +177,9 @@ Nothing else to report in this section ./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#unused: Not detected ./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding#m: Not detected -./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m - +./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m: Not detected ./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 @@ -237,22 +210,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 @@ -275,10 +249,9 @@ Nothing else to report in this section ./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_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 @@ -730,7 +703,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 610 -Success: 565 -Failed: 45 -Ratio: 92.6229508197% +Total: 602 +Success: 500 +Failed: 102 +Ratio: 83.0564784053% diff --git a/check/internal/internal.ref b/check/internal/internal.ref index 5797a18e..c3867a58 100644 --- a/check/internal/internal.ref +++ b/check/internal/internal.ref @@ -1,13 +1,9 @@ .> UNUSED EXPORTED VALUES: ========================= -./examples/docs/coding_style/bind/bind.ml:2: v - -./examples/docs/coding_style/opt/opt.ml:14: add_index_to_negative - -./examples/docs/coding_style/seq/seq.ml:2: compute_answer - -./examples/docs/coding_style/unit/unit.ml:2: compute_answer - +./examples/docs/coding_style/bind/bind.ml:2: v: Not detected +./examples/docs/coding_style/opt/opt.ml:14: add_index_to_negative: Not detected +./examples/docs/coding_style/seq/seq.ml:2: compute_answer: Not detected +./examples/docs/coding_style/unit/unit.ml:2: compute_answer: Not detected ./examples/docs/exported_values/code_constructs/function/function_lib.mli:7: unused ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used: Should not be detected @@ -17,13 +13,10 @@ ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused -./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused -./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused - -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement - +./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement: Not detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused @@ -33,27 +26,18 @@ ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Should not be detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Should not be detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:41: public_method_label: Should not be detected ./examples/docs/exported_values/limitations/sigincl/sigincl_lib.mli:10: I.x: Should not be detected -./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory - -./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj - -./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding -./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory - -./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:9: add_index - +./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory: Not detected +./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj: Not detected +./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding: Not detected +./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory: Not detected +./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:9: add_index: Not detected ./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:2: max: Should not be detected ./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:3: min: Should not be detected ./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.mli:38: internally_used_f: 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/reduced_lib/reduced_lib.mli:3: Values.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:4: Values.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:10: Values_no_intf.used_by_API @@ -74,13 +58,8 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused - +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_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 @@ -94,12 +73,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 @@ -113,38 +91,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: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 @@ -157,20 +132,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 -------------------------------------------------------------------------------- @@ -178,16 +153,16 @@ Nothing else to report in this section .> UNUSED METHODS: ================= -./examples/docs/methods/code_constructs/class/class_bin.ml:2: unused_class#unused_method +./examples/docs/methods/code_constructs/class/class_bin.ml:2: unused_class#unused_method: Not detected ./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#reset ./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#unused: Not detected -./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:2: unused_class#unused_method +./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:2: unused_class#unused_method: Not detected ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#reset -./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory#unused_method +./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory#unused_method: Not detected ./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#reset: Not detected -./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj#unused_method +./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj#unused_method: Not detected ./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#reset: Not detected ./examples/docs/methods/code_constructs/inheritance/inheritance_lib.mli:2: parent#unused @@ -195,11 +170,9 @@ Nothing else to report in this section ./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#unused: Not detected ./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding#m: Not detected -./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m - +./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m: Not detected ./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 @@ -230,22 +203,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 @@ -268,10 +242,9 @@ Nothing else to report in this section ./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_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 @@ -723,7 +696,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 610 -Success: 521 -Failed: 89 -Ratio: 85.4098360656% +Total: 602 +Success: 456 +Failed: 146 +Ratio: 75.7475083056% diff --git a/check/threshold-1/threshold-1.ref b/check/threshold-1/threshold-1.ref index dc510dd0..cdfd09ea 100644 --- a/check/threshold-1/threshold-1.ref +++ b/check/threshold-1/threshold-1.ref @@ -1,13 +1,9 @@ .> UNUSED EXPORTED VALUES: ========================= -./examples/docs/coding_style/bind/bind.ml:2: v - -./examples/docs/coding_style/opt/opt.ml:14: add_index_to_negative - -./examples/docs/coding_style/seq/seq.ml:2: compute_answer - -./examples/docs/coding_style/unit/unit.ml:2: compute_answer - +./examples/docs/coding_style/bind/bind.ml:2: v: Not detected +./examples/docs/coding_style/opt/opt.ml:14: add_index_to_negative: Not detected +./examples/docs/coding_style/seq/seq.ml:2: compute_answer: Not detected +./examples/docs/coding_style/unit/unit.ml:2: compute_answer: Not detected ./examples/docs/exported_values/code_constructs/function/function_lib.mli:7: unused ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used: Should not be detected @@ -17,13 +13,10 @@ ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused -./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused -./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused - -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement - +./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement: Not detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused @@ -33,27 +26,18 @@ ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Should not be detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Should not be detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:41: public_method_label: Should not be detected ./examples/docs/exported_values/limitations/sigincl/sigincl_lib.mli:10: I.x: Should not be detected -./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory - -./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj - -./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding -./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory - -./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:9: add_index - +./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory: Not detected +./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj: Not detected +./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding: Not detected +./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory: Not detected +./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:9: add_index: Not detected ./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:2: max: Should not be detected ./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:3: min: Should not be detected ./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.mli:38: internally_used_f: 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/reduced_lib/reduced_lib.mli:3: Values.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:4: Values.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:10: Values_no_intf.used_by_API @@ -74,13 +58,8 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused - +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_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 @@ -94,12 +73,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 @@ -113,38 +91,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: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 @@ -157,28 +132,27 @@ ./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 -------- .>-> ALMOST UNUSED EXPORTED VALUES: Called 1 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./examples/docs/coding_style/opt/opt.ml:2: map_with_index_on_negative - +./examples/docs/coding_style/opt/opt.ml:2: map_with_index_on_negative: Not detected ./examples/docs/exported_values/code_constructs/function/function_lib.mli:3: memoize ./examples/docs/exported_values/code_constructs/function/function_lib.mli:5: heavy_computation ./examples/docs/exported_values/code_constructs/function/function_lib.mli:9: do_nothing @@ -191,12 +165,11 @@ ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:20: External_param.unused_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:24: Internal_app.externally_used ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Not detected -./examples/docs/exported_values/code_constructs/include/include_lib.ml:3: Original.used_directly -./examples/docs/exported_values/code_constructs/include/include_lib.ml:4: Original.used_indirectly -./examples/docs/exported_values/code_constructs/include/include_lib.ml:14: Redefine.used_directly - -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:3: Original.used_directly -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:4: Original.used_indirectly +./examples/docs/exported_values/code_constructs/include/include_lib.ml:3: Original.used_directly: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:4: Original.used_indirectly: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:14: Redefine.used_directly: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:3: Original.used_directly: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:4: Original.used_indirectly: Not detected ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Not detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:17: M_redef.externally_used ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Not detected @@ -206,10 +179,9 @@ ./examples/docs/exported_values/hello_world/hello_world_lib.mli:3: goodbye ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Not detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Not detected -./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:2: hello -./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:3: goodbye - -./examples/docs/fields_and_constructors/code_constructs/extensible_variant/extensible_variant_bin.ml:5: to_string_opt +./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:2: hello: Not detected +./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:3: goodbye: Not detected +./examples/docs/fields_and_constructors/code_constructs/extensible_variant/extensible_variant_bin.ml:5: to_string_opt: Not detected ./examples/docs/fields_and_constructors/code_constructs/extensible_variant/extensible_variant_lib.mli:7: to_string_opt ./examples/docs/fields_and_constructors/code_constructs/gadt/gadt_lib.mli:6: gadt_of_int @@ -220,40 +192,29 @@ ./examples/docs/fields_and_constructors/code_constructs/polymorphic_variant/polymorphic_variant_lib.mli:4: poly_of_int ./examples/docs/fields_and_constructors/code_constructs/polymorphic_variant/polymorphic_variant_lib.mli:6: float_opt_of_poly -./examples/docs/methods/code_constructs/class/class_bin.ml:4: push_n_times - -./examples/docs/methods/code_constructs/class_type/class_type_bin.ml:4: push_n_times - +./examples/docs/methods/code_constructs/class/class_bin.ml:4: push_n_times: Not detected +./examples/docs/methods/code_constructs/class_type/class_type_bin.ml:4: push_n_times: Not detected ./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj -./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:4: push_n_times - -./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:4: push_n_times - -./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:4: push_n_times - -./examples/docs/methods/code_constructs/object_type/object_type_bin.ml:4: push_n_times - -./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_bin.ml:2: push_n_times - +./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:4: push_n_times: Not detected +./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:4: push_n_times: Not detected +./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:4: push_n_times: Not detected +./examples/docs/methods/code_constructs/object_type/object_type_bin.ml:4: push_n_times: Not detected +./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_bin.ml:2: push_n_times: Not detected ./examples/docs/methods/limitations/alias/alias_lib.mli:2: original: Should not be detected ./examples/docs/methods/limitations/alias/alias_lib.mli:8: alias ./examples/docs/optional_arguments/code_constructs/external_app/external_app_lib.mli:2: max ./examples/docs/optional_arguments/code_constructs/external_app/external_app_lib.mli:3: min -./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:2: map_with_index - +./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:2: map_with_index: Not detected ./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:2: max: Not detected ./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:3: min: Not detected ./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:2: max: Should not be detected ./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:3: min: Should not be detected -./examples/docs/optional_arguments/code_constructs/partial_app/partial_app_bin.ml:2: sum - -./examples/docs/optional_arguments/code_constructs/total_app/total_app_bin.ml:2: sum - -./examples/docs/optional_arguments/limitations/relaying/relaying_bin.ml:4: g - +./examples/docs/optional_arguments/code_constructs/partial_app/partial_app_bin.ml:2: sum: Not detected +./examples/docs/optional_arguments/code_constructs/total_app/total_app_bin.ml:2: sum: Not detected +./examples/docs/optional_arguments/limitations/relaying/relaying_bin.ml:4: g: Not detected ./examples/using_dune/bin/use_preprocessed_lib/use_preprocessed.mli:1: mark_used ./examples/using_dune/bin/use_preprocessed_lib/use_preprocessed_lib.mli:1: mark_used ./examples/using_dune/bin/use_preprocessed_lib/use_preprocessed_no_intf.mli:1: mark_used @@ -300,9 +261,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: exported_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/reduced_lib/reduced_lib.mli:2: Values.used ./examples/using_dune/reduced_lib/reduced_lib.mli:5: Values.externally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:9: Values_no_intf.used @@ -321,19 +281,14 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:10: Exported.lib_internal_externally_used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Not detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Not detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:9: Exported.lib_internal_internally_used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:10: Exported.lib_internal_externally_used -./examples/using_dune/reduced_lib/values_no_intf.ml:1: used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:9: Exported.lib_internal_internally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:10: Exported.lib_internal_externally_used: Not detected ./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used -./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_externally_used - +./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_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 @@ -352,8 +307,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 @@ -375,22 +329,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 @@ -409,8 +362,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 @@ -432,69 +384,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 -------------------------------------------------------------------------------- @@ -502,16 +450,16 @@ Nothing else to report in this section .> UNUSED METHODS: ================= -./examples/docs/methods/code_constructs/class/class_bin.ml:2: unused_class#unused_method +./examples/docs/methods/code_constructs/class/class_bin.ml:2: unused_class#unused_method: Not detected ./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#reset ./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#unused: Not detected -./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:2: unused_class#unused_method +./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:2: unused_class#unused_method: Not detected ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#reset -./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory#unused_method +./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory#unused_method: Not detected ./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#reset: Not detected -./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj#unused_method +./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj#unused_method: Not detected ./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#reset: Not detected ./examples/docs/methods/code_constructs/inheritance/inheritance_lib.mli:2: parent#unused @@ -519,11 +467,9 @@ Nothing else to report in this section ./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#unused: Not detected ./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding#m: Not detected -./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m - +./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m: Not detected ./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 @@ -554,22 +500,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 @@ -605,9 +552,8 @@ Nothing else to report in this section ./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#used_by_alias: Not detected ./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 @@ -637,29 +583,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 @@ -680,10 +625,9 @@ Nothing else to report in this section ./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_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 @@ -761,12 +705,11 @@ Nothing else to report in this section ./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: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 @@ -1216,7 +1159,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 1041 -Success: 823 -Failed: 218 -Ratio: 79.0585975024% +Total: 1029 +Success: 653 +Failed: 376 +Ratio: 63.4596695821% 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 39884f21..b340e811 100644 --- a/check/threshold-3-0.5/threshold-3-0.5.ref +++ b/check/threshold-3-0.5/threshold-3-0.5.ref @@ -1,13 +1,9 @@ .> UNUSED EXPORTED VALUES: ========================= -./examples/docs/coding_style/bind/bind.ml:2: v - -./examples/docs/coding_style/opt/opt.ml:14: add_index_to_negative - -./examples/docs/coding_style/seq/seq.ml:2: compute_answer - -./examples/docs/coding_style/unit/unit.ml:2: compute_answer - +./examples/docs/coding_style/bind/bind.ml:2: v: Not detected +./examples/docs/coding_style/opt/opt.ml:14: add_index_to_negative: Not detected +./examples/docs/coding_style/seq/seq.ml:2: compute_answer: Not detected +./examples/docs/coding_style/unit/unit.ml:2: compute_answer: Not detected ./examples/docs/exported_values/code_constructs/function/function_lib.mli:7: unused ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used: Should not be detected @@ -17,13 +13,10 @@ ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused -./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused -./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused - -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement - +./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement: Not detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused @@ -33,27 +26,18 @@ ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Should not be detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Should not be detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected -./examples/docs/exported_values/limitations/incl_same_name/oo.mli:41: public_method_label: Should not be detected ./examples/docs/exported_values/limitations/sigincl/sigincl_lib.mli:10: I.x: Should not be detected -./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory - -./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj - -./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding -./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory - -./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:9: add_index - +./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory: Not detected +./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj: Not detected +./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding: Not detected +./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory: Not detected +./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:9: add_index: Not detected ./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:2: max: Should not be detected ./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:3: min: Should not be detected ./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.mli:38: internally_used_f: 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/reduced_lib/reduced_lib.mli:3: Values.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:4: Values.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:10: Values_no_intf.used_by_API @@ -74,13 +58,8 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused - +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_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 @@ -94,12 +73,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 @@ -113,38 +91,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: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 @@ -157,28 +132,27 @@ ./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 -------- .>-> ALMOST UNUSED EXPORTED VALUES: Called 1 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./examples/docs/coding_style/opt/opt.ml:2: map_with_index_on_negative - +./examples/docs/coding_style/opt/opt.ml:2: map_with_index_on_negative: Not detected ./examples/docs/exported_values/code_constructs/function/function_lib.mli:3: memoize ./examples/docs/exported_values/code_constructs/function/function_lib.mli:5: heavy_computation ./examples/docs/exported_values/code_constructs/function/function_lib.mli:9: do_nothing @@ -191,12 +165,11 @@ ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:20: External_param.unused_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:24: Internal_app.externally_used ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Not detected -./examples/docs/exported_values/code_constructs/include/include_lib.ml:3: Original.used_directly -./examples/docs/exported_values/code_constructs/include/include_lib.ml:4: Original.used_indirectly -./examples/docs/exported_values/code_constructs/include/include_lib.ml:14: Redefine.used_directly - -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:3: Original.used_directly -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:4: Original.used_indirectly +./examples/docs/exported_values/code_constructs/include/include_lib.ml:3: Original.used_directly: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:4: Original.used_indirectly: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:14: Redefine.used_directly: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:3: Original.used_directly: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:4: Original.used_indirectly: Not detected ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Not detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:17: M_redef.externally_used ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Not detected @@ -206,10 +179,9 @@ ./examples/docs/exported_values/hello_world/hello_world_lib.mli:3: goodbye ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Not detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Not detected -./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:2: hello -./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:3: goodbye - -./examples/docs/fields_and_constructors/code_constructs/extensible_variant/extensible_variant_bin.ml:5: to_string_opt +./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:2: hello: Not detected +./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:3: goodbye: Not detected +./examples/docs/fields_and_constructors/code_constructs/extensible_variant/extensible_variant_bin.ml:5: to_string_opt: Not detected ./examples/docs/fields_and_constructors/code_constructs/extensible_variant/extensible_variant_lib.mli:7: to_string_opt ./examples/docs/fields_and_constructors/code_constructs/gadt/gadt_lib.mli:6: gadt_of_int @@ -220,40 +192,29 @@ ./examples/docs/fields_and_constructors/code_constructs/polymorphic_variant/polymorphic_variant_lib.mli:4: poly_of_int ./examples/docs/fields_and_constructors/code_constructs/polymorphic_variant/polymorphic_variant_lib.mli:6: float_opt_of_poly -./examples/docs/methods/code_constructs/class/class_bin.ml:4: push_n_times - -./examples/docs/methods/code_constructs/class_type/class_type_bin.ml:4: push_n_times - +./examples/docs/methods/code_constructs/class/class_bin.ml:4: push_n_times: Not detected +./examples/docs/methods/code_constructs/class_type/class_type_bin.ml:4: push_n_times: Not detected ./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj -./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:4: push_n_times - -./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:4: push_n_times - -./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:4: push_n_times - -./examples/docs/methods/code_constructs/object_type/object_type_bin.ml:4: push_n_times - -./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_bin.ml:2: push_n_times - +./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:4: push_n_times: Not detected +./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:4: push_n_times: Not detected +./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:4: push_n_times: Not detected +./examples/docs/methods/code_constructs/object_type/object_type_bin.ml:4: push_n_times: Not detected +./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_bin.ml:2: push_n_times: Not detected ./examples/docs/methods/limitations/alias/alias_lib.mli:2: original: Should not be detected ./examples/docs/methods/limitations/alias/alias_lib.mli:8: alias ./examples/docs/optional_arguments/code_constructs/external_app/external_app_lib.mli:2: max ./examples/docs/optional_arguments/code_constructs/external_app/external_app_lib.mli:3: min -./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:2: map_with_index - +./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:2: map_with_index: Not detected ./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:2: max: Not detected ./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:3: min: Not detected ./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:2: max: Should not be detected ./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:3: min: Should not be detected -./examples/docs/optional_arguments/code_constructs/partial_app/partial_app_bin.ml:2: sum - -./examples/docs/optional_arguments/code_constructs/total_app/total_app_bin.ml:2: sum - -./examples/docs/optional_arguments/limitations/relaying/relaying_bin.ml:4: g - +./examples/docs/optional_arguments/code_constructs/partial_app/partial_app_bin.ml:2: sum: Not detected +./examples/docs/optional_arguments/code_constructs/total_app/total_app_bin.ml:2: sum: Not detected +./examples/docs/optional_arguments/limitations/relaying/relaying_bin.ml:4: g: Not detected ./examples/using_dune/bin/use_preprocessed_lib/use_preprocessed.mli:1: mark_used ./examples/using_dune/bin/use_preprocessed_lib/use_preprocessed_lib.mli:1: mark_used ./examples/using_dune/bin/use_preprocessed_lib/use_preprocessed_no_intf.mli:1: mark_used @@ -300,9 +261,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: exported_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/reduced_lib/reduced_lib.mli:2: Values.used ./examples/using_dune/reduced_lib/reduced_lib.mli:5: Values.externally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:9: Values_no_intf.used @@ -321,19 +281,14 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:10: Exported.lib_internal_externally_used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Not detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Not detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:9: Exported.lib_internal_internally_used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:10: Exported.lib_internal_externally_used -./examples/using_dune/reduced_lib/values_no_intf.ml:1: used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:9: Exported.lib_internal_internally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:10: Exported.lib_internal_externally_used: Not detected ./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used -./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_externally_used - +./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_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 @@ -352,8 +307,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 @@ -375,22 +329,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 @@ -409,8 +362,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 @@ -432,69 +384,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 -------- @@ -503,23 +451,20 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./examples/docs/exported_values/hello_world/hello_world_lib.mli:4: world ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Not detected -./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:4: world - +./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:4: world: Not detected ./examples/docs/methods/limitations/alias/alias_lib.mli:2: original: Not detected ./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:2: max: Not detected ./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:3: min: Not detected -./examples/docs/optional_arguments/limitations/relaying/relaying_bin.ml:2: f - +./examples/docs/optional_arguments/limitations/relaying/relaying_bin.ml:2: f: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:2: used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:31: exported_f: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:38: internally_used_f: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:44: externally_used_f -./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:59: internally_used_f -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:64: externally_used_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/preprocessed_lib/preprocessed_no_intf.ml:59: internally_used_f: Not detected +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:64: externally_used_f: Not detected ./examples/using_dune/reduced_lib/values.mli:1: used: Not detected ./examples/using_dune/reduced_lib/values.mli:3: internally_used: Not detected ./examples/using_dune/reduced_lib/values.mli:6: lib_internal_used: Not detected @@ -528,11 +473,10 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used: Not detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:7: Exported.lib_internal_used +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:7: Exported.lib_internal_used: Not detected ./examples/using_dune/reduced_lib/values_no_intf.ml:1: used: Not detected ./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:10: lib_internal_used - +./examples/using_dune/reduced_lib/values_no_intf.ml:10: lib_internal_used: 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 @@ -566,12 +510,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 @@ -605,32 +548,28 @@ ./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 -------- @@ -645,21 +584,17 @@ ./examples/docs/methods/code_constructs/object_type/object_type_lib.mli:9: int_stack ./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 -------------------------------------------------------------------------------- @@ -667,16 +602,16 @@ Nothing else to report in this section .> UNUSED METHODS: ================= -./examples/docs/methods/code_constructs/class/class_bin.ml:2: unused_class#unused_method +./examples/docs/methods/code_constructs/class/class_bin.ml:2: unused_class#unused_method: Not detected ./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#reset ./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#unused: Not detected -./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:2: unused_class#unused_method +./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:2: unused_class#unused_method: Not detected ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#reset -./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory#unused_method +./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory#unused_method: Not detected ./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#reset: Not detected -./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj#unused_method +./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj#unused_method: Not detected ./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#reset: Not detected ./examples/docs/methods/code_constructs/inheritance/inheritance_lib.mli:2: parent#unused @@ -684,11 +619,9 @@ Nothing else to report in this section ./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#unused: Not detected ./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding#m: Not detected -./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m - +./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m: Not detected ./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 @@ -719,22 +652,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 @@ -770,9 +704,8 @@ Nothing else to report in this section ./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#used_by_alias: Not detected ./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 @@ -802,29 +735,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 -------- @@ -833,8 +765,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 @@ -860,7 +791,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 -------- @@ -882,10 +813,9 @@ Nothing else to report in this section ./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_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 @@ -963,12 +893,11 @@ Nothing else to report in this section ./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: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 @@ -1034,9 +963,8 @@ Nothing else to report in this section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./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_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 @@ -1321,13 +1249,11 @@ Nothing else to report in this section ./examples/using_make/dir/anonFn2.mli:2: ?a (2/3 calls) ./examples/using_make/dir/anonFn2.mli:2: ?b (2/3 calls) ./examples/using_make/dir/match_opt.ml:1: ?b (2/3 calls) - ./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) -------- @@ -1534,7 +1460,6 @@ Nothing else to report in this section ./examples/using_make/dir/anonFn.mli:3: ?a (1/2 calls) ./examples/using_make/dir/anonFn.mli:3: ?b (1/2 calls) ./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) @@ -1642,7 +1567,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 1392 -Success: 1069 -Failed: 323 -Ratio: 76.7959770115% +Total: 1379 +Success: 864 +Failed: 515 +Ratio: 62.6540971719% diff --git a/docs/USAGE.md b/docs/USAGE.md index 2969ca19..c884e43f 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/docs/exported_values/HELLO_WORLD.md b/docs/exported_values/HELLO_WORLD.md index 22935a56..47e031f7 100644 --- a/docs/exported_values/HELLO_WORLD.md +++ b/docs/exported_values/HELLO_WORLD.md @@ -20,15 +20,14 @@ without any external use. The reference file for this example is [`hello_world_without_intf.ml`](../../examples/docs/exported_values/hello_world/hello_world_without_intf.ml). -The compilation command to produce `hello_world_without_intf.cmi` and -`hello_world_without_intf.cmt` is : +The compilation command to produce `hello_world_without_intf.cmt` is : ``` ocamlopt -bin-annot hello_world_without_intf.ml ``` The analysis command is : ``` -dead_code_analyzer --nothing -E all hello_world_without_intf.cmi hello_world_without_intf.cmt +dead_code_analyzer --nothing -E all hello_world_without_intf.cmt ``` ## First run @@ -62,7 +61,7 @@ reported location: `File "hello_world_without_intf.ml", line 8` Analyze : ``` -$ dead_code_analyzer --nothing -E all hello_world_without_intf.cmi hello_world_without_intf.cmt +$ dead_code_analyzer --nothing -E all hello_world_without_intf.cmt Scanning files... [DONE] @@ -100,7 +99,7 @@ Compile and analyze : ``` $ ocamlopt -bin-annot hello_world_without_intf.ml -$ dead_code_analyzer --nothing -E all hello_world_without_intf.cmi hello_world_without_intf.cmt +$ dead_code_analyzer --nothing -E all hello_world_without_intf.cmt Scanning files... [DONE] @@ -136,7 +135,7 @@ Compile and analyze : ``` $ ocamlopt -bin-annot hello_world_without_intf.ml -$ dead_code_analyzer --nothing -E all hello_world_without_intf.cmi hello_world_without_intf.cmt +$ dead_code_analyzer --nothing -E all hello_world_without_intf.cmt Scanning files... [DONE] @@ -160,14 +159,14 @@ The reference files for this example are [`hello_world_with_intf.mli`](../../examples/docs/exported_values/hello_world/hello_world_with_intf.mli) and [`hello_world_with_intf.ml`](../../examples/docs/exported_values/hello_world/hello_world_with_intf.ml) -The compilation command to produce `hello_world.cmi` and `hello_world.cmt` is : +The compilation command to produce `hello_world.cmti` and `hello_world.cmt` is : ``` ocamlopt -bin-annot hello_world_with_intf.mli hello_world_with_intf.ml ``` The analysis command is : ``` -dead_code_analyzer --nothing -E all hello_world.cmi hello_world.cmt +dead_code_analyzer --nothing -E all hello_world.cmti hello_world.cmt ``` ## First run @@ -199,7 +198,7 @@ File "hello_world_with_intf.ml", line 8, characters 6-19: ^^^^^^^^^^^^^ Warning 26 [unused-var]: unused variable goodbye_world. -$ dead_code_analyzer --nothing -E all hello_world.cmi hello_world.cmt +$ dead_code_analyzer --nothing -E all hello_world.cmti hello_world.cmt Scanning files... [DONE] @@ -246,7 +245,7 @@ let () = Compile and analyze : ``` $ ocamlopt -bin-annot hello_world_with_intf.ml -$ dead_code_analyzer --nothing -E all hello_world.cmi hello_world.cmt +$ dead_code_analyzer --nothing -E all hello_world.cmti hello_world.cmt Scanning files... [DONE] @@ -284,14 +283,14 @@ The reference files for this example are [`hello_world_lib.ml`](../../examples/docs/exported_values/hello_world/hello_world_lib.ml), and [`hello_world_bin.ml`](../../examples/docs/exported_values/hello_world/hello_world_bin.ml) -The compilation command to produce the necessary `.cmi` and `.cmt` files is : +The compilation command to produce the necessary `.cmti` and `.cmt` files is : ``` ocamlopt -bin-annot hello_world_lib.mli hello_world_lib.ml hello_world_bin.ml ``` The analysis command is : ``` -dead_code_analyzer --nothing -E all hello_world_lib.cmi hello_world_lib.cmt hello_world_bin.cmi hello_world_bin.cmt +dead_code_analyzer --nothing -E all hello_world_lib.cmti hello_world_lib.cmt hello_world_bin.cmti hello_world_bin.cmt ``` > [!NOTE] @@ -330,7 +329,7 @@ File "hello_world_bin.ml", line 5, characters 6-19: ^^^^^^^^^^^^^ Warning 26 [unused-var]: unused variable goodbye_world. -$ dead_code_analyzer --nothing -E all hello_world_lib.cmi hello_world_lib.cmt hello_world_bin.cmi hello_world_bin.cmt +$ dead_code_analyzer --nothing -E all hello_world_lib.cmti hello_world_lib.cmt hello_world_bin.cmti hello_world_bin.cmt Scanning files... [DONE] @@ -383,7 +382,7 @@ Compile and analyze : ``` $ ocamlopt -bin-annot hello_world_lib.mli hello_world_lib.ml hello_world_bin.ml -$ dead_code_analyzer --nothing -E all hello_world_lib.cmi hello_world_lib.cmt hello_world_bin.cmi hello_world_bin.cmt +$ dead_code_analyzer --nothing -E all hello_world_lib.cmti hello_world_lib.cmt hello_world_bin.cmti hello_world_bin.cmt Scanning files... [DONE] @@ -425,7 +424,7 @@ Compile and analyze : ``` $ ocamlopt -bin-annot hello_world_lib.mli hello_world_lib.ml hello_world_bin.ml -$ dead_code_analyzer --nothing -E all hello_world_lib.cmi hello_world_lib.cmt hello_world_bin.cmi hello_world_bin.cmt +$ dead_code_analyzer --nothing -E all hello_world_lib.cmti hello_world_lib.cmt hello_world_bin.cmti hello_world_bin.cmt Scanning files... [DONE] @@ -458,7 +457,7 @@ reach a satisfying codebase. The reference files for this example are all those listed previously. -The compilation command to produce the necessary `.cmi` and `.cmt` files, +The compilation command to produce the necessary `.cmti` and `.cmt` files, and the desired warnings is the combination of all the previous ones : ``` ocamlopt -w +32 -bin-annot hello_world_without_intf.ml hello_world_with_intf.mli hello_world_with_intf.ml hello_world_lib.mli hello_world_lib.ml hello_world_bin.ml @@ -476,7 +475,7 @@ dead_code_analyzer --nothing -E all . > [!TIP] > As we can see in the compilation command, there is a large number of files to -> list. Instead of listing all the `.cmi` and `.cmt` files in the command line, +> list. Instead of listing all the `.cmti` and `.cmt` files in the command line, > the analyzer accepts directories as arguments and will analyze all the > relevant files it can find in them. diff --git a/src/config/config.ml b/src/config/config.ml index 99139184..1ab5a8bb 100644 --- a/src/config/config.ml +++ b/src/config/config.ml @@ -112,7 +112,7 @@ let normalize_path path = let rec add_filepaths acc path = match Utils.Filepath.kind ~exclude:(fun _ -> false) path with - | Cmi | Cmt -> Utils.StringSet.add path acc + | Cmti | Cmt -> Utils.StringSet.add path acc | Dir -> Sys.readdir path |> Array.fold_left diff --git a/src/deadCode.ml b/src/deadCode.ml index 277600ea..fa343f4d 100644 --- a/src/deadCode.ml +++ b/src/deadCode.ml @@ -24,7 +24,7 @@ open DeadCommon (******** ATTRIBUTES ********) -let bad_files = ref [] (* unreadable cmi/cmt files *) +let bad_files = ref [] (* unreadable cmti/cmt files *) let main_files = Hashtbl.create 256 (* names -> paths *) @@ -391,28 +391,24 @@ let regabs state = hashtbl_add_unique_to_list main_files (Utils.Filepath.unit fn) () -let read_interface fn cmi_infos state = let open Cmi_format in - try - regabs state; - if Config.must_report_main state.config then - let u = - if State.File_infos.has_sourcepath state.file_infos then - State.File_infos.get_sourceunit state.file_infos - else - Utils.Filepath.unit fn - in - let module_id = - State.File_infos.get_modname state.file_infos - |> Ident.create_persistent - in - let f = - collect_export ~context:Toplevel [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 Config.must_report_main state.config then + let u = + if State.File_infos.has_sourcepath state.file_infos then + State.File_infos.get_sourceunit state.file_infos + else + Utils.Filepath.unit fn + in + let module_id = + State.File_infos.get_modname state.file_infos + |> Ident.create_persistent + in + let f = + collect_export ~context:Toplevel [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 *) @@ -489,13 +485,16 @@ let load_file fn state = in let exclude filepath = Config.is_excluded filepath state.State.config in match Utils.Filepath.kind ~exclude fn with - | Cmi when !DeadCommon.declarations -> + | Cmti when !DeadCommon.declarations -> + let open Cmt_format in last_loc := Lexing.dummy_pos; if state.State.config.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 -> @@ -558,7 +557,7 @@ let load_file fn state = | Dir -> (* TODO : better error handling *) failwith ("Internal error : Unexpected directory " - ^ fn ^ ". Only .cmi and .cmt are expected") + ^ fn ^ ". Only .cmti and .cmt are expected") | _ -> state @@ -703,15 +702,16 @@ let report_style () = (* Option parsing and processing *) let run_analysis state = - let process_file filename state = + let process_file state filename = let state = load_file filename state in State.update state; state in Printf.eprintf "Scanning files...\n%!"; - Utils.StringSet.fold + Utils.StringSet.elements state.State.config.paths_to_analyze + |> List.rev + |> List.fold_left process_file - state.State.config.paths_to_analyze state let () = diff --git a/src/deadCommon.ml b/src/deadCommon.ml index bb2fefb9..93f915a6 100644 --- a/src/deadCommon.ml +++ b/src/deadCommon.ml @@ -388,7 +388,7 @@ let export ?(sep = ".") path u stock id loc = ^ sep ^ (Ident.name id) in - (* a .cmi file can contain locations from other files. + (* a .cmti file can contain locations from other files. For instance: module M : Set.S with type elt = int will create value definitions whose location is in set.mli diff --git a/src/state/file_infos.ml b/src/state/file_infos.ml index 4a3eace1..9f293701 100644 --- a/src/state/file_infos.ml +++ b/src/state/file_infos.ml @@ -1,211 +1,117 @@ 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 Utils.Filepath.remove_pp cmt_infos.cmt_sourcefile |> Option.map (Filename.concat builddir) 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.Filepath.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 `Different - in - let fname_of_candidate = function - | `Different -> None - | `Identical fname - | `Suffix 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 - 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 - | (`Identical _ as candidate), _ - | _, (`Identical _ as candidate) -> - (* best candidate found *) - fname_of_candidate candidate - | `Different, candidate - | candidate, `Different - | _, candidate -> - find_sourcename candidate items - in - find_sourcename `Different 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 sourcepath = - (* Try to find a sourcepath in the cmi_infos *) - let cmi_unit = Utils.Filepath.unit cmi_file in - let sourcefname = sourcefname_of_cmi_infos cmi_unit cmi_infos in - match sourcefname, builddir with - | Some fname, Some builddir -> Some (Filename.concat builddir fname) - | _, _ -> sourcefname - in - match sourcepath with - | Some _ -> sourcepath - | None -> - (* There is no satisfying sourcepath in the cmi_infos. - Try to retrieve the sourecpath using with_cmt. - *) - let sourcepath_of_cmt cmt_file sourcepath = - (* When producing .cmt files for .ml files, the compiler also produces - .cmti files for .mli files. Hence, if a .cmti exists, we assume the - .mli does. - *) - if Sys.file_exists (cmt_file ^ "i") then sourcepath ^ "i" - else sourcepath + with _ -> + let ext = + match orig with + | `Cmt -> ".cmt" + | `Cmti -> ".cmti" in - Option.bind with_cmt - (fun {sourcepath; cmti_file; _} -> - Option.map (sourcepath_of_cmt cmti_file) sourcepath - ) - + 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 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 + 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 + 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 -> + | Some sourcepath -> sourcepath + | 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.Filepath.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 8e29bb87..bf782cec 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 1418a125..0caa2a0e 100644 --- a/src/state/state.ml +++ b/src/state/state.ml @@ -13,20 +13,20 @@ let init config = let update_config config state = {state with config} -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 -> {state with file_infos}) file_infos else - let file_infos = File_infos.init cmti_file in + let file_infos = File_infos.init cm_file in Result.map (fun file_infos -> {state with file_infos}) file_infos (** Analysis' state *) diff --git a/src/utils.ml b/src/utils.ml index 59bbb0a0..5cd89f0d 100644 --- a/src/utils.ml +++ b/src/utils.ml @@ -13,7 +13,7 @@ module Filepath = struct Unit_info.lax_modname_from_source filepath type kind = - | Cmi + | Cmti | Cmt | Dir | Ignore @@ -26,7 +26,7 @@ module Filepath = struct Ignore ) else if Sys.is_directory filepath then Dir - else if Filename.check_suffix filepath ".cmi" then Cmi + else if Filename.check_suffix filepath ".cmti" then Cmti else if Filename.check_suffix filepath ".cmt" then Cmt else Ignore end diff --git a/src/utils.mli b/src/utils.mli index 86407a5d..188d7066 100644 --- a/src/utils.mli +++ b/src/utils.mli @@ -10,7 +10,7 @@ module Filepath : sig (** [unit filepath] estimates the compilation unit of [filepath] *) type kind = - | Cmi (** .cmi file *) + | Cmti (** .cmti file *) | Cmt (** .cmt file *) | Dir (** Directory *) | Ignore (** Irrelevant for the analyzer *) From 2afb1e665e247ee0492cb939059fa5ce03a22124 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 04/15] [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 | 167 +++++--- check/internal/internal.ref | 167 +++++--- check/threshold-1/threshold-1.ref | 407 ++++++++++-------- check/threshold-3-0.5/threshold-3-0.5.ref | 492 +++++++++++++--------- src/config/config.ml | 2 +- src/deadCode.ml | 143 +++---- src/state/file_infos.ml | 62 +-- src/state/file_infos.mli | 3 +- src/utils.ml | 8 +- src/utils.mli | 3 +- 10 files changed, 823 insertions(+), 631 deletions(-) diff --git a/check/classic/classic.ref b/check/classic/classic.ref index 6307404f..17b34ba4 100644 --- a/check/classic/classic.ref +++ b/check/classic/classic.ref @@ -1,9 +1,13 @@ .> UNUSED EXPORTED VALUES: ========================= -./examples/docs/coding_style/bind/bind.ml:2: v: Not detected -./examples/docs/coding_style/opt/opt.ml:14: add_index_to_negative: Not detected -./examples/docs/coding_style/seq/seq.ml:2: compute_answer: Not detected -./examples/docs/coding_style/unit/unit.ml:2: compute_answer: Not detected +./examples/docs/coding_style/bind/bind.ml:2: v + +./examples/docs/coding_style/opt/opt.ml:14: add_index_to_negative + +./examples/docs/coding_style/seq/seq.ml:2: compute_answer + +./examples/docs/coding_style/unit/unit.ml:2: compute_answer + ./examples/docs/exported_values/code_constructs/function/function_lib.mli:7: unused ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used @@ -13,10 +17,13 @@ ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused -./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused: Not detected -./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused: Not detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused: Not detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused +./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused + +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement + ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused @@ -27,19 +34,28 @@ ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:41: public_method_label: Should not be detected ./examples/docs/exported_values/limitations/sigincl/sigincl_lib.mli:10: I.x: Should not be detected -./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory: Not detected -./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj: Not detected -./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding: Not detected -./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory: Not detected -./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:9: add_index: Not detected +./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory + +./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj + +./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding +./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory + +./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:9: add_index + ./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:2: max ./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:3: min ./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.mli:38: internally_used_f -./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/reduced_lib/reduced_lib.mli:3: Values.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:4: Values.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:10: Values_no_intf.used_by_API @@ -60,8 +76,13 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused +./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_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 @@ -76,11 +97,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 @@ -95,35 +117,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 @@ -136,9 +161,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 @@ -147,11 +172,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 @@ -160,16 +185,16 @@ Nothing else to report in this section .> UNUSED METHODS: ================= -./examples/docs/methods/code_constructs/class/class_bin.ml:2: unused_class#unused_method: Not detected +./examples/docs/methods/code_constructs/class/class_bin.ml:2: unused_class#unused_method ./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#reset ./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#unused: Not detected -./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:2: unused_class#unused_method: Not detected +./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:2: unused_class#unused_method ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#reset -./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory#unused_method: Not detected +./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory#unused_method ./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#reset: Not detected -./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj#unused_method: Not detected +./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj#unused_method ./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#reset: Not detected ./examples/docs/methods/code_constructs/inheritance/inheritance_lib.mli:2: parent#unused @@ -177,9 +202,11 @@ Nothing else to report in this section ./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#unused: Not detected ./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding#m: Not detected -./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m: Not detected +./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m + ./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 @@ -210,23 +237,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 @@ -249,9 +275,10 @@ Nothing else to report in this section ./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: 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 @@ -703,7 +730,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 602 -Success: 500 -Failed: 102 -Ratio: 83.0564784053% +Total: 610 +Success: 565 +Failed: 45 +Ratio: 92.6229508197% diff --git a/check/internal/internal.ref b/check/internal/internal.ref index c3867a58..5797a18e 100644 --- a/check/internal/internal.ref +++ b/check/internal/internal.ref @@ -1,9 +1,13 @@ .> UNUSED EXPORTED VALUES: ========================= -./examples/docs/coding_style/bind/bind.ml:2: v: Not detected -./examples/docs/coding_style/opt/opt.ml:14: add_index_to_negative: Not detected -./examples/docs/coding_style/seq/seq.ml:2: compute_answer: Not detected -./examples/docs/coding_style/unit/unit.ml:2: compute_answer: Not detected +./examples/docs/coding_style/bind/bind.ml:2: v + +./examples/docs/coding_style/opt/opt.ml:14: add_index_to_negative + +./examples/docs/coding_style/seq/seq.ml:2: compute_answer + +./examples/docs/coding_style/unit/unit.ml:2: compute_answer + ./examples/docs/exported_values/code_constructs/function/function_lib.mli:7: unused ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used: Should not be detected @@ -13,10 +17,13 @@ ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused -./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused: Not detected -./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused: Not detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused: Not detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused +./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused + +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement + ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused @@ -26,18 +33,27 @@ ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Should not be detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Should not be detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:41: public_method_label: Should not be detected ./examples/docs/exported_values/limitations/sigincl/sigincl_lib.mli:10: I.x: Should not be detected -./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory: Not detected -./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj: Not detected -./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding: Not detected -./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory: Not detected -./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:9: add_index: Not detected +./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory + +./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj + +./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding +./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory + +./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:9: add_index + ./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:2: max: Should not be detected ./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:3: min: Should not be detected ./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.mli:38: internally_used_f: 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/reduced_lib/reduced_lib.mli:3: Values.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:4: Values.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:10: Values_no_intf.used_by_API @@ -58,8 +74,13 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused +./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_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 @@ -73,11 +94,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 @@ -91,35 +113,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: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 @@ -132,20 +157,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 -------------------------------------------------------------------------------- @@ -153,16 +178,16 @@ Nothing else to report in this section .> UNUSED METHODS: ================= -./examples/docs/methods/code_constructs/class/class_bin.ml:2: unused_class#unused_method: Not detected +./examples/docs/methods/code_constructs/class/class_bin.ml:2: unused_class#unused_method ./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#reset ./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#unused: Not detected -./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:2: unused_class#unused_method: Not detected +./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:2: unused_class#unused_method ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#reset -./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory#unused_method: Not detected +./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory#unused_method ./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#reset: Not detected -./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj#unused_method: Not detected +./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj#unused_method ./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#reset: Not detected ./examples/docs/methods/code_constructs/inheritance/inheritance_lib.mli:2: parent#unused @@ -170,9 +195,11 @@ Nothing else to report in this section ./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#unused: Not detected ./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding#m: Not detected -./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m: Not detected +./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m + ./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 @@ -203,23 +230,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 @@ -242,9 +268,10 @@ Nothing else to report in this section ./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: 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 @@ -696,7 +723,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 602 -Success: 456 -Failed: 146 -Ratio: 75.7475083056% +Total: 610 +Success: 521 +Failed: 89 +Ratio: 85.4098360656% diff --git a/check/threshold-1/threshold-1.ref b/check/threshold-1/threshold-1.ref index cdfd09ea..dc510dd0 100644 --- a/check/threshold-1/threshold-1.ref +++ b/check/threshold-1/threshold-1.ref @@ -1,9 +1,13 @@ .> UNUSED EXPORTED VALUES: ========================= -./examples/docs/coding_style/bind/bind.ml:2: v: Not detected -./examples/docs/coding_style/opt/opt.ml:14: add_index_to_negative: Not detected -./examples/docs/coding_style/seq/seq.ml:2: compute_answer: Not detected -./examples/docs/coding_style/unit/unit.ml:2: compute_answer: Not detected +./examples/docs/coding_style/bind/bind.ml:2: v + +./examples/docs/coding_style/opt/opt.ml:14: add_index_to_negative + +./examples/docs/coding_style/seq/seq.ml:2: compute_answer + +./examples/docs/coding_style/unit/unit.ml:2: compute_answer + ./examples/docs/exported_values/code_constructs/function/function_lib.mli:7: unused ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used: Should not be detected @@ -13,10 +17,13 @@ ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused -./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused: Not detected -./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused: Not detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused: Not detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused +./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused + +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement + ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused @@ -26,18 +33,27 @@ ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Should not be detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Should not be detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:41: public_method_label: Should not be detected ./examples/docs/exported_values/limitations/sigincl/sigincl_lib.mli:10: I.x: Should not be detected -./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory: Not detected -./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj: Not detected -./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding: Not detected -./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory: Not detected -./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:9: add_index: Not detected +./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory + +./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj + +./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding +./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory + +./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:9: add_index + ./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:2: max: Should not be detected ./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:3: min: Should not be detected ./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.mli:38: internally_used_f: 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/reduced_lib/reduced_lib.mli:3: Values.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:4: Values.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:10: Values_no_intf.used_by_API @@ -58,8 +74,13 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused +./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_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 @@ -73,11 +94,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 @@ -91,35 +113,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: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 @@ -132,27 +157,28 @@ ./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 -------- .>-> ALMOST UNUSED EXPORTED VALUES: Called 1 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./examples/docs/coding_style/opt/opt.ml:2: map_with_index_on_negative: Not detected +./examples/docs/coding_style/opt/opt.ml:2: map_with_index_on_negative + ./examples/docs/exported_values/code_constructs/function/function_lib.mli:3: memoize ./examples/docs/exported_values/code_constructs/function/function_lib.mli:5: heavy_computation ./examples/docs/exported_values/code_constructs/function/function_lib.mli:9: do_nothing @@ -165,11 +191,12 @@ ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:20: External_param.unused_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:24: Internal_app.externally_used ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Not detected -./examples/docs/exported_values/code_constructs/include/include_lib.ml:3: Original.used_directly: Not detected -./examples/docs/exported_values/code_constructs/include/include_lib.ml:4: Original.used_indirectly: Not detected -./examples/docs/exported_values/code_constructs/include/include_lib.ml:14: Redefine.used_directly: Not detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:3: Original.used_directly: Not detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:4: Original.used_indirectly: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:3: Original.used_directly +./examples/docs/exported_values/code_constructs/include/include_lib.ml:4: Original.used_indirectly +./examples/docs/exported_values/code_constructs/include/include_lib.ml:14: Redefine.used_directly + +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:3: Original.used_directly +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:4: Original.used_indirectly ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Not detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:17: M_redef.externally_used ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Not detected @@ -179,9 +206,10 @@ ./examples/docs/exported_values/hello_world/hello_world_lib.mli:3: goodbye ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Not detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Not detected -./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:2: hello: Not detected -./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:3: goodbye: Not detected -./examples/docs/fields_and_constructors/code_constructs/extensible_variant/extensible_variant_bin.ml:5: to_string_opt: Not detected +./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:2: hello +./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:3: goodbye + +./examples/docs/fields_and_constructors/code_constructs/extensible_variant/extensible_variant_bin.ml:5: to_string_opt ./examples/docs/fields_and_constructors/code_constructs/extensible_variant/extensible_variant_lib.mli:7: to_string_opt ./examples/docs/fields_and_constructors/code_constructs/gadt/gadt_lib.mli:6: gadt_of_int @@ -192,29 +220,40 @@ ./examples/docs/fields_and_constructors/code_constructs/polymorphic_variant/polymorphic_variant_lib.mli:4: poly_of_int ./examples/docs/fields_and_constructors/code_constructs/polymorphic_variant/polymorphic_variant_lib.mli:6: float_opt_of_poly -./examples/docs/methods/code_constructs/class/class_bin.ml:4: push_n_times: Not detected -./examples/docs/methods/code_constructs/class_type/class_type_bin.ml:4: push_n_times: Not detected +./examples/docs/methods/code_constructs/class/class_bin.ml:4: push_n_times + +./examples/docs/methods/code_constructs/class_type/class_type_bin.ml:4: push_n_times + ./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj -./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:4: push_n_times: Not detected -./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:4: push_n_times: Not detected -./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:4: push_n_times: Not detected -./examples/docs/methods/code_constructs/object_type/object_type_bin.ml:4: push_n_times: Not detected -./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_bin.ml:2: push_n_times: Not detected +./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:4: push_n_times + +./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:4: push_n_times + +./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:4: push_n_times + +./examples/docs/methods/code_constructs/object_type/object_type_bin.ml:4: push_n_times + +./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_bin.ml:2: push_n_times + ./examples/docs/methods/limitations/alias/alias_lib.mli:2: original: Should not be detected ./examples/docs/methods/limitations/alias/alias_lib.mli:8: alias ./examples/docs/optional_arguments/code_constructs/external_app/external_app_lib.mli:2: max ./examples/docs/optional_arguments/code_constructs/external_app/external_app_lib.mli:3: min -./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:2: map_with_index: Not detected +./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:2: map_with_index + ./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:2: max: Not detected ./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:3: min: Not detected ./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:2: max: Should not be detected ./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:3: min: Should not be detected -./examples/docs/optional_arguments/code_constructs/partial_app/partial_app_bin.ml:2: sum: Not detected -./examples/docs/optional_arguments/code_constructs/total_app/total_app_bin.ml:2: sum: Not detected -./examples/docs/optional_arguments/limitations/relaying/relaying_bin.ml:4: g: Not detected +./examples/docs/optional_arguments/code_constructs/partial_app/partial_app_bin.ml:2: sum + +./examples/docs/optional_arguments/code_constructs/total_app/total_app_bin.ml:2: sum + +./examples/docs/optional_arguments/limitations/relaying/relaying_bin.ml:4: g + ./examples/using_dune/bin/use_preprocessed_lib/use_preprocessed.mli:1: mark_used ./examples/using_dune/bin/use_preprocessed_lib/use_preprocessed_lib.mli:1: mark_used ./examples/using_dune/bin/use_preprocessed_lib/use_preprocessed_no_intf.mli:1: mark_used @@ -261,8 +300,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: exported_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/reduced_lib/reduced_lib.mli:2: Values.used ./examples/using_dune/reduced_lib/reduced_lib.mli:5: Values.externally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:9: Values_no_intf.used @@ -281,14 +321,19 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:10: Exported.lib_internal_externally_used +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Not detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:9: Exported.lib_internal_internally_used: Not detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:10: Exported.lib_internal_externally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:9: Exported.lib_internal_internally_used +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:10: Exported.lib_internal_externally_used +./examples/using_dune/reduced_lib/values_no_intf.ml:1: used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_externally_used: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used +./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_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 @@ -307,7 +352,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 @@ -329,21 +375,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 @@ -362,7 +409,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 @@ -384,65 +432,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 -------------------------------------------------------------------------------- @@ -450,16 +502,16 @@ Nothing else to report in this section .> UNUSED METHODS: ================= -./examples/docs/methods/code_constructs/class/class_bin.ml:2: unused_class#unused_method: Not detected +./examples/docs/methods/code_constructs/class/class_bin.ml:2: unused_class#unused_method ./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#reset ./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#unused: Not detected -./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:2: unused_class#unused_method: Not detected +./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:2: unused_class#unused_method ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#reset -./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory#unused_method: Not detected +./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory#unused_method ./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#reset: Not detected -./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj#unused_method: Not detected +./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj#unused_method ./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#reset: Not detected ./examples/docs/methods/code_constructs/inheritance/inheritance_lib.mli:2: parent#unused @@ -467,9 +519,11 @@ Nothing else to report in this section ./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#unused: Not detected ./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding#m: Not detected -./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m: Not detected +./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m + ./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 @@ -500,23 +554,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 @@ -552,8 +605,9 @@ Nothing else to report in this section ./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#used_by_alias: Not detected ./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 @@ -583,28 +637,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 @@ -625,9 +680,10 @@ Nothing else to report in this section ./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: 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 @@ -705,11 +761,12 @@ Nothing else to report in this section ./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: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 @@ -1159,7 +1216,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 1029 -Success: 653 -Failed: 376 -Ratio: 63.4596695821% +Total: 1041 +Success: 823 +Failed: 218 +Ratio: 79.0585975024% 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 b340e811..788408b0 100644 --- a/check/threshold-3-0.5/threshold-3-0.5.ref +++ b/check/threshold-3-0.5/threshold-3-0.5.ref @@ -1,9 +1,13 @@ .> UNUSED EXPORTED VALUES: ========================= -./examples/docs/coding_style/bind/bind.ml:2: v: Not detected -./examples/docs/coding_style/opt/opt.ml:14: add_index_to_negative: Not detected -./examples/docs/coding_style/seq/seq.ml:2: compute_answer: Not detected -./examples/docs/coding_style/unit/unit.ml:2: compute_answer: Not detected +./examples/docs/coding_style/bind/bind.ml:2: v + +./examples/docs/coding_style/opt/opt.ml:14: add_index_to_negative + +./examples/docs/coding_style/seq/seq.ml:2: compute_answer + +./examples/docs/coding_style/unit/unit.ml:2: compute_answer + ./examples/docs/exported_values/code_constructs/function/function_lib.mli:7: unused ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used: Should not be detected @@ -13,10 +17,13 @@ ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused -./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused: Not detected -./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused: Not detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused: Not detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused +./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused + +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement + ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused @@ -26,18 +33,27 @@ ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Should not be detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Should not be detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected +./examples/docs/exported_values/limitations/incl_same_name/oo.mli:41: public_method_label: Should not be detected ./examples/docs/exported_values/limitations/sigincl/sigincl_lib.mli:10: I.x: Should not be detected -./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory: Not detected -./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj: Not detected -./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding: Not detected -./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory: Not detected -./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:9: add_index: Not detected +./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory + +./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj + +./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding +./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory + +./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:9: add_index + ./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:2: max: Should not be detected ./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:3: min: Should not be detected ./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.mli:38: internally_used_f: 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/reduced_lib/reduced_lib.mli:3: Values.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:4: Values.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:10: Values_no_intf.used_by_API @@ -58,8 +74,13 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused +./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected +./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_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 @@ -73,11 +94,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 @@ -91,35 +113,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: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 @@ -132,27 +157,28 @@ ./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 -------- .>-> ALMOST UNUSED EXPORTED VALUES: Called 1 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -./examples/docs/coding_style/opt/opt.ml:2: map_with_index_on_negative: Not detected +./examples/docs/coding_style/opt/opt.ml:2: map_with_index_on_negative + ./examples/docs/exported_values/code_constructs/function/function_lib.mli:3: memoize ./examples/docs/exported_values/code_constructs/function/function_lib.mli:5: heavy_computation ./examples/docs/exported_values/code_constructs/function/function_lib.mli:9: do_nothing @@ -165,11 +191,12 @@ ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:20: External_param.unused_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:24: Internal_app.externally_used ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Not detected -./examples/docs/exported_values/code_constructs/include/include_lib.ml:3: Original.used_directly: Not detected -./examples/docs/exported_values/code_constructs/include/include_lib.ml:4: Original.used_indirectly: Not detected -./examples/docs/exported_values/code_constructs/include/include_lib.ml:14: Redefine.used_directly: Not detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:3: Original.used_directly: Not detected -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:4: Original.used_indirectly: Not detected +./examples/docs/exported_values/code_constructs/include/include_lib.ml:3: Original.used_directly +./examples/docs/exported_values/code_constructs/include/include_lib.ml:4: Original.used_indirectly +./examples/docs/exported_values/code_constructs/include/include_lib.ml:14: Redefine.used_directly + +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:3: Original.used_directly +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:4: Original.used_indirectly ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Not detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:17: M_redef.externally_used ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Not detected @@ -179,9 +206,10 @@ ./examples/docs/exported_values/hello_world/hello_world_lib.mli:3: goodbye ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Not detected ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Not detected -./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:2: hello: Not detected -./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:3: goodbye: Not detected -./examples/docs/fields_and_constructors/code_constructs/extensible_variant/extensible_variant_bin.ml:5: to_string_opt: Not detected +./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:2: hello +./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:3: goodbye + +./examples/docs/fields_and_constructors/code_constructs/extensible_variant/extensible_variant_bin.ml:5: to_string_opt ./examples/docs/fields_and_constructors/code_constructs/extensible_variant/extensible_variant_lib.mli:7: to_string_opt ./examples/docs/fields_and_constructors/code_constructs/gadt/gadt_lib.mli:6: gadt_of_int @@ -192,29 +220,40 @@ ./examples/docs/fields_and_constructors/code_constructs/polymorphic_variant/polymorphic_variant_lib.mli:4: poly_of_int ./examples/docs/fields_and_constructors/code_constructs/polymorphic_variant/polymorphic_variant_lib.mli:6: float_opt_of_poly -./examples/docs/methods/code_constructs/class/class_bin.ml:4: push_n_times: Not detected -./examples/docs/methods/code_constructs/class_type/class_type_bin.ml:4: push_n_times: Not detected +./examples/docs/methods/code_constructs/class/class_bin.ml:4: push_n_times + +./examples/docs/methods/code_constructs/class_type/class_type_bin.ml:4: push_n_times + ./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj -./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:4: push_n_times: Not detected -./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:4: push_n_times: Not detected -./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:4: push_n_times: Not detected -./examples/docs/methods/code_constructs/object_type/object_type_bin.ml:4: push_n_times: Not detected -./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_bin.ml:2: push_n_times: Not detected +./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:4: push_n_times + +./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:4: push_n_times + +./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:4: push_n_times + +./examples/docs/methods/code_constructs/object_type/object_type_bin.ml:4: push_n_times + +./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_bin.ml:2: push_n_times + ./examples/docs/methods/limitations/alias/alias_lib.mli:2: original: Should not be detected ./examples/docs/methods/limitations/alias/alias_lib.mli:8: alias ./examples/docs/optional_arguments/code_constructs/external_app/external_app_lib.mli:2: max ./examples/docs/optional_arguments/code_constructs/external_app/external_app_lib.mli:3: min -./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:2: map_with_index: Not detected +./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:2: map_with_index + ./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:2: max: Not detected ./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:3: min: Not detected ./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:2: max: Should not be detected ./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:3: min: Should not be detected -./examples/docs/optional_arguments/code_constructs/partial_app/partial_app_bin.ml:2: sum: Not detected -./examples/docs/optional_arguments/code_constructs/total_app/total_app_bin.ml:2: sum: Not detected -./examples/docs/optional_arguments/limitations/relaying/relaying_bin.ml:4: g: Not detected +./examples/docs/optional_arguments/code_constructs/partial_app/partial_app_bin.ml:2: sum + +./examples/docs/optional_arguments/code_constructs/total_app/total_app_bin.ml:2: sum + +./examples/docs/optional_arguments/limitations/relaying/relaying_bin.ml:4: g + ./examples/using_dune/bin/use_preprocessed_lib/use_preprocessed.mli:1: mark_used ./examples/using_dune/bin/use_preprocessed_lib/use_preprocessed_lib.mli:1: mark_used ./examples/using_dune/bin/use_preprocessed_lib/use_preprocessed_no_intf.mli:1: mark_used @@ -261,8 +300,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: exported_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/reduced_lib/reduced_lib.mli:2: Values.used ./examples/using_dune/reduced_lib/reduced_lib.mli:5: Values.externally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:9: Values_no_intf.used @@ -281,14 +321,19 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:10: Exported.lib_internal_externally_used +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Not detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:9: Exported.lib_internal_internally_used: Not detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:10: Exported.lib_internal_externally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:9: Exported.lib_internal_internally_used +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:10: Exported.lib_internal_externally_used +./examples/using_dune/reduced_lib/values_no_intf.ml:1: used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_externally_used: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used +./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_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 @@ -307,7 +352,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 @@ -329,21 +375,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 @@ -362,7 +409,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 @@ -384,65 +432,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 -------- @@ -451,20 +503,23 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./examples/docs/exported_values/hello_world/hello_world_lib.mli:4: world ./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Not detected -./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:4: world: Not detected +./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:4: world + ./examples/docs/methods/limitations/alias/alias_lib.mli:2: original: Not detected ./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:2: max: Not detected ./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:3: min: Not detected -./examples/docs/optional_arguments/limitations/relaying/relaying_bin.ml:2: f: Not detected +./examples/docs/optional_arguments/limitations/relaying/relaying_bin.ml:2: f + ./examples/using_dune/preprocessed_lib/preprocessed.mli:2: used: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:31: exported_f: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:38: internally_used_f: Not detected ./examples/using_dune/preprocessed_lib/preprocessed.mli:44: externally_used_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/preprocessed_lib/preprocessed_no_intf.ml:59: internally_used_f: Not detected -./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:64: externally_used_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/preprocessed_lib/preprocessed_no_intf.ml:59: internally_used_f +./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:64: externally_used_f + ./examples/using_dune/reduced_lib/values.mli:1: used: Not detected ./examples/using_dune/reduced_lib/values.mli:3: internally_used: Not detected ./examples/using_dune/reduced_lib/values.mli:6: lib_internal_used: Not detected @@ -473,10 +528,11 @@ ./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used: Not detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:7: Exported.lib_internal_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:7: Exported.lib_internal_used ./examples/using_dune/reduced_lib/values_no_intf.ml:1: used: Not detected ./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:10: lib_internal_used: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:10: lib_internal_used + ./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 @@ -510,11 +566,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 @@ -548,28 +605,32 @@ ./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 -------- @@ -584,17 +645,21 @@ ./examples/docs/methods/code_constructs/object_type/object_type_lib.mli:9: int_stack ./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 -------------------------------------------------------------------------------- @@ -602,16 +667,16 @@ Nothing else to report in this section .> UNUSED METHODS: ================= -./examples/docs/methods/code_constructs/class/class_bin.ml:2: unused_class#unused_method: Not detected +./examples/docs/methods/code_constructs/class/class_bin.ml:2: unused_class#unused_method ./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#reset ./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#unused: Not detected -./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:2: unused_class#unused_method: Not detected +./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:2: unused_class#unused_method ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#reset -./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory#unused_method: Not detected +./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory#unused_method ./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#reset: Not detected -./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj#unused_method: Not detected +./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj#unused_method ./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#reset: Not detected ./examples/docs/methods/code_constructs/inheritance/inheritance_lib.mli:2: parent#unused @@ -619,9 +684,11 @@ Nothing else to report in this section ./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#unused: Not detected ./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding#m: Not detected -./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m: Not detected +./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m + ./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 @@ -652,23 +719,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 @@ -704,8 +770,9 @@ Nothing else to report in this section ./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#used_by_alias: Not detected ./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 @@ -735,28 +802,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 -------- @@ -765,7 +833,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 @@ -791,7 +860,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 -------- @@ -813,9 +882,10 @@ Nothing else to report in this section ./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: 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 @@ -893,11 +963,12 @@ Nothing else to report in this section ./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: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 @@ -963,8 +1034,9 @@ Nothing else to report in this section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./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: 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 @@ -1567,7 +1639,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 1379 -Success: 864 -Failed: 515 -Ratio: 62.6540971719% +Total: 1392 +Success: 1069 +Failed: 323 +Ratio: 76.7959770115% diff --git a/src/config/config.ml b/src/config/config.ml index 1ab5a8bb..f8e4ab0b 100644 --- a/src/config/config.ml +++ b/src/config/config.ml @@ -112,7 +112,7 @@ let normalize_path path = let rec add_filepaths acc path = match Utils.Filepath.kind ~exclude:(fun _ -> false) path with - | Cmti | Cmt -> Utils.StringSet.add path acc + | Cmti | Cmt_without_mli | Cmt_with_mli -> Utils.StringSet.add path acc | Dir -> Sys.readdir path |> Array.fold_left diff --git a/src/deadCode.ml b/src/deadCode.ml index fa343f4d..d5c6e8e2 100644 --- a/src/deadCode.ml +++ b/src/deadCode.ml @@ -407,7 +407,7 @@ let read_interface fn signature state = let f = collect_export ~context:Toplevel [module_id] u decs in - List.iter f signature.sig_type; + List.iter f signature; last_loc := Lexing.dummy_pos @@ -483,82 +483,83 @@ let load_file fn state = (* TODO: stateful computations should take and return the state when possible *) state in - let exclude filepath = Config.is_excluded filepath state.State.config in - match Utils.Filepath.kind ~exclude fn with - | Cmti when !DeadCommon.declarations -> - let open Cmt_format in - last_loc := Lexing.dummy_pos; - if state.State.config.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 state.config.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 state.State.config.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 state.State.config.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) + match decl with + | Value {val_loc = {loc_start; loc_ghost = false; _}; _} -> + Some loc_start + | _ -> None 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 Config.must_report_section state.config.sections.exported_values then - let sourceunit = - State.File_infos.get_sourceunit state.file_infos - in - let in_sourceunit (pos : Lexing.position) = - String.equal (Utils.Filepath.unit pos.pos_fname) sourceunit - in - List.filter_map - (fun (loc1, loc2) -> - if in_sourceunit loc1 || in_sourceunit loc2 then - Some (loc1, loc2) - else None - ) - value_dep - else [] - 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 Config.must_report_section state.config.sections.exported_values then + let sourceunit = + State.File_infos.get_sourceunit state.file_infos + in + let in_sourceunit (pos : Lexing.position) = + String.equal (Utils.Filepath.unit pos.pos_fname) sourceunit + in + List.filter_map + (fun (loc1, loc2) -> + if in_sourceunit loc1 || in_sourceunit loc2 then + Some (loc1, loc2) + else None + ) + value_dep + else [] + in + eof loc_dep + | _ -> () (* todo: support partial_implementation? *) + ) + in + let exclude filepath = Config.is_excluded filepath state.State.config in + match Utils.Filepath.kind ~exclude 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 -> (* TODO : better error handling *) failwith ("Internal error : Unexpected directory " ^ fn ^ ". Only .cmti and .cmt are expected") - | _ -> state diff --git a/src/state/file_infos.ml b/src/state/file_infos.ml index 9f293701..cacfc55f 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 Utils.Filepath.remove_pp cmt_infos.cmt_sourcefile @@ -33,7 +36,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]). @@ -43,17 +46,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 @@ -64,35 +62,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 bf782cec..2807c9e7 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 *) diff --git a/src/utils.ml b/src/utils.ml index 5cd89f0d..df300c1c 100644 --- a/src/utils.ml +++ b/src/utils.ml @@ -14,7 +14,8 @@ module Filepath = struct type kind = | Cmti - | Cmt + | Cmt_without_mli + | Cmt_with_mli | Dir | Ignore @@ -27,7 +28,10 @@ module Filepath = struct ) else if Sys.is_directory filepath then Dir else if Filename.check_suffix filepath ".cmti" then Cmti - else if Filename.check_suffix filepath ".cmt" then Cmt + else if Filename.check_suffix filepath ".cmt" then + let cmti = Filename.remove_extension filepath ^ ".cmti" in + if Sys.file_exists cmti then Cmt_with_mli + else Cmt_without_mli else Ignore end diff --git a/src/utils.mli b/src/utils.mli index 188d7066..1d506e9f 100644 --- a/src/utils.mli +++ b/src/utils.mli @@ -11,7 +11,8 @@ module Filepath : sig type kind = | Cmti (** .cmti file *) - | Cmt (** .cmt file *) + | Cmt_without_mli (** .cmt file of .ml only module *) + | Cmt_with_mli (** .cmt file of module with .mli *) | Dir (** Directory *) | Ignore (** Irrelevant for the analyzer *) From 562ab2d08dcfc817e44663745a8bdea4aaa35703 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 05/15] [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 | 63 +-- check/internal/internal.ref | 114 ++--- check/threshold-1/threshold-1.ref | 317 ++++++-------- check/threshold-3-0.5/threshold-3-0.5.ref | 492 +++++++++------------- src/deadCode.ml | 12 +- src/state/file_infos.ml | 16 +- src/state/signature.ml | 69 +++ src/state/signature.mli | 15 + src/state/state.ml | 13 +- src/state/state.mli | 3 + 10 files changed, 500 insertions(+), 614 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 17b34ba4..4f323c7f 100644 --- a/check/classic/classic.ref +++ b/check/classic/classic.ref @@ -20,7 +20,6 @@ ./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement @@ -125,8 +124,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 @@ -188,23 +186,27 @@ Nothing else to report in this section ./examples/docs/methods/code_constructs/class/class_bin.ml:2: unused_class#unused_method ./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#reset -./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#unused: Not detected +./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#unused + ./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:2: unused_class#unused_method ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#reset ./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory#unused_method -./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#reset: Not detected +./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#reset + ./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj#unused_method -./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#reset: Not detected +./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#reset + ./examples/docs/methods/code_constructs/inheritance/inheritance_lib.mli:2: parent#unused ./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_lib.mli:2: stack#reset -./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#unused: Not detected +./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#unused +./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#used_by_alias: Should not be detected ./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding#m: Not detected ./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m -./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 @@ -214,14 +216,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 @@ -229,14 +232,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 @@ -496,8 +500,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 @@ -628,7 +630,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 @@ -730,7 +731,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 610 -Success: 565 -Failed: 45 -Ratio: 92.6229508197% +Total: 605 +Success: 586 +Failed: 19 +Ratio: 96.8595041322% diff --git a/check/internal/internal.ref b/check/internal/internal.ref index 5797a18e..dd150b77 100644 --- a/check/internal/internal.ref +++ b/check/internal/internal.ref @@ -10,29 +10,19 @@ ./examples/docs/exported_values/code_constructs/function/function_lib.mli:7: unused -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:10: F.unused -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required: Should not be detected -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required: Should not be detected -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement -./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused -./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/module/module_lib.mli:6: M.unused -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Should not be detected -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Should not be detected -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected @@ -47,11 +37,7 @@ ./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:9: add_index -./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:2: max: Should not be detected -./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:3: min: Should not be detected ./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.mli:38: internally_used_f: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused ./examples/using_dune/reduced_lib/reduced_lib.mli:3: Values.used_by_API @@ -62,18 +48,12 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:19: Values_in_submodules.Exported.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:27: Values_in_submodules_no_intf.Exported.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:28: Values_in_submodules_no_intf.Exported.internally_used -./examples/using_dune/reduced_lib/values.mli:1: used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values.mli:3: internally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:7: lib_internal_unused -./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused @@ -82,18 +62,12 @@ ./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_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:3: internally_used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun -./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 ./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure -./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 @@ -101,18 +75,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:3: internally_used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun -./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 ./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure -./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 @@ -121,8 +89,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 @@ -139,39 +106,25 @@ ./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: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 -./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 ./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 -------------------------------------------------------------------------------- @@ -181,23 +134,27 @@ Nothing else to report in this section ./examples/docs/methods/code_constructs/class/class_bin.ml:2: unused_class#unused_method ./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#reset -./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#unused: Not detected +./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#unused + ./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:2: unused_class#unused_method ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#reset ./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory#unused_method -./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#reset: Not detected +./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#reset + ./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj#unused_method -./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#reset: Not detected +./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#reset + ./examples/docs/methods/code_constructs/inheritance/inheritance_lib.mli:2: parent#unused ./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_lib.mli:2: stack#reset -./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#unused: Not detected +./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#unused +./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#used_by_alias: Should not be detected ./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding#m: Not detected ./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m -./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 @@ -207,14 +164,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 @@ -222,14 +180,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 @@ -489,8 +448,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 @@ -621,7 +578,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 @@ -723,7 +679,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 610 -Success: 521 -Failed: 89 -Ratio: 85.4098360656% +Total: 557 +Success: 542 +Failed: 15 +Ratio: 97.3070017953% diff --git a/check/threshold-1/threshold-1.ref b/check/threshold-1/threshold-1.ref index dc510dd0..7c6a07da 100644 --- a/check/threshold-1/threshold-1.ref +++ b/check/threshold-1/threshold-1.ref @@ -10,29 +10,19 @@ ./examples/docs/exported_values/code_constructs/function/function_lib.mli:7: unused -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:10: F.unused -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required: Should not be detected -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required: Should not be detected -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement -./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused -./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/module/module_lib.mli:6: M.unused -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Should not be detected -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Should not be detected -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected @@ -47,11 +37,7 @@ ./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:9: add_index -./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:2: max: Should not be detected -./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:3: min: Should not be detected ./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.mli:38: internally_used_f: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused ./examples/using_dune/reduced_lib/reduced_lib.mli:3: Values.used_by_API @@ -62,18 +48,12 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:19: Values_in_submodules.Exported.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:27: Values_in_submodules_no_intf.Exported.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:28: Values_in_submodules_no_intf.Exported.internally_used -./examples/using_dune/reduced_lib/values.mli:1: used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values.mli:3: internally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:7: lib_internal_unused -./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused @@ -82,18 +62,12 @@ ./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_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:3: internally_used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun -./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 ./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure -./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 @@ -101,18 +75,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:3: internally_used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun -./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 ./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure -./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 @@ -121,8 +89,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 @@ -139,39 +106,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: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 -./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 ./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 -------- @@ -184,28 +136,32 @@ ./examples/docs/exported_values/code_constructs/function/function_lib.mli:9: do_nothing ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:8: F.externally_used -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used: Not detected -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required: Not detected -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required: Not detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:19: External_param.used_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:20: External_param.unused_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:24: Internal_app.externally_used -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Not detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used + ./examples/docs/exported_values/code_constructs/include/include_lib.ml:3: Original.used_directly ./examples/docs/exported_values/code_constructs/include/include_lib.ml:4: Original.used_indirectly ./examples/docs/exported_values/code_constructs/include/include_lib.ml:14: Redefine.used_directly ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:3: Original.used_directly ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:4: Original.used_indirectly -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement + ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:17: M_redef.externally_used -./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Not detected +./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used + ./examples/docs/exported_values/code_constructs/module/module_lib.mli:4: M.externally_used -./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used: Not detected +./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used + ./examples/docs/exported_values/hello_world/hello_world_lib.mli:2: hello ./examples/docs/exported_values/hello_world/hello_world_lib.mli:3: goodbye -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Not detected -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Not detected +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye ./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:2: hello ./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:3: goodbye @@ -236,7 +192,6 @@ ./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_bin.ml:2: push_n_times -./examples/docs/methods/limitations/alias/alias_lib.mli:2: original: Should not be detected ./examples/docs/methods/limitations/alias/alias_lib.mli:8: alias ./examples/docs/optional_arguments/code_constructs/external_app/external_app_lib.mli:2: max @@ -244,10 +199,9 @@ ./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:2: map_with_index -./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:2: max: Not detected -./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:3: min: Not detected -./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:2: max: Should not be detected -./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:3: min: Should not be detected +./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:2: max +./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:3: min + ./examples/docs/optional_arguments/code_constructs/partial_app/partial_app_bin.ml:2: sum ./examples/docs/optional_arguments/code_constructs/total_app/total_app_bin.ml:2: sum @@ -296,10 +250,8 @@ ./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: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:3: internally_used ./examples/using_dune/preprocessed_lib/preprocessed.mli:4: externally_used -./examples/using_dune/preprocessed_lib/preprocessed.mli:31: exported_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 @@ -311,15 +263,17 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:20: Values_in_submodules.Exported.externally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:26: Values_in_submodules_no_intf.Exported.used ./examples/using_dune/reduced_lib/reduced_lib.mli:29: Values_in_submodules_no_intf.Exported.externally_used +./examples/using_dune/reduced_lib/values.mli:1: used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Not detected +./examples/using_dune/reduced_lib/values.mli:3: internally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:4: externally_used: Not detected -./examples/using_dune/reduced_lib/values.mli:6: lib_internal_used: Should not be detected -./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used: Not detected +./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used ./examples/using_dune/reduced_lib/values.mli:9: lib_internal_externally_used +./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Not detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used ./examples/using_dune/reduced_lib/values_in_submodules.mli:10: Exported.lib_internal_externally_used ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Not detected @@ -334,46 +288,27 @@ ./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used ./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_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: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: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/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_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: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 @@ -391,46 +326,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: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: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/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_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: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 @@ -451,8 +367,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 @@ -467,24 +384,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 @@ -495,7 +413,8 @@ ./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 -------------------------------------------------------------------------------- @@ -505,23 +424,27 @@ Nothing else to report in this section ./examples/docs/methods/code_constructs/class/class_bin.ml:2: unused_class#unused_method ./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#reset -./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#unused: Not detected +./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#unused + ./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:2: unused_class#unused_method ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#reset ./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory#unused_method -./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#reset: Not detected +./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#reset + ./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj#unused_method -./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#reset: Not detected +./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#reset + ./examples/docs/methods/code_constructs/inheritance/inheritance_lib.mli:2: parent#unused ./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_lib.mli:2: stack#reset -./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#unused: Not detected +./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#unused +./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#used_by_alias: Should not be detected ./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding#m: Not detected ./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m -./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 @@ -531,14 +454,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 @@ -546,14 +470,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 @@ -583,17 +508,20 @@ Nothing else to report in this section ./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#pop ./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#push -./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#used_by_requirement: Not detected +./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#used_by_requirement + ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#peek ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#pop ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#push -./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#peek: Not detected -./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#pop: Not detected -./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#push: Not detected -./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#peek: Not detected -./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#pop: Not detected -./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#push: Not detected +./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#peek +./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#pop +./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#push + +./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#peek +./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#pop +./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#push + ./examples/docs/methods/code_constructs/inheritance/inheritance_lib.mli:2: parent#used ./examples/docs/methods/code_constructs/inheritance/inheritance_lib.mli:2: parent#used_by_child @@ -601,41 +529,43 @@ Nothing else to report in this section ./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_lib.mli:2: stack#pop ./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_lib.mli:2: stack#push -./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#used: Not detected +./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#used ./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#used_by_alias: Not detected -./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 @@ -982,8 +912,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 @@ -1114,7 +1042,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 @@ -1216,7 +1143,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 1041 -Success: 823 -Failed: 218 -Ratio: 79.0585975024% +Total: 945 +Success: 913 +Failed: 32 +Ratio: 96.6137566138% 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 788408b0..c9555141 100644 --- a/check/threshold-3-0.5/threshold-3-0.5.ref +++ b/check/threshold-3-0.5/threshold-3-0.5.ref @@ -10,29 +10,19 @@ ./examples/docs/exported_values/code_constructs/function/function_lib.mli:7: unused -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:10: F.unused -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required: Should not be detected -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required: Should not be detected -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:26: Internal_app.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:5: Original.unused ./examples/docs/exported_values/code_constructs/include/include_lib.ml:15: Redefine.unused -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Should not be detected ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:6: Original.unused ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:12: Alias_with_sig.used_by_requirement -./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:19: M_redef.unused -./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used: Should not be detected ./examples/docs/exported_values/code_constructs/module/module_lib.mli:6: M.unused -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Should not be detected -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Should not be detected -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:20: copy: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:25: id: Should not be detected ./examples/docs/exported_values/limitations/incl_same_name/oo.mli:40: new_method: Should not be detected @@ -47,11 +37,7 @@ ./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:9: add_index -./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:2: max: Should not be detected -./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:3: min: Should not be detected ./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.mli:38: internally_used_f: Should not be detected ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:2: unused ./examples/using_dune/reduced_lib/reduced_lib.mli:3: Values.used_by_API @@ -62,18 +48,12 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:19: Values_in_submodules.Exported.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:27: Values_in_submodules_no_intf.Exported.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:28: Values_in_submodules_no_intf.Exported.internally_used -./examples/using_dune/reduced_lib/values.mli:1: used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values.mli:3: internally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:7: lib_internal_unused -./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused @@ -82,18 +62,12 @@ ./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_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:3: internally_used_int: Should not be detected ./examples/using_dune/unwrapped_lib/values/values.mli:14: unused_fun -./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 ./examples/using_dune/unwrapped_lib/values/values.mli:25: unused_closure -./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 @@ -101,18 +75,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:3: internally_used_int: Should not be detected ./examples/using_dune/wrapped_lib/values/values.mli:14: unused_fun -./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 ./examples/using_dune/wrapped_lib/values/values.mli:25: unused_closure -./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 @@ -121,8 +89,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 @@ -139,39 +106,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: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 -./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 ./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 -------- @@ -184,28 +136,32 @@ ./examples/docs/exported_values/code_constructs/function/function_lib.mli:9: do_nothing ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:8: F.externally_used -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used: Not detected -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required: Not detected -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required: Not detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:9: F.internally_used +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:14: Internal_param.used_required +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:15: Internal_param.unused_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:19: External_param.used_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:20: External_param.unused_required ./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:24: Internal_app.externally_used -./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used: Not detected +./examples/docs/exported_values/code_constructs/functor/functor_lib.mli:25: Internal_app.internally_used + ./examples/docs/exported_values/code_constructs/include/include_lib.ml:3: Original.used_directly ./examples/docs/exported_values/code_constructs/include/include_lib.ml:4: Original.used_indirectly ./examples/docs/exported_values/code_constructs/include/include_lib.ml:14: Redefine.used_directly ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:3: Original.used_directly ./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:4: Original.used_indirectly -./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement: Not detected +./examples/docs/exported_values/code_constructs/modsig/modsig_lib.ml:5: Original.used_by_requirement + ./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:17: M_redef.externally_used -./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used: Not detected +./examples/docs/exported_values/code_constructs/modtyp/modtyp_lib.mli:18: M_redef.internally_used + ./examples/docs/exported_values/code_constructs/module/module_lib.mli:4: M.externally_used -./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used: Not detected +./examples/docs/exported_values/code_constructs/module/module_lib.mli:5: M.internally_used + ./examples/docs/exported_values/hello_world/hello_world_lib.mli:2: hello ./examples/docs/exported_values/hello_world/hello_world_lib.mli:3: goodbye -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello: Not detected -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye: Not detected +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:2: hello +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:3: goodbye ./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:2: hello ./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:3: goodbye @@ -236,7 +192,6 @@ ./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_bin.ml:2: push_n_times -./examples/docs/methods/limitations/alias/alias_lib.mli:2: original: Should not be detected ./examples/docs/methods/limitations/alias/alias_lib.mli:8: alias ./examples/docs/optional_arguments/code_constructs/external_app/external_app_lib.mli:2: max @@ -244,10 +199,9 @@ ./examples/docs/optional_arguments/code_constructs/hof/hof_bin.ml:2: map_with_index -./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:2: max: Not detected -./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:3: min: Not detected -./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:2: max: Should not be detected -./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:3: min: Should not be detected +./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:2: max +./examples/docs/optional_arguments/code_constructs/internal_app/internal_app_lib.mli:3: min + ./examples/docs/optional_arguments/code_constructs/partial_app/partial_app_bin.ml:2: sum ./examples/docs/optional_arguments/code_constructs/total_app/total_app_bin.ml:2: sum @@ -296,10 +250,8 @@ ./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: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:3: internally_used ./examples/using_dune/preprocessed_lib/preprocessed.mli:4: externally_used -./examples/using_dune/preprocessed_lib/preprocessed.mli:31: exported_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 @@ -311,15 +263,17 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:20: Values_in_submodules.Exported.externally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:26: Values_in_submodules_no_intf.Exported.used ./examples/using_dune/reduced_lib/reduced_lib.mli:29: Values_in_submodules_no_intf.Exported.externally_used +./examples/using_dune/reduced_lib/values.mli:1: used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Not detected +./examples/using_dune/reduced_lib/values.mli:3: internally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:4: externally_used: Not detected -./examples/using_dune/reduced_lib/values.mli:6: lib_internal_used: Should not be detected -./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used: Not detected +./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used ./examples/using_dune/reduced_lib/values.mli:9: lib_internal_externally_used +./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Not detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used ./examples/using_dune/reduced_lib/values_in_submodules.mli:10: Exported.lib_internal_externally_used ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Not detected @@ -334,46 +288,27 @@ ./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used ./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_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: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: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/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_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: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 @@ -391,46 +326,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: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: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/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_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: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 @@ -451,8 +367,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 @@ -467,24 +384,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 @@ -495,25 +413,26 @@ ./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 -------- .>-> ALMOST UNUSED EXPORTED VALUES: Called 2 time(s): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./examples/docs/exported_values/hello_world/hello_world_lib.mli:4: world -./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world: Not detected +./examples/docs/exported_values/hello_world/hello_world_with_intf.mli:4: world ./examples/docs/exported_values/hello_world/hello_world_without_intf.ml:4: world -./examples/docs/methods/limitations/alias/alias_lib.mli:2: original: Not detected -./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:2: max: Not detected -./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:3: min: Not detected +./examples/docs/methods/limitations/alias/alias_lib.mli:2: original + +./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:2: max +./examples/docs/optional_arguments/code_constructs/intext_app/intext_app_lib.mli:3: min + ./examples/docs/optional_arguments/limitations/relaying/relaying_bin.ml:2: f -./examples/using_dune/preprocessed_lib/preprocessed.mli:2: used: Not detected -./examples/using_dune/preprocessed_lib/preprocessed.mli:6: immediate: Should not be detected -./examples/using_dune/preprocessed_lib/preprocessed.mli:31: exported_f: Not detected -./examples/using_dune/preprocessed_lib/preprocessed.mli:38: internally_used_f: Not detected +./examples/using_dune/preprocessed_lib/preprocessed.mli:2: used +./examples/using_dune/preprocessed_lib/preprocessed.mli:31: exported_f +./examples/using_dune/preprocessed_lib/preprocessed.mli:38: internally_used_f ./examples/using_dune/preprocessed_lib/preprocessed.mli:44: externally_used_f ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:3: used ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:53: f @@ -522,10 +441,10 @@ ./examples/using_dune/reduced_lib/values.mli:1: used: Not detected ./examples/using_dune/reduced_lib/values.mli:3: internally_used: Not detected -./examples/using_dune/reduced_lib/values.mli:6: lib_internal_used: Not detected +./examples/using_dune/reduced_lib/values.mli:6: lib_internal_used ./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Not detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used: Not detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:7: Exported.lib_internal_used @@ -533,78 +452,58 @@ ./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used: Not detected ./examples/using_dune/reduced_lib/values_no_intf.ml:10: lib_internal_used -./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:6: used_fun_with_single_sometimes_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: 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: 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: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/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:6: used_fun_with_single_sometimes_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: 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: 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: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/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 @@ -619,16 +518,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 -------- @@ -644,23 +543,21 @@ ./examples/docs/methods/code_constructs/object_type/object_type_lib.mli:9: int_stack -./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 -------------------------------------------------------------------------------- @@ -670,23 +567,27 @@ Nothing else to report in this section ./examples/docs/methods/code_constructs/class/class_bin.ml:2: unused_class#unused_method ./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#reset -./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#unused: Not detected +./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#unused + ./examples/docs/methods/code_constructs/constructor/constructor_bin.ml:2: unused_class#unused_method ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#reset ./examples/docs/methods/code_constructs/factory_fun/factory_fun_bin.ml:2: unused_factory#unused_method -./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#reset: Not detected +./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#reset + ./examples/docs/methods/code_constructs/immediate_object/immediate_object_bin.ml:2: unused_obj#unused_method -./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#reset: Not detected +./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#reset + ./examples/docs/methods/code_constructs/inheritance/inheritance_lib.mli:2: parent#unused ./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_lib.mli:2: stack#reset -./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#unused: Not detected +./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#unused +./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#used_by_alias: Should not be detected ./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding#m: Not detected ./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m -./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 @@ -696,14 +597,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 @@ -711,14 +613,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 @@ -748,17 +651,20 @@ Nothing else to report in this section ./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#pop ./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#push -./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#used_by_requirement: Not detected +./examples/docs/methods/code_constructs/coercion/coercion_lib.mli:2: obj#used_by_requirement + ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#peek ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#pop ./examples/docs/methods/code_constructs/constructor/constructor_lib.mli:2: int_stack#push -./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#peek: Not detected -./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#pop: Not detected -./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#push: Not detected -./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#peek: Not detected -./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#pop: Not detected -./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#push: Not detected +./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#peek +./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#pop +./examples/docs/methods/code_constructs/factory_fun/factory_fun_lib.mli:2: get_stack#push + +./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#peek +./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#pop +./examples/docs/methods/code_constructs/immediate_object/immediate_object_lib.mli:2: int_stack#push + ./examples/docs/methods/code_constructs/inheritance/inheritance_lib.mli:2: parent#used ./examples/docs/methods/code_constructs/inheritance/inheritance_lib.mli:2: parent#used_by_child @@ -766,41 +672,43 @@ Nothing else to report in this section ./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_lib.mli:2: stack#pop ./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_lib.mli:2: stack#push -./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#used: Not detected +./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#used ./examples/docs/methods/limitations/alias/alias_lib.mli:2: original#used_by_alias: Not detected -./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 @@ -832,7 +740,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 @@ -842,10 +750,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 @@ -853,10 +762,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 @@ -1227,8 +1137,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 @@ -1326,7 +1234,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) -------- @@ -1455,7 +1364,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 @@ -1639,7 +1547,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 1392 -Success: 1069 -Failed: 323 -Ratio: 76.7959770115% +Total: 1267 +Success: 1227 +Failed: 40 +Ratio: 96.8429360695% diff --git a/src/deadCode.ml b/src/deadCode.ml index d5c6e8e2..b51fb7e6 100644 --- a/src/deadCode.ml +++ b/src/deadCode.ml @@ -496,8 +496,8 @@ let load_file fn state = in let process_implementation fn = last_loc := Lexing.dummy_pos; - if state.State.config.verbose then - Printf.eprintf "Scanning implementation %s\n%!" fn; + if state.State.config.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 @@ -506,13 +506,7 @@ let load_file fn 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 - 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 cacfc55f..fbc610bd 100644 --- a/src/state/file_infos.ml +++ b/src/state/file_infos.ml @@ -53,8 +53,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 @@ -89,15 +90,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 00000000..efd295e8 --- /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 00000000..2a3738f4 --- /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 0caa2a0e..2d39559b 100644 --- a/src/state/state.ml +++ b/src/state/state.ml @@ -3,11 +3,13 @@ module File_infos = File_infos type t = { config : Config.t ; file_infos : File_infos.t + ; signature : Signature.t } let init config = { config ; file_infos = File_infos.empty + ; signature = Signature.empty () } let update_config config state = @@ -18,21 +20,24 @@ let change_file state cm_file = 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 -> {state with file_infos}) file_infos else - let file_infos = File_infos.init cm_file in - Result.map (fun file_infos -> {state with 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 {state with file_infos; signature} (** Analysis' state *) let current = ref { config = Config.default_config ; file_infos = File_infos.empty + ; signature = Signature.empty () } let get_current () = !current diff --git a/src/state/state.mli b/src/state/state.mli index f9c0bd28..da5405d7 100644 --- a/src/state/state.mli +++ b/src/state/state.mli @@ -5,6 +5,9 @@ module File_infos = File_infos type t = { config : Config.t (** Configuration of the analysis *) ; file_infos : File_infos.t (** Info about the file being analyzed *) + ; signature : Signature.t + (** Data extracted or built using the current compialtion unit's + signature *) } val init : Config.t -> t From e7ab3718364af58f59afb9460005fbbe27ce9ea2 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 06/15] [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 | 10 ++-- src/state/state.mli | 3 -- 9 files changed, 131 insertions(+), 122 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 b51fb7e6..b6601b60 100644 --- a/src/deadCode.ml +++ b/src/deadCode.ml @@ -501,26 +501,13 @@ let load_file fn state = 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 Config.must_report_section state.config.sections.exported_values then @@ -536,7 +523,7 @@ let load_file fn state = Some (loc1, loc2) else None ) - 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 fbc610bd..d68ecfac 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: @@ -36,7 +38,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]). @@ -81,7 +89,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 @@ -91,7 +107,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 2807c9e7..9ec37d51 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 00000000..44ca015f --- /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 00000000..1b142b5b --- /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 efd295e8..00000000 --- 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 2a3738f4..00000000 --- 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 2d39559b..645131ee 100644 --- a/src/state/state.ml +++ b/src/state/state.ml @@ -3,18 +3,17 @@ module File_infos = File_infos type t = { config : Config.t ; file_infos : File_infos.t - ; signature : Signature.t } let init config = { config ; file_infos = File_infos.empty - ; signature = Signature.empty () } let update_config config state = {state with config} + let change_file state cm_file = let file_infos = state.file_infos in let equal_no_ext filename1 filename2 = @@ -28,16 +27,13 @@ let change_file state cm_file = let file_infos = File_infos.change_file file_infos cm_file in Result.map (fun file_infos -> {state with file_infos}) file_infos else - 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 {state with file_infos; signature} + let file_infos = File_infos.init cm_file in + Result.map (fun file_infos -> {state with file_infos}) file_infos (** Analysis' state *) let current = ref { config = Config.default_config ; file_infos = File_infos.empty - ; signature = Signature.empty () } let get_current () = !current diff --git a/src/state/state.mli b/src/state/state.mli index da5405d7..f9c0bd28 100644 --- a/src/state/state.mli +++ b/src/state/state.mli @@ -5,9 +5,6 @@ module File_infos = File_infos type t = { config : Config.t (** Configuration of the analysis *) ; file_infos : File_infos.t (** Info about the file being analyzed *) - ; signature : Signature.t - (** Data extracted or built using the current compialtion unit's - signature *) } val init : Config.t -> t From 3d037e7f594b68b870b93a53b7761ad4ad465e93 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 07/15] [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 b6601b60..b0cf475d 100644 --- a/src/deadCode.ml +++ b/src/deadCode.ml @@ -488,9 +488,9 @@ let load_file fn state = if state.State.config.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 @@ -499,16 +499,17 @@ let load_file fn state = if state.State.config.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 Config.must_report_section state.config.sections.exported_values then let sourceunit = @@ -527,7 +528,6 @@ let load_file fn state = else [] in eof loc_dep - | _ -> () (* todo: support partial_implementation? *) ) in let exclude filepath = Config.is_excluded filepath state.State.config in diff --git a/src/state/file_infos.ml b/src/state/file_infos.ml index d68ecfac..b013b3ca 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,120 +12,126 @@ 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 Utils.Filepath.remove_pp cmt_infos.cmt_sourcefile |> Option.map (Filename.concat builddir) 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 9ec37d51..9e381336 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 44ca015f..2ade7ffc 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 1b142b5b..c6dc3fbc 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 0557543bd671a20797f0c79621e64caa9b5a41ca 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 08/15] [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 b0cf475d..06c65a45 100644 --- a/src/deadCode.ml +++ b/src/deadCode.ml @@ -483,13 +483,18 @@ let load_file fn state = (* TODO: stateful computations should take and return the state when possible *) state in + let add_bad_file err fn = + if state.State.config.verbose then + Printf.eprintf "%s\n%!" err; + bad_files := fn :: !bad_files + in let process_interface fn = last_loc := Lexing.dummy_pos; if state.State.config.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 ) @@ -500,7 +505,7 @@ let load_file fn state = 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) = From e7ccb8cb0e128fad46b4c3082876924b1633498b Mon Sep 17 00:00:00 2001 From: Corentin De Souza <9597216+fantazio@users.noreply.github.com> Date: Sun, 8 Feb 2026 17:48:57 +0100 Subject: [PATCH 09/15] [src][state][loc_dep][1/n] read external cm files if needed This fixes the remaining FP/FN --- check/classic/classic.ref | 18 ++------ check/internal/internal.ref | 14 ++---- check/threshold-1/threshold-1.ref | 40 +++++----------- check/threshold-3-0.5/threshold-3-0.5.ref | 56 ++++++++--------------- src/state/file_infos.ml | 18 ++++---- src/state/file_infos.mli | 10 ++-- src/state/location_dependencies.ml | 38 ++++++++++----- src/state/location_dependencies.mli | 11 +++-- src/state/state.ml | 5 +- 9 files changed, 90 insertions(+), 120 deletions(-) diff --git a/check/classic/classic.ref b/check/classic/classic.ref index 4f323c7f..35ae2f3d 100644 --- a/check/classic/classic.ref +++ b/check/classic/classic.ref @@ -63,23 +63,11 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:19: Values_in_submodules.Exported.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:27: Values_in_submodules_no_intf.Exported.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:28: Values_in_submodules_no_intf.Exported.internally_used -./examples/using_dune/reduced_lib/values.mli:1: used: Should not be detected -./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values.mli:3: internally_used: Should not be detected -./examples/using_dune/reduced_lib/values.mli:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:7: lib_internal_unused ./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used -./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg @@ -731,7 +719,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 605 +Total: 593 Success: 586 -Failed: 19 -Ratio: 96.8595041322% +Failed: 7 +Ratio: 98.8195615514% diff --git a/check/internal/internal.ref b/check/internal/internal.ref index dd150b77..5c83976b 100644 --- a/check/internal/internal.ref +++ b/check/internal/internal.ref @@ -48,17 +48,9 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:19: Values_in_submodules.Exported.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:27: Values_in_submodules_no_intf.Exported.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:28: Values_in_submodules_no_intf.Exported.internally_used -./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values.mli:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:7: lib_internal_unused -./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg @@ -679,7 +671,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 557 +Total: 549 Success: 542 -Failed: 15 -Ratio: 97.3070017953% +Failed: 7 +Ratio: 98.7249544627% diff --git a/check/threshold-1/threshold-1.ref b/check/threshold-1/threshold-1.ref index 7c6a07da..eb6e1268 100644 --- a/check/threshold-1/threshold-1.ref +++ b/check/threshold-1/threshold-1.ref @@ -48,17 +48,9 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:19: Values_in_submodules.Exported.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:27: Values_in_submodules_no_intf.Exported.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:28: Values_in_submodules_no_intf.Exported.internally_used -./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values.mli:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:7: lib_internal_unused -./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg @@ -263,28 +255,20 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:20: Values_in_submodules.Exported.externally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:26: Values_in_submodules_no_intf.Exported.used ./examples/using_dune/reduced_lib/reduced_lib.mli:29: Values_in_submodules_no_intf.Exported.externally_used -./examples/using_dune/reduced_lib/values.mli:1: used: Should not be detected -./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Not detected -./examples/using_dune/reduced_lib/values.mli:3: internally_used: Should not be detected -./examples/using_dune/reduced_lib/values.mli:4: externally_used: Not detected +./examples/using_dune/reduced_lib/values.mli:2: used_by_API +./examples/using_dune/reduced_lib/values.mli:4: externally_used ./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used ./examples/using_dune/reduced_lib/values.mli:9: lib_internal_externally_used -./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Not detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API +./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used ./examples/using_dune/reduced_lib/values_in_submodules.mli:10: Exported.lib_internal_externally_used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Not detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:9: Exported.lib_internal_internally_used ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:10: Exported.lib_internal_externally_used -./examples/using_dune/reduced_lib/values_no_intf.ml:1: used: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API +./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used ./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used ./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_externally_used @@ -1143,7 +1127,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 945 -Success: 913 -Failed: 32 -Ratio: 96.6137566138% +Total: 929 +Success: 921 +Failed: 8 +Ratio: 99.1388589882% 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 c9555141..e04bb50c 100644 --- a/check/threshold-3-0.5/threshold-3-0.5.ref +++ b/check/threshold-3-0.5/threshold-3-0.5.ref @@ -48,17 +48,9 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:19: Values_in_submodules.Exported.internally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:27: Values_in_submodules_no_intf.Exported.used_by_API ./examples/using_dune/reduced_lib/reduced_lib.mli:28: Values_in_submodules_no_intf.Exported.internally_used -./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values.mli:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values.mli:7: lib_internal_unused -./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules.mli:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:8: Exported.lib_internal_unused -./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Should not be detected ./examples/using_dune/reduced_lib/values_no_intf.ml:11: lib_internal_unused ./examples/using_dune/unwrapped_lib/opt_args/opt_args.mli:1: unused_fun_with_single_never_used_opt_arg @@ -263,28 +255,20 @@ ./examples/using_dune/reduced_lib/reduced_lib.mli:20: Values_in_submodules.Exported.externally_used ./examples/using_dune/reduced_lib/reduced_lib.mli:26: Values_in_submodules_no_intf.Exported.used ./examples/using_dune/reduced_lib/reduced_lib.mli:29: Values_in_submodules_no_intf.Exported.externally_used -./examples/using_dune/reduced_lib/values.mli:1: used: Should not be detected -./examples/using_dune/reduced_lib/values.mli:2: used_by_API: Not detected -./examples/using_dune/reduced_lib/values.mli:3: internally_used: Should not be detected -./examples/using_dune/reduced_lib/values.mli:4: externally_used: Not detected +./examples/using_dune/reduced_lib/values.mli:2: used_by_API +./examples/using_dune/reduced_lib/values.mli:4: externally_used ./examples/using_dune/reduced_lib/values.mli:8: lib_internal_internally_used ./examples/using_dune/reduced_lib/values.mli:9: lib_internal_externally_used -./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API: Not detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:3: Exported.used_by_API +./examples/using_dune/reduced_lib/values_in_submodules.mli:5: Exported.externally_used ./examples/using_dune/reduced_lib/values_in_submodules.mli:9: Exported.lib_internal_internally_used ./examples/using_dune/reduced_lib/values_in_submodules.mli:10: Exported.lib_internal_externally_used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API: Not detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:3: Exported.used_by_API +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:5: Exported.externally_used ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:9: Exported.lib_internal_internally_used ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:10: Exported.lib_internal_externally_used -./examples/using_dune/reduced_lib/values_no_intf.ml:1: used: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used: Should not be detected -./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:2: used_by_API +./examples/using_dune/reduced_lib/values_no_intf.ml:4: externally_used ./examples/using_dune/reduced_lib/values_no_intf.ml:12: lib_internal_internally_used ./examples/using_dune/reduced_lib/values_no_intf.ml:13: lib_internal_externally_used @@ -439,17 +423,17 @@ ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:59: internally_used_f ./examples/using_dune/preprocessed_lib/preprocessed_no_intf.ml:64: externally_used_f -./examples/using_dune/reduced_lib/values.mli:1: used: Not detected -./examples/using_dune/reduced_lib/values.mli:3: internally_used: Not detected +./examples/using_dune/reduced_lib/values.mli:1: used +./examples/using_dune/reduced_lib/values.mli:3: internally_used ./examples/using_dune/reduced_lib/values.mli:6: lib_internal_used -./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used: Not detected -./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules.mli:2: Exported.used +./examples/using_dune/reduced_lib/values_in_submodules.mli:4: Exported.internally_used ./examples/using_dune/reduced_lib/values_in_submodules.mli:7: Exported.lib_internal_used -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used: Not detected -./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used: Not detected +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:2: Exported.used +./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:4: Exported.internally_used ./examples/using_dune/reduced_lib/values_in_submodules_no_intf.ml:7: Exported.lib_internal_used -./examples/using_dune/reduced_lib/values_no_intf.ml:1: used: Not detected -./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used: Not detected +./examples/using_dune/reduced_lib/values_no_intf.ml:1: used +./examples/using_dune/reduced_lib/values_no_intf.ml:3: internally_used ./examples/using_dune/reduced_lib/values_no_intf.ml:10: lib_internal_used ./examples/using_dune/unwrapped_lib/obj/with_class.mli:33: fun_class_factory @@ -1547,7 +1531,7 @@ Nothing else to report in this section -------------------------------------------------------------------------------- -Total: 1267 -Success: 1227 -Failed: 40 -Ratio: 96.8429360695% +Total: 1251 +Success: 1243 +Failed: 8 +Ratio: 99.3605115907% diff --git a/src/state/file_infos.ml b/src/state/file_infos.ml index b013b3ca..772d6c77 100644 --- a/src/state/file_infos.ml +++ b/src/state/file_infos.ml @@ -64,7 +64,7 @@ let init_from_cmti_file cmti_file = 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 init_from_cmt_file ~cm_paths cmt_file = let* file_infos, cmt_infos = init_from_cm_file cmt_file in let* cmt_struct = match cmt_infos.cmt_annots with @@ -82,26 +82,26 @@ let init_from_cmt_file cmt_file = | Ok file_infos -> file_infos.cmti_uid_to_decl in let+ location_dependencies = - Location_dependencies.init cmt_infos cmti_uid_to_decl + Location_dependencies.init ~cm_paths cmt_infos cmti_uid_to_decl in let file_infos = {file_infos with cmt_struct; cmti_uid_to_decl; location_dependencies} in file_infos, cmt_infos -let init cm_file = +let init ~cm_paths cm_file = match Filename.extension cm_file with | ".cmt" -> - let+ file_infos, _ = init_from_cmt_file cm_file in + let+ file_infos, _ = init_from_cmt_file ~cm_paths 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* file_infos, cmt_infos = init_from_cmt_file ~cm_paths cmt_file in let+ location_dependencies = - Location_dependencies.init cmt_infos file_infos.cmti_uid_to_decl + Location_dependencies.init ~cm_paths cmt_infos file_infos.cmti_uid_to_decl in {file_infos with location_dependencies} in @@ -113,7 +113,7 @@ let init cm_file = ) | _ -> Result.error (cm_file ^ ": not a .cmti or .cmt file") -let change_file file_infos cm_file = +let change_file ~cm_paths 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 @@ -121,7 +121,7 @@ let change_file file_infos cm_file = 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 + | [] -> Location_dependencies.init ~cm_paths cmt_infos cmti_uid_to_decl | loc_dep -> (* They have already been computed *) Result.ok loc_dep in @@ -131,7 +131,7 @@ let change_file file_infos cm_file = {res with cmti_uid_to_decl = cutd; cmt_struct; location_dependencies} | _ -> (* invalid extension or the corresponding info is None *) - init cm_file + init ~cm_paths 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 9e381336..209dcddc 100644 --- a/src/state/file_infos.mli +++ b/src/state/file_infos.mli @@ -16,20 +16,22 @@ type t = { val empty : t (** No file info *) -val init : string -> (t, string) result +val init : cm_paths: Utils.StringSet.t -> string -> (t, string) result (** [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. *) + describing the issue. + [cm_paths] is used to load external cm files if necessary. *) -val change_file : t -> string -> (t, string) result +val change_file : cm_paths: Utils.StringSet.t -> t -> string -> (t, string) result (** [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 [cmti_infos] or [cmt_infos] is available. Otherwise, it is the result of - [init t] *) + [init t]. + [cm_paths] is used to load external cm files if necessary. *) val has_sourcepath : t -> bool diff --git a/src/state/location_dependencies.ml b/src/state/location_dependencies.ml index 2ade7ffc..75e75fe9 100644 --- a/src/state/location_dependencies.ml +++ b/src/state/location_dependencies.ml @@ -34,26 +34,40 @@ let fill_from_structure (structure : Typedtree.structure) res_uid_to_loc = iterator.structure iterator structure; res_uid_to_loc +let loc_opt_of_item_decl = function + | Typedtree.Value {val_loc = loc; _} + | Typedtree.Value_binding {vb_pat = {pat_loc = loc; _}; _} -> + Some loc.loc_start + | _ -> None + 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; _} - | 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 + let loc = loc_opt_of_item_decl item_decl in Option.iter (UidTbl.replace res_uid_to_loc uid) loc in 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 = +let find_opt_external_uid_loc ~cm_paths = function + | Shape.Uid.(Compilation_unit _ | Internal | Predef _) -> None + | Item {comp_unit; _} as uid -> + let ( let* ) x f = Option.bind x f in + let* cm_path = + Utils.StringSet.elements cm_paths + |> List.rev + |> List.find_opt (fun path -> Utils.Filepath.unit path = comp_unit) + in + let* cmt_infos = Cmt_format.read cm_path |> snd in + let* item_decl = UidTbl.find_opt cmt_infos.cmt_uid_to_decl uid in + loc_opt_of_item_decl item_decl + +let cmt_decl_dep_to_loc_dep ~cm_paths 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 + match UidTbl.find_opt uid_to_loc uid with + | Some _ as loc -> loc + | None -> find_opt_external_uid_loc ~cm_paths uid in let* def_loc = loc_opt_of_uid uid_def in let* decl_loc = loc_opt_of_uid uid_decl in @@ -61,7 +75,7 @@ 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_uid_to_decl = +let init ~cm_paths cmt_infos cmti_uid_to_decl = match cmt_infos.Cmt_format.cmt_annots with | Implementation structure -> let fill_from_cmti_tbl tbl = @@ -75,6 +89,6 @@ let init cmt_infos cmti_uid_to_decl = |> 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 + |> cmt_decl_dep_to_loc_dep ~cm_paths 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 c6dc3fbc..80046876 100644 --- a/src/state/location_dependencies.mli +++ b/src/state/location_dependencies.mli @@ -5,11 +5,16 @@ val empty : t (** No signature read *) 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 +val init : + cm_paths: Utils.StringSet.t + -> Cmt_format.cmt_infos + -> uid_to_decl option + -> (t, string) result +(** [init ~cm_paths 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] does not contain an implementation, it returns an - [Err msg] with msg a string describing the issue. *) + [Err msg] with msg a string describing the issue. + [cm_paths] is used to load external cm files if necessary. *) diff --git a/src/state/state.ml b/src/state/state.ml index 645131ee..8b71b2bd 100644 --- a/src/state/state.ml +++ b/src/state/state.ml @@ -21,13 +21,14 @@ let change_file state cm_file = let no_ext2 = Filename.remove_extension filename2 in String.equal no_ext1 no_ext2 in + let cm_paths = state.config.paths_to_analyze in 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 + let file_infos = File_infos.change_file ~cm_paths file_infos cm_file in Result.map (fun file_infos -> {state with file_infos}) file_infos else - let file_infos = File_infos.init cm_file in + let file_infos = File_infos.init ~cm_paths cm_file in Result.map (fun file_infos -> {state with file_infos}) file_infos (** Analysis' state *) From 44428f24956b591d26fd6cdbfcf5ec9ae75fcb1b Mon Sep 17 00:00:00 2001 From: Corentin De Souza <9597216+fantazio@users.noreply.github.com> Date: Sun, 8 Feb 2026 18:34:25 +0100 Subject: [PATCH 10/15] [src][state][loc_dep][2/n] add cache for external uids This significantly improves the performances (compared to the previous commit) measured on Frama-C : -84% time, same memory. This is still however noticeably less performant than the OCaml 5.2 -compatible version : +246% time, +39% memory. --- src/state/location_dependencies.ml | 41 ++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/src/state/location_dependencies.ml b/src/state/location_dependencies.ml index 75e75fe9..52dcb844 100644 --- a/src/state/location_dependencies.ml +++ b/src/state/location_dependencies.ml @@ -48,18 +48,31 @@ let fill_from_cmt_tbl uid_to_decl res_uid_to_loc = UidTbl.iter add_uid_loc uid_to_decl; res_uid_to_loc -let find_opt_external_uid_loc ~cm_paths = function - | Shape.Uid.(Compilation_unit _ | Internal | Predef _) -> None - | Item {comp_unit; _} as uid -> - let ( let* ) x f = Option.bind x f in - let* cm_path = - Utils.StringSet.elements cm_paths - |> List.rev - |> List.find_opt (fun path -> Utils.Filepath.unit path = comp_unit) - in - let* cmt_infos = Cmt_format.read cm_path |> snd in - let* item_decl = UidTbl.find_opt cmt_infos.cmt_uid_to_decl uid in - loc_opt_of_item_decl item_decl +let find_opt_external_uid_loc, clear_external_cache = + let cache = Hashtbl.create 16 in + let clear_external_cache () = Hashtbl.reset cache in + let find_opt_external_uid_loc ~cm_paths = function + | Shape.Uid.(Compilation_unit _ | Internal | Predef _) -> None + | Item {comp_unit; _} as uid -> + let ( let* ) x f = Option.bind x f in + let* cmt_uid_to_decl = + match Hashtbl.find_opt cache comp_unit with + | Some _ as cmt_uid_to_decl -> cmt_uid_to_decl + | None -> + let* cm_path = + Utils.StringSet.elements cm_paths + |> List.rev + |> List.find_opt (fun path -> Utils.Filepath.unit path = comp_unit) + in + let* cmt_infos = Cmt_format.read cm_path |> snd in + let cmt_uid_to_decl = cmt_infos.cmt_uid_to_decl in + Hashtbl.add cache comp_unit cmt_uid_to_decl; + Some cmt_uid_to_decl + in + let* item_decl = UidTbl.find_opt cmt_uid_to_decl uid in + loc_opt_of_item_decl item_decl + in + find_opt_external_uid_loc, clear_external_cache let cmt_decl_dep_to_loc_dep ~cm_paths cmt_decl_dep uid_to_loc = let convert_pair (_dep_kind, uid_def, uid_decl) = @@ -73,7 +86,9 @@ let cmt_decl_dep_to_loc_dep ~cm_paths cmt_decl_dep uid_to_loc = 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 res = List.filter_map convert_pair cmt_decl_dep in + clear_external_cache (); + res let init ~cm_paths cmt_infos cmti_uid_to_decl = match cmt_infos.Cmt_format.cmt_annots with From 029a8455545eec54e134cd7d67d571c25cc8e5c9 Mon Sep 17 00:00:00 2001 From: Corentin De Souza <9597216+fantazio@users.noreply.github.com> Date: Sun, 8 Feb 2026 18:39:18 +0100 Subject: [PATCH 11/15] [src][state][loc_dep][3/n] stop exploring includes --- src/state/location_dependencies.ml | 31 +----------------------------- 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/src/state/location_dependencies.ml b/src/state/location_dependencies.ml index 52dcb844..dc1e4a2a 100644 --- a/src/state/location_dependencies.ml +++ b/src/state/location_dependencies.ml @@ -6,34 +6,6 @@ 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 - | 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 loc_opt_of_item_decl = function | Typedtree.Value {val_loc = loc; _} | Typedtree.Value_binding {vb_pat = {pat_loc = loc; _}; _} -> @@ -92,7 +64,7 @@ let cmt_decl_dep_to_loc_dep ~cm_paths cmt_decl_dep uid_to_loc = let init ~cm_paths cmt_infos cmti_uid_to_decl = match cmt_infos.Cmt_format.cmt_annots with - | Implementation structure -> + | Implementation _ -> let fill_from_cmti_tbl tbl = match cmti_uid_to_decl with | None -> tbl @@ -101,7 +73,6 @@ let init ~cm_paths cmt_infos cmti_uid_to_decl = 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 ~cm_paths cmt_infos.cmt_declaration_dependencies From 02bcdc5574bfdc1d897b08eeef416e0a3bcda752 Mon Sep 17 00:00:00 2001 From: Corentin De Souza <9597216+fantazio@users.noreply.github.com> Date: Wed, 25 Mar 2026 19:26:39 +0100 Subject: [PATCH 12/15] [src][state][cmt] add caching This replaces the previous local cache in location dependencies computation. This improves the performance measured on Frama-C : -56% time, +10% memory. Compared to the OCaml 5.2-compatible version : +51% time, +52% memory. --- src/state/cmt.ml | 66 ++++++++++++++++++++++++++++++ src/state/cmt.mli | 9 ++++ src/state/file_infos.ml | 7 ++-- src/state/location_dependencies.ml | 44 ++++++++++---------- 4 files changed, 100 insertions(+), 26 deletions(-) create mode 100644 src/state/cmt.ml create mode 100644 src/state/cmt.mli diff --git a/src/state/cmt.ml b/src/state/cmt.ml new file mode 100644 index 00000000..cf67e257 --- /dev/null +++ b/src/state/cmt.ml @@ -0,0 +1,66 @@ +module Cache = struct + (** O(1) addition and retrieval *) + + type ('k, 'v) t = + { store : ('k, 'v) Hashtbl.t + (** filepath -> cmi_cmt_infos *) + ; capacity : int (** n <= capacity *) + ; mutable hit : int + ; mutable miss : int + } + + let create capacity = + { store = Hashtbl.create capacity + ; capacity + ; hit = 0 + ; miss = 0 + } + + let find_opt (cache : ('k, 'v) t) (key : 'k) : 'v option = + let res = Hashtbl.find_opt cache.store key in + if Option.is_some res then cache.hit <- cache.hit + 1 + else (cache.miss <- cache.miss + 1); + res + + let add cache key value = + if Hashtbl.length cache.store = cache.capacity then + Hashtbl.reset cache.store; + Hashtbl.replace cache.store key value + +end + +let read_no_cache filepath = + match Cmt_format.read filepath with + | exception _ -> Result.error (filepath ^ ": error reading file") + | _, None -> Result.error (filepath ^ ": cmt_infos not found") + | cmi_infos, Some cmt_infos -> + Result.ok (cmi_infos, cmt_infos) + +type cmi_cmt_infos = Cmi_format.cmi_infos option * Cmt_format.cmt_infos + +let cache_cmt : ((string * string), (string * cmi_cmt_infos)) Cache.t = Cache.create 64 + +let read filepath = + let comp_unit = Utils.Filepath.unit filepath in + let ext = Filename.extension filepath in + match Cache.find_opt cache_cmt (ext, comp_unit) with + | Some (fp, res) when String.equal fp filepath -> Result.ok res + | _ -> + read_no_cache filepath + |> Result.map (fun cmi_cmt_infos -> + Cache.add cache_cmt (ext, comp_unit) (filepath, cmi_cmt_infos); + cmi_cmt_infos) + +let find_cached_from_comp_unit comp_unit ext = + Cache.find_opt cache_cmt (ext, comp_unit) + |> Option.map snd + +let cached_cmti comp_unit = + find_cached_from_comp_unit comp_unit ".cmti" + +let cached_cmt comp_unit = + find_cached_from_comp_unit comp_unit ".cmt" + +let print_cache_stats () = + print_endline (Printf.sprintf "CMT CACHE : hit = %i ; miss = %i" + cache_cmt.hit cache_cmt.miss) diff --git a/src/state/cmt.mli b/src/state/cmt.mli new file mode 100644 index 00000000..97996a7a --- /dev/null +++ b/src/state/cmt.mli @@ -0,0 +1,9 @@ +type cmi_cmt_infos = Cmi_format.cmi_infos option * Cmt_format.cmt_infos + +val read : string -> (cmi_cmt_infos, string) Result.t + +val cached_cmti : string -> cmi_cmt_infos option + +val cached_cmt : string -> cmi_cmt_infos option + +val print_cache_stats : unit -> unit diff --git a/src/state/file_infos.ml b/src/state/file_infos.ml index 772d6c77..b0efac82 100644 --- a/src/state/file_infos.ml +++ b/src/state/file_infos.ml @@ -47,10 +47,9 @@ let empty = { 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 -> + match Cmt.read cm_file with + | Error _ as err -> err + | Ok (cmi_infos, cmt_infos) -> let file_infos = init_from_all_cm_infos ~cm_file ~cmi_infos cmt_infos in diff --git a/src/state/location_dependencies.ml b/src/state/location_dependencies.ml index dc1e4a2a..b69f9033 100644 --- a/src/state/location_dependencies.ml +++ b/src/state/location_dependencies.ml @@ -20,31 +20,32 @@ let fill_from_cmt_tbl uid_to_decl res_uid_to_loc = UidTbl.iter add_uid_loc uid_to_decl; res_uid_to_loc -let find_opt_external_uid_loc, clear_external_cache = - let cache = Hashtbl.create 16 in - let clear_external_cache () = Hashtbl.reset cache in - let find_opt_external_uid_loc ~cm_paths = function - | Shape.Uid.(Compilation_unit _ | Internal | Predef _) -> None - | Item {comp_unit; _} as uid -> +let find_opt_external_uid_loc ~cm_paths = function + | Shape.Uid.(Compilation_unit _ | Internal | Predef _) -> None + | Item {comp_unit; from; _} as uid -> let ( let* ) x f = Option.bind x f in - let* cmt_uid_to_decl = - match Hashtbl.find_opt cache comp_unit with - | Some _ as cmt_uid_to_decl -> cmt_uid_to_decl - | None -> - let* cm_path = - Utils.StringSet.elements cm_paths - |> List.rev - |> List.find_opt (fun path -> Utils.Filepath.unit path = comp_unit) - in - let* cmt_infos = Cmt_format.read cm_path |> snd in - let cmt_uid_to_decl = cmt_infos.cmt_uid_to_decl in - Hashtbl.add cache comp_unit cmt_uid_to_decl; - Some cmt_uid_to_decl + let cached = + match from with + | Unit_info.Intf -> Cmt.cached_cmti comp_unit + | Unit_info.Impl -> Cmt.cached_cmt comp_unit in + let read_from_path () = + let* cm_path = + Utils.StringSet.elements cm_paths + |> List.rev + |> List.find_opt (fun path -> Utils.Filepath.unit path = comp_unit) + in + Cmt.read cm_path |> Result.to_option + in + let* cmi_cmt_infos = + match cached with + | Some _ as some -> some + | None -> read_from_path () + in + let cmt_infos = snd cmi_cmt_infos in + let cmt_uid_to_decl = cmt_infos.cmt_uid_to_decl in let* item_decl = UidTbl.find_opt cmt_uid_to_decl uid in loc_opt_of_item_decl item_decl - in - find_opt_external_uid_loc, clear_external_cache let cmt_decl_dep_to_loc_dep ~cm_paths cmt_decl_dep uid_to_loc = let convert_pair (_dep_kind, uid_def, uid_decl) = @@ -59,7 +60,6 @@ let cmt_decl_dep_to_loc_dep ~cm_paths cmt_decl_dep uid_to_loc = Some (def_loc, decl_loc) in let res = List.filter_map convert_pair cmt_decl_dep in - clear_external_cache (); res let init ~cm_paths cmt_infos cmti_uid_to_decl = From 9cf38485e228da8305266a6ea985fb946f38ba94 Mon Sep 17 00:00:00 2001 From: Corentin De Souza <9597216+fantazio@users.noreply.github.com> Date: Fri, 10 Apr 2026 16:33:01 +0200 Subject: [PATCH 13/15] [src][state] store comp_unit_to_path table This table drastically speeds up the lookup for the corresponding cmt/cmti from the compilation unit when recreating location_dependecies. This improves the performance measured on Frama-C : -33% time, +7% memory. Compared to the OCaml 5.2-compatible version : +1% time, +45% memory. --- src/state/file_infos.ml | 18 +++++++++--------- src/state/file_infos.mli | 15 +++++++++++---- src/state/location_dependencies.ml | 21 +++++++++++++-------- src/state/location_dependencies.mli | 6 +++--- src/state/state.ml | 17 ++++++++++++++--- src/state/state.mli | 2 ++ 6 files changed, 52 insertions(+), 27 deletions(-) diff --git a/src/state/file_infos.ml b/src/state/file_infos.ml index b0efac82..89b676eb 100644 --- a/src/state/file_infos.ml +++ b/src/state/file_infos.ml @@ -63,7 +63,7 @@ let init_from_cmti_file cmti_file = 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 ~cm_paths cmt_file = +let init_from_cmt_file ~comp_unit_to_path cmt_file = let* file_infos, cmt_infos = init_from_cm_file cmt_file in let* cmt_struct = match cmt_infos.cmt_annots with @@ -81,26 +81,26 @@ let init_from_cmt_file ~cm_paths cmt_file = | Ok file_infos -> file_infos.cmti_uid_to_decl in let+ location_dependencies = - Location_dependencies.init ~cm_paths cmt_infos cmti_uid_to_decl + Location_dependencies.init ~comp_unit_to_path cmt_infos cmti_uid_to_decl in let file_infos = {file_infos with cmt_struct; cmti_uid_to_decl; location_dependencies} in file_infos, cmt_infos -let init ~cm_paths cm_file = +let init ~comp_unit_to_path cm_file = match Filename.extension cm_file with | ".cmt" -> - let+ file_infos, _ = init_from_cmt_file ~cm_paths cm_file in + let+ file_infos, _ = init_from_cmt_file ~comp_unit_to_path 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 ~cm_paths cmt_file in + let* file_infos, cmt_infos = init_from_cmt_file ~comp_unit_to_path cmt_file in let+ location_dependencies = - Location_dependencies.init ~cm_paths cmt_infos file_infos.cmti_uid_to_decl + Location_dependencies.init ~comp_unit_to_path cmt_infos file_infos.cmti_uid_to_decl in {file_infos with location_dependencies} in @@ -112,7 +112,7 @@ let init ~cm_paths cm_file = ) | _ -> Result.error (cm_file ^ ": not a .cmti or .cmt file") -let change_file ~cm_paths file_infos cm_file = +let change_file ~comp_unit_to_path 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 @@ -120,7 +120,7 @@ let change_file ~cm_paths file_infos cm_file = let* res, cmt_infos = init_from_cm_file cm_file in let+ location_dependencies = match file_infos.location_dependencies with - | [] -> Location_dependencies.init ~cm_paths cmt_infos cmti_uid_to_decl + | [] -> Location_dependencies.init ~comp_unit_to_path cmt_infos cmti_uid_to_decl | loc_dep -> (* They have already been computed *) Result.ok loc_dep in @@ -130,7 +130,7 @@ let change_file ~cm_paths file_infos cm_file = {res with cmti_uid_to_decl = cutd; cmt_struct; location_dependencies} | _ -> (* invalid extension or the corresponding info is None *) - init ~cm_paths cm_file + init ~comp_unit_to_path 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 209dcddc..a4cc8fe3 100644 --- a/src/state/file_infos.mli +++ b/src/state/file_infos.mli @@ -16,22 +16,29 @@ type t = { val empty : t (** No file info *) -val init : cm_paths: Utils.StringSet.t -> string -> (t, string) result +val init : + comp_unit_to_path: (string, string) Hashtbl.t + -> string + -> (t, string) result (** [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. - [cm_paths] is used to load external cm files if necessary. *) + [comp_unit_to_path] is used to load external cm files if necessary. *) -val change_file : cm_paths: Utils.StringSet.t -> t -> string -> (t, string) result +val change_file : + comp_unit_to_path: (string, string) Hashtbl.t + -> t + -> string + -> (t, string) result (** [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 [cmti_infos] or [cmt_infos] is available. Otherwise, it is the result of [init t]. - [cm_paths] is used to load external cm files if necessary. *) + [comp_unit_to_path] is used to load external cm files if necessary. *) val has_sourcepath : t -> bool diff --git a/src/state/location_dependencies.ml b/src/state/location_dependencies.ml index b69f9033..e31078c5 100644 --- a/src/state/location_dependencies.ml +++ b/src/state/location_dependencies.ml @@ -20,7 +20,7 @@ let fill_from_cmt_tbl uid_to_decl res_uid_to_loc = UidTbl.iter add_uid_loc uid_to_decl; res_uid_to_loc -let find_opt_external_uid_loc ~cm_paths = function +let find_opt_external_uid_loc ~comp_unit_to_path = function | Shape.Uid.(Compilation_unit _ | Internal | Predef _) -> None | Item {comp_unit; from; _} as uid -> let ( let* ) x f = Option.bind x f in @@ -31,9 +31,14 @@ let find_opt_external_uid_loc ~cm_paths = function in let read_from_path () = let* cm_path = - Utils.StringSet.elements cm_paths - |> List.rev - |> List.find_opt (fun path -> Utils.Filepath.unit path = comp_unit) + Hashtbl.find_all comp_unit_to_path comp_unit + |> List.find_opt + (fun path -> + match Filename.extension path with + | ".cmti" -> from = Unit_info.Intf + | ".cmt" -> from = Unit_info.Impl + | _ -> false + ) in Cmt.read cm_path |> Result.to_option in @@ -47,13 +52,13 @@ let find_opt_external_uid_loc ~cm_paths = function let* item_decl = UidTbl.find_opt cmt_uid_to_decl uid in loc_opt_of_item_decl item_decl -let cmt_decl_dep_to_loc_dep ~cm_paths cmt_decl_dep uid_to_loc = +let cmt_decl_dep_to_loc_dep ~comp_unit_to_path 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 = match UidTbl.find_opt uid_to_loc uid with | Some _ as loc -> loc - | None -> find_opt_external_uid_loc ~cm_paths uid + | None -> find_opt_external_uid_loc ~comp_unit_to_path uid in let* def_loc = loc_opt_of_uid uid_def in let* decl_loc = loc_opt_of_uid uid_decl in @@ -62,7 +67,7 @@ let cmt_decl_dep_to_loc_dep ~cm_paths cmt_decl_dep uid_to_loc = let res = List.filter_map convert_pair cmt_decl_dep in res -let init ~cm_paths cmt_infos cmti_uid_to_decl = +let init ~comp_unit_to_path cmt_infos cmti_uid_to_decl = match cmt_infos.Cmt_format.cmt_annots with | Implementation _ -> let fill_from_cmti_tbl tbl = @@ -75,6 +80,6 @@ let init ~cm_paths cmt_infos cmti_uid_to_decl = UidTbl.create 512 |> fill_from_cmt_tbl cmt_infos.cmt_uid_to_decl |> fill_from_cmti_tbl - |> cmt_decl_dep_to_loc_dep ~cm_paths cmt_infos.cmt_declaration_dependencies + |> cmt_decl_dep_to_loc_dep ~comp_unit_to_path 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 80046876..f7a124b0 100644 --- a/src/state/location_dependencies.mli +++ b/src/state/location_dependencies.mli @@ -6,15 +6,15 @@ val empty : t (** No signature read *) type uid_to_decl = Typedtree.item_declaration Shape.Uid.Tbl.t val init : - cm_paths: Utils.StringSet.t + comp_unit_to_path: (string, string) Hashtbl.t -> Cmt_format.cmt_infos -> uid_to_decl option -> (t, string) result -(** [init ~cm_paths cmt_infos cmti_infos cmti_uid_to_decl] expects +(** [init ~comp_unit_to_path 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] does not contain an implementation, it returns an [Err msg] with msg a string describing the issue. - [cm_paths] is used to load external cm files if necessary. *) + [comp_unit_to_path] is used to load external cm files if necessary. *) diff --git a/src/state/state.ml b/src/state/state.ml index 8b71b2bd..1b4112f1 100644 --- a/src/state/state.ml +++ b/src/state/state.ml @@ -2,11 +2,21 @@ module File_infos = File_infos type t = { config : Config.t + ; comp_unit_to_path : (string, string) Hashtbl.t ; file_infos : File_infos.t } let init config = + let comp_unit_to_path = + let tbl = Hashtbl.create 32 in + Utils.StringSet.iter (fun filepath -> + let comp_unit = Utils.Filepath.unit filepath in + Hashtbl.add tbl comp_unit filepath) + config.Config.paths_to_analyze; + tbl + in { config + ; comp_unit_to_path ; file_infos = File_infos.empty } @@ -16,24 +26,25 @@ let update_config config state = let change_file state cm_file = let file_infos = state.file_infos in + let comp_unit_to_path = state.comp_unit_to_path in let equal_no_ext filename1 filename2 = let no_ext1 = Filename.remove_extension filename1 in let no_ext2 = Filename.remove_extension filename2 in String.equal no_ext1 no_ext2 in - let cm_paths = state.config.paths_to_analyze in 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 ~cm_paths file_infos cm_file in + let file_infos = File_infos.change_file ~comp_unit_to_path file_infos cm_file in Result.map (fun file_infos -> {state with file_infos}) file_infos else - let file_infos = File_infos.init ~cm_paths cm_file in + let file_infos = File_infos.init ~comp_unit_to_path cm_file in Result.map (fun file_infos -> {state with file_infos}) file_infos (** Analysis' state *) let current = ref { config = Config.default_config + ; comp_unit_to_path = Hashtbl.create 0 ; file_infos = File_infos.empty } diff --git a/src/state/state.mli b/src/state/state.mli index f9c0bd28..ab616cf5 100644 --- a/src/state/state.mli +++ b/src/state/state.mli @@ -4,6 +4,8 @@ module File_infos = File_infos type t = { config : Config.t (** Configuration of the analysis *) + ; comp_unit_to_path : (string, string) Hashtbl.t + (** Compilation unit -> filepaths. Useful for quick filepath retrieval *) ; file_infos : File_infos.t (** Info about the file being analyzed *) } From 9603d8f0b6c065079c7e7490c91fea096d8317c9 Mon Sep 17 00:00:00 2001 From: Corentin De Souza <9597216+fantazio@users.noreply.github.com> Date: Fri, 24 Apr 2026 15:18:49 +0200 Subject: [PATCH 14/15] [cli] add --cmt_cache_size option This will bcontrol the cache size used internally --- src/config/config.ml | 12 ++++++++++++ src/config/config.mli | 1 + 2 files changed, 13 insertions(+) diff --git a/src/config/config.ml b/src/config/config.ml index f8e4ab0b..65df4514 100644 --- a/src/config/config.ml +++ b/src/config/config.ml @@ -21,6 +21,7 @@ type t = { verbose : bool ; internal : bool ; underscore : bool + ; cmt_cache_size : int ; paths_to_analyze : Utils.StringSet.t ; excluded_paths : Utils.StringSet.t ; references_paths : Utils.StringSet.t @@ -32,6 +33,7 @@ let default_config = { verbose = false ; internal = false ; underscore = false + ; cmt_cache_size = 64 ; paths_to_analyze = Utils.StringSet.empty ; excluded_paths = Utils.StringSet.empty ; references_paths = Utils.StringSet.empty @@ -80,6 +82,11 @@ let set_internal config = {config with internal = true} let set_lexifi config = {config with lexifi = true} +let update_cmt_cache_size size config = + if size <= 0 then + raise (Arg.Bad "cmt_cache_size: must be >= 1"); + {config with cmt_cache_size = size} + let normalize_path path = (* remove redundant "." and consecutive dir_sep in path. @@ -179,6 +186,11 @@ let parse_cli () = " Keep internal uses as exported values uses when the interface is given. \ This is the default behaviour when only the implementation is found" + ; "--cmt_cache_size", + Int (update_config update_cmt_cache_size), + " . Cache up to cmt/cmti files at any given moment. \ + Must be >=1. The default is 64." + ; "--nothing", Unit (update_config_unit (update_all "nothing")), " Disable all warnings" diff --git a/src/config/config.mli b/src/config/config.mli index 53ee03eb..fa214214 100644 --- a/src/config/config.mli +++ b/src/config/config.mli @@ -21,6 +21,7 @@ type t = private { verbose : bool (** Display additional information during the analaysis *) ; internal : bool (** Keep track of internal uses for exported values *) ; underscore : bool (** Keep track of elements with names starting with [_] *) + ; cmt_cache_size : int (** Max number of cmt/cmti files in cache *) ; paths_to_analyze : Utils.StringSet.t (** Cmi and cmt filepaths found by exploring the paths provided in the command line and considered for analysis *) From fa9f5f66479a08bd703200989734d606046d1373 Mon Sep 17 00:00:00 2001 From: Corentin De Souza <9597216+fantazio@users.noreply.github.com> Date: Fri, 24 Apr 2026 15:34:38 +0200 Subject: [PATCH 15/15] [src][state][cmt] use --cmt_cache_size for cache capacity --- src/state/cmt.ml | 26 +++++++++++++++++--------- src/state/cmt.mli | 2 ++ src/state/state.ml | 2 ++ 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/state/cmt.ml b/src/state/cmt.ml index cf67e257..3a107f10 100644 --- a/src/state/cmt.ml +++ b/src/state/cmt.ml @@ -4,7 +4,7 @@ module Cache = struct type ('k, 'v) t = { store : ('k, 'v) Hashtbl.t (** filepath -> cmi_cmt_infos *) - ; capacity : int (** n <= capacity *) + ; mutable capacity : int (** n <= capacity *) ; mutable hit : int ; mutable miss : int } @@ -16,6 +16,11 @@ module Cache = struct ; miss = 0 } + let update_capacity cache capacity = + cache.capacity <- capacity; + if Hashtbl.length cache.store >= cache.capacity then + Hashtbl.reset cache.store + let find_opt (cache : ('k, 'v) t) (key : 'k) : 'v option = let res = Hashtbl.find_opt cache.store key in if Option.is_some res then cache.hit <- cache.hit + 1 @@ -29,6 +34,17 @@ module Cache = struct end +type cmi_cmt_infos = Cmi_format.cmi_infos option * Cmt_format.cmt_infos + +let cache_cmt : ((string * string), (string * cmi_cmt_infos)) Cache.t = Cache.create 64 + +let set_cache_size capacity = Cache.update_capacity cache_cmt capacity + +let print_cache_stats () = + print_endline (Printf.sprintf "CMT CACHE : hit = %i ; miss = %i" + cache_cmt.hit cache_cmt.miss) + + let read_no_cache filepath = match Cmt_format.read filepath with | exception _ -> Result.error (filepath ^ ": error reading file") @@ -36,10 +52,6 @@ let read_no_cache filepath = | cmi_infos, Some cmt_infos -> Result.ok (cmi_infos, cmt_infos) -type cmi_cmt_infos = Cmi_format.cmi_infos option * Cmt_format.cmt_infos - -let cache_cmt : ((string * string), (string * cmi_cmt_infos)) Cache.t = Cache.create 64 - let read filepath = let comp_unit = Utils.Filepath.unit filepath in let ext = Filename.extension filepath in @@ -60,7 +72,3 @@ let cached_cmti comp_unit = let cached_cmt comp_unit = find_cached_from_comp_unit comp_unit ".cmt" - -let print_cache_stats () = - print_endline (Printf.sprintf "CMT CACHE : hit = %i ; miss = %i" - cache_cmt.hit cache_cmt.miss) diff --git a/src/state/cmt.mli b/src/state/cmt.mli index 97996a7a..49432e9a 100644 --- a/src/state/cmt.mli +++ b/src/state/cmt.mli @@ -6,4 +6,6 @@ val cached_cmti : string -> cmi_cmt_infos option val cached_cmt : string -> cmi_cmt_infos option +val set_cache_size : int -> unit + val print_cache_stats : unit -> unit diff --git a/src/state/state.ml b/src/state/state.ml index 1b4112f1..0563eed8 100644 --- a/src/state/state.ml +++ b/src/state/state.ml @@ -7,6 +7,7 @@ type t = } let init config = + Cmt.set_cache_size config.Config.cmt_cache_size; let comp_unit_to_path = let tbl = Hashtbl.create 32 in Utils.StringSet.iter (fun filepath -> @@ -21,6 +22,7 @@ let init config = } let update_config config state = + Cmt.set_cache_size config.Config.cmt_cache_size; {state with config}