Trying to find hard-coded URL's in Java code

I created a Java template rule to find hard-coded URL’s:

I also created the following Quality Profile which I activated (Find hard-coded URL’s):

I added some hard-coded URL’s in code:

//Should be flagged

String apiEndpoint = “https://api.example.com/v1/data”;

String insecureLink = “http://insecure.example.com/login”;

After the scan is completed, I do not see that the rule found the hard-coded URL’s.

Hi,

I can’t quite make out your regex. Could you paste the text of it?

Also, what version are you using?

 
Thx,
Ann

Hello, the regular expression is:

https?://[^\s"']+

We are using:

  • Data Center Edition - Version 9.9.3 (build 79811)

Hi,

Your version is past EOL. You should update to either the latest version or the current LTA (long-term active version) at your earliest convenience. Your update path is:

9.9.3 → 2025.1.3-> 2025.5 (last step optional)

You may find these resources helpful:

If you have questions about upgrading, feel free to open a new thread for that here.

If your error persists after update, please come back to us.

 
Thx,
Ann

Thank you.