Skip to content
André Silva edited this page Jul 8, 2021 · 8 revisions

The two main classes of the flacoco API are Flacoco and FlacocoAPI.

This class serves as the main entry point of flacoco. Currently, it supports two output formats:

Default mode

The default mode returns a mapping between a string representation of a source code line (e.g. fr/spoonlabs/FLtest1/Calculator@-@14, where fr.spoonlabs.FLtest1.Calculator is the fully-qualified class name and 14 is the line number), and a Suspiciousness object that contains all the relevant information regarding the suspiciousness of a line.

Flacoco flacoco = new Flacoco();
Map<String, Suspiciousness> resultDefault = flacoco.runDefault();

Spoon mode

The Spoon mode returns the same mapping but from a CtStatement. More information on how source code lines are mapped to CtStatements can be found under SpoonConverter.

Flacoco flacoco = new Flacoco();
Map<CtStatement, Suspiciousness> resultSpoon = flacoco.runSpoon();

This class serves as the configuration manager of the flacoco API. Through it, you can set all the options that will be used during the execution of flacoco. A comprehensive list of options will be provided soon in this page.

Clone this wiki locally