Page
Library
Module
Module type
Parameter
Class
Class type
Source
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 .cmti and .cmt files. Uses of such elements are collected by reading typed trees from .cmt files
This tool scans a compiled OCaml project and reports various warnings about suspicious code:
None). They can be made mandatory or dropped. For more information, see the Optional arguments documentation.Other stylistic issues:
unit which are not () (typically, _ or a variable);let () = ... in ... (it's usually better to use sequencing);let x = ... in x (the binding is useless);val f: ... -> (... -> ?_:_ -> ...) -> ...For more information, see the Coding style documentation.
For more information, see the User documentation
opam install dead_code_analyzer
makedead_code_analyzer located in _build/install/default/bin/dead_code_analyzer <options> <path>
The given paths can be files and directories. For more information about the usage, use the -help option, or see the Usage documentation.
make check runs each subset of the tests sequentially. In case of success, they all run. Otherwise it stops at the first failing one and prints the diff between the expected results and the current results.
To run a specific subset of the tests, run make -C check <subset>.
To get statistics about passing/failing tests run make -C check stats.
For each subset of the tests executed, a file check/<subset>.out is generated. It contains the output of running the dead_code_analyzer on the tests with annotations on failures:
Should not be detected for false positivesNot detected for false negativesYou are welcome to clone this repository, open issues and send us back pull requests.
Read CONTRIBUTING.md at the root of this directory for more information on how to contribute.
Tracking the optional arguments uses may consume a lot of memory.
Tracking the methods uses may consume a lot of memory.
For more limitations, see each report section documentation.
Source code is distributed under the conditions stated in file License
This project was initiated by LexiFi (http://www.lexifi.com) and is part of the SecurOCaml project.
Contact: alain.frisch@lexifi.com