Sensor log level conventions

(Sbaudoin) #1


I have a plugin that relies on a system command. The question is: what should/must be the behavior of my sensor when the system command does not exist or if its execution fails? Should I log warning or error messages and should the sensor fail and how?

Thanks for your feedback.


(Julien Henry) #2

Hi @sbaudoin ,

We tend to fail the analysis, in order to not have the end user wrongly think the quality of the code is good while in fact it was simply not inspected.

(Sbaudoin) #3


Thanks. So if I understand it well, the analysis should fail in the event the system command does not exist. Can you confirm, please?

(Julien Henry) #6

@sbaudoin this is your plugin, so it depends on your use case, and how critical are your plugin measures/issues for the quality gate of projects.

Note that if you consider that the analysis should better complete, but you still want to notify the user that something goes wrong and that results might be incomplete, we have a new API to let Sensors report analysis warnings that will be displayed on project dashboard. See: as an example.

1 Like
(Sbaudoin) #7

Thanks for the details. The API looks interesting.