Completed
Pull Request — master (#69)
by Jakub
21:27 queued 10:37
created

alert   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 19
ccs 7
cts 7
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A test() 0 13 2
1
<?php
2
/**
3
 *
4
 * Advertisement management. An extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) 2017 phpBB Limited <https://www.phpbb.com>
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace phpbb\ads\analyser\test;
12
13
class alert implements test_interface
14
{
15
	/**
16
	 * {@inheritDoc}
17
	 */
18 12
	public function test($ad_code)
19
	{
20 12
		if (preg_match('/alert(\s)*\(/U', $ad_code))
21 12
		{
22
			return array(
23
				'warning'	=> array(
24 3
					'ALERT_USAGE',
25 3
				),
26 3
			);
27
		}
28
29 9
		return array();
30
	}
31
}
32