0

I have Jenkins CI.

Source code is PHP.

Jenkins grabs every 5 minutes source code from GIT.

How to configure to scan source code for resticted words:

  • sqlsrv_
  • mssql_

I need it to monitor another developers to avoid using deprecated functions in code.

Ar2r
  • 108
  • 7

2 Answers2

1

What you need is a static code analysis tool for PHP. Then you need to configure Jenkins to launch that tool.

There are tons available.

Here is a question listing many static code analysis tools for PHP:
Is there a static code analyzer [like Lint] for PHP files?

Here is a question about linking one of those (PHP Code Sniffer) with Jenkins:
Using Jenkins and Php Code Sniffer

Community
  • 1
  • 1
Slav
  • 27,057
  • 11
  • 80
  • 104
0

I would suggest you define Sniffs (Custom based sniffs) and those can grab The mentioned words whenever they appear. You can then make your build fail or display error message accordingly.

I have been able to create my own Sniffs after seeing how Sniffs are developed in:

https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards

Hope this helps.

Mahder
  • 409
  • 3
  • 9