Advice for writing a custom scanner(?) to retrieve a product specific custom metric

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    Community Edition 8.9.7.52159

  • what are you trying to achieve
    We want to have as an additional metric (I don’t know if that works at all) - let’s call it (as an example, that’s not our real business case) “number of xml files with a certain schema in our code base”.
    We can retrieve this number with a simple Java tool or even a script.
    But I have no idea how to start and what is possible at all and what not (like introducing a new metric).

  • what have you tried so far to achieve this
    Just searched the forum for useful information, but I didn’t find anything comparable and I am a bit lost now.

Thanks for this great product - and thanks in advance for any guidance!
Stefan

Hi Stefan,

Welcome to the community!

There are several plugins in the Marketplace that add metrics. Off-hand I can’t name them, but a browse through the listing should help you find one or more. Your best bet is to go through code of these by-definition-open source plugins to see how they do it.

 
HTH,
Ann

Thanks a lot for the quick response, Ann!