Oug

What is Oug ?

Oug is a code analysis tool building reference graphs from OCaml code, that is graphs representing which elements (value, module, class, ...) reference which elements. We will also call these graphs dependency graphs, each edge of the graph being annotated by a dependency kind.

It comes with the `Oug` library to be able to embed the analyzer in other OCaml applications.

From the graph, various outputs can be obtained: list of elements not referenced anywhere (useless elements and potential dead code), various Graphiz graphs, ...

Oug does not compute the *call graph* of the given OCaml code; this would require
data flow analysis. For this reason, the "useless elements" dump always consider
that every method is referenced.

Documentation

First read the usage section about how Oug works.

Have a look at some examples:

- example 1: values
- example 2: modules
- example 3: functors
- example 4: multiple functor applications
- example 6: types.

A quick guide to start using Oug on your code: Getting started.

The Filters section describe the filter language, used to find elements in the graph, with lots of examples.

The `Oug` library can be used to embed the analyzer in other OCaml applications.
The reference documentation is here.
The main module (`oug.ml`)
of the `oug` tool uses this library and can be taken as example to use the library.

References

Maxence Guesdon: Fouille au code OCaml par analyse de dépendances

Journées Francophones des Langages Applicatifs 2009. [in french]