Package org.sonar.api.batch.sensor
Interface Sensor
-
- All Superinterfaces:
ProjectSensor
@ScannerSide @SonarLintSide @ExtensionPoint public interface Sensor extends ProjectSensor
A sensor is invoked once for each module of a project, starting from leaf modules. The sensor can parse a flat file, connect to a web server... Sensors are used to add measure and issues at file level.
For example the Cobertura Sensor parses Cobertura report and saves the first-level of measures on files. For testing purpose you can use
SensorContextTester
- Since:
- 5.1, 7.6 use
ProjectSensor
instead to make your Sensor run only once per analysis, and no more once per module
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
describe(SensorDescriptor descriptor)
PopulateSensorDescriptor
of this sensor.void
execute(SensorContext context)
The actual sensor code.
-
-
-
Method Detail
-
describe
void describe(SensorDescriptor descriptor)
PopulateSensorDescriptor
of this sensor.- Specified by:
describe
in interfaceProjectSensor
-
execute
void execute(SensorContext context)
The actual sensor code.- Specified by:
execute
in interfaceProjectSensor
-
-