Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions check/classic/classic.exp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ Nothing else to report in this section

.> UNUSED METHODS:
=================
./examples/docs/methods/code_constructs/alias/alias_lib.mli:2: original#unused

./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

Expand All @@ -197,8 +199,6 @@ Nothing else to report in this section

./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/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding#m
./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m

Expand Down
10 changes: 5 additions & 5 deletions check/classic/classic.ref
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ Nothing else to report in this section

.> UNUSED METHODS:
=================
./examples/docs/methods/code_constructs/alias/alias_lib.mli:2: original#unused

./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

Expand All @@ -197,8 +199,6 @@ Nothing else to report in this section

./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/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/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused
Expand Down Expand Up @@ -724,7 +724,7 @@ Nothing else to report in this section
--------------------------------------------------------------------------------


Total: 597
Total: 596
Success: 594
Failed: 3
Ratio: 99.4974874372%
Failed: 2
Ratio: 99.6644295302%
4 changes: 2 additions & 2 deletions check/internal/internal.exp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ Nothing else to report in this section

.> UNUSED METHODS:
=================
./examples/docs/methods/code_constructs/alias/alias_lib.mli:2: original#unused

./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

Expand All @@ -149,8 +151,6 @@ Nothing else to report in this section

./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/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding#m
./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m

Expand Down
10 changes: 5 additions & 5 deletions check/internal/internal.ref
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ Nothing else to report in this section

.> UNUSED METHODS:
=================
./examples/docs/methods/code_constructs/alias/alias_lib.mli:2: original#unused

./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

Expand All @@ -149,8 +151,6 @@ Nothing else to report in this section

./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/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/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused
Expand Down Expand Up @@ -676,7 +676,7 @@ Nothing else to report in this section
--------------------------------------------------------------------------------


Total: 553
Total: 552
Success: 550
Failed: 3
Ratio: 99.4575045208%
Failed: 2
Ratio: 99.6376811594%
14 changes: 7 additions & 7 deletions check/threshold-1/threshold-1.exp
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@
./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/alias/alias_lib.mli:8: alias

./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
Expand All @@ -201,8 +203,6 @@

./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_bin.ml:2: push_n_times

./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

Expand Down Expand Up @@ -422,6 +422,8 @@ Nothing else to report in this section

.> UNUSED METHODS:
=================
./examples/docs/methods/code_constructs/alias/alias_lib.mli:2: original#unused

./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

Expand All @@ -440,8 +442,6 @@ Nothing else to report in this section

./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/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding#m
./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m

Expand Down Expand Up @@ -505,6 +505,9 @@ Nothing else to report in this section

.>-> ALMOST UNUSED METHODS: Called 1 time(s):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./examples/docs/methods/code_constructs/alias/alias_lib.mli:2: original#used
./examples/docs/methods/code_constructs/alias/alias_lib.mli:2: original#used_by_alias

./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#peek
./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
Expand All @@ -530,9 +533,6 @@ 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_by_alias

./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
Expand Down
21 changes: 11 additions & 10 deletions check/threshold-1/threshold-1.ref
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@
./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/alias/alias_lib.mli:8: alias

./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
Expand All @@ -201,8 +203,6 @@

./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_bin.ml:2: push_n_times

./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

Expand Down Expand Up @@ -422,6 +422,8 @@ Nothing else to report in this section

.> UNUSED METHODS:
=================
./examples/docs/methods/code_constructs/alias/alias_lib.mli:2: original#unused

./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

Expand All @@ -440,8 +442,6 @@ Nothing else to report in this section

./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/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/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused
Expand Down Expand Up @@ -504,6 +504,9 @@ Nothing else to report in this section

.>-> ALMOST UNUSED METHODS: Called 1 time(s):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./examples/docs/methods/code_constructs/alias/alias_lib.mli:2: original#used
./examples/docs/methods/code_constructs/alias/alias_lib.mli:2: original#used_by_alias

./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#peek
./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
Expand All @@ -529,8 +532,6 @@ 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_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_no_intf.ml:12: immediate#externally_used
Expand Down Expand Up @@ -1140,7 +1141,7 @@ Nothing else to report in this section
--------------------------------------------------------------------------------


