Conditions | 4 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
18 | 12 | public function test($ad_code) |
|
19 | { |
||
20 | 12 | if (preg_match_all('/<script(.*)>/U', $ad_code, $matches)) |
|
21 | 12 | { |
|
22 | 12 | foreach ($matches[1] as $match) |
|
23 | { |
||
24 | 12 | if (!preg_match('/ async/', $match)) |
|
25 | 12 | { |
|
26 | return array( |
||
27 | 'notice' => array( |
||
28 | 5 | 'SCRIPT_WITHOUT_ASYNC', |
|
29 | 5 | ), |
|
30 | 5 | ); |
|
31 | } |
||
32 | 8 | } |
|
33 | 7 | } |
|
34 | |||
35 | 7 | return array(); |
|
36 | } |
||
37 | } |
||
38 |