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