How to detect source codes that contains a text that matches a pattern

Hi, I am looking for a plugin or solution that works with SonarQube to detect a string that matches a pattern (eg: regex) in any source codes language that is text readable and inclusive or commented source codes.

Some examples of string pattern matching includes:
A1234567Z
B7654321Y

Hi,

there’s a free sonar-text plugin, see https://github.com/gjd6640/sonar-text-plugin.
You might try the latest pre-release for Sonarqube 7 - which is still alpha - or roll your own plugin inspired by sonar-text sources.

Regards,
Gilbert

1 Like

My Sonarqube is 7.9.4(Community),install the pre-release sonar text plugin,not work .Can not detect *.txt file regular issues.There is a warning:

WARN: Property ‘sonar-text-plugin.file.suffixes’ is not declared as multi-values/property set but was read using ‘getStringArray’ method. The SonarQube plugin declaring this property should be updated.

sonar-project.properties:

Hi,

this plugin is not maintained by Sonarsource. From their github site it seems development has stopped.
The new Sonarqube LTS version 8.9 is expected in early / mid May 2021, so you may try to change their codebase and make it work against the latest Sonarqube version, then come back with any question(s) if any.

Gilbert