Total: 938
Success: 934
Failed: 4
Ratio: 99.5735607676%
Total: 937
Success: 935
Failed: 2
Ratio: 99.7865528282%
16 changes: 8 additions & 8 deletions check/threshold-3-0.5/threshold-3-0.5.exp
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@
./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/alias/alias_lib.mli:8: alias

./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
Expand All @@ -201,8 +203,6 @@

./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_bin.ml:2: push_n_times

./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

Expand Down Expand Up @@ -424,7 +424,7 @@
./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
./examples/docs/methods/code_constructs/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
Expand Down Expand Up @@ -565,6 +565,8 @@ Nothing else to report in this section

.> UNUSED METHODS:
=================
./examples/docs/methods/code_constructs/alias/alias_lib.mli:2: original#unused

./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

Expand All @@ -583,8 +585,6 @@ Nothing else to report in this section

./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/factory_fun_indir/factory_fun_indir.ml:2: factory_with_intermediate_binding#m
./examples/docs/methods/limitations/factory_fun_indir/factory_fun_indir.ml:8: random_factory#m

Expand Down Expand Up @@ -648,6 +648,9 @@ Nothing else to report in this section

.>-> ALMOST UNUSED METHODS: Called 1 time(s):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./examples/docs/methods/code_constructs/alias/alias_lib.mli:2: original#used
./examples/docs/methods/code_constructs/alias/alias_lib.mli:2: original#used_by_alias

./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#peek
./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
Expand All @@ -673,9 +676,6 @@ 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_by_alias

./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
Expand Down
23 changes: 12 additions & 11 deletions check/threshold-3-0.5/threshold-3-0.5.ref
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@
./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/alias/alias_lib.mli:8: alias

./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
Expand All @@ -201,8 +203,6 @@

./examples/docs/methods/code_constructs/polymorphic_class/polymorphic_class_bin.ml:2: push_n_times

./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

Expand Down Expand Up @@ -424,7 +424,7 @@
./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
./examples/docs/methods/code_constructs/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
Expand Down Expand Up @@ -565,6 +565,8 @@ Nothing else to report in this section

.> UNUSED METHODS:
=================
./examples/docs/methods/code_constructs/alias/alias_lib.mli:2: original#unused

./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

Expand All @@ -583,8 +585,6 @@ Nothing else to report in this section

./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/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/using_dune/preprocessed_lib/preprocessed.mli:6: immediate#unused
Expand Down Expand Up @@ -647,6 +647,9 @@ Nothing else to report in this section

.>-> ALMOST UNUSED METHODS: Called 1 time(s):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./examples/docs/methods/code_constructs/alias/alias_lib.mli:2: original#used
./examples/docs/methods/code_constructs/alias/alias_lib.mli:2: original#used_by_alias

./examples/docs/methods/code_constructs/class/class_lib.mli:2: int_stack#peek
./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
Expand All @@ -672,8 +675,6 @@ 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_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_no_intf.ml:12: immediate#externally_used
Expand Down Expand Up @@ -1544,7 +1545,7 @@ Nothing else to report in this section
--------------------------------------------------------------------------------


Total: 1260
Success: 1256
Failed: 4
Ratio: 99.6825396825%
Total: 1259
Success: 1257
Failed: 2
Ratio: 99.8411437649%
12 changes: 1 addition & 11 deletions docs/methods/METHODS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
+ [Limitations](#limitations)
+ [Class type](#class-type)
+ [Object type](#object-type)
+ [Alias](#alias)
+ [Factory function](#factory-function)

# Methods
Expand Down Expand Up @@ -153,6 +152,7 @@ from the `.mli` if there is one and the `.ml`.
- [Factory function](./code_constructs/FACTORY_FUN.md)
- [Object type](./code_constructs/OBJECT_TYPE.md)
- [Coercion](./code_constructs/COERCION.md)
+ [Alias](./code_constructus/ALIAS.md)

# Limitations

Expand All @@ -168,16 +168,6 @@ As explained in the [Object type](./code_constructs/OBJECT_TYPE.md) example, the
analyzer is currently restricted to not reporting methods declared in object
types.

## Alias

Related issue :
[issue #66](https://github.com/LexiFi/dead_code_analyzer/issues/66).

In the presence of multiple bindings to the same object, the analyzer corrctly
avoids tracking their methods individually. However, it fails at unifying them
and only keeps track of the methods used through the original binding, where the
methods are defined. This leads to **false positives**.

### Example

The reference files for this example are in the
Expand Down
Loading
Loading