Completed
Push — add/jetpack-mobile-package ( d1f5cd )
by
unknown
07:53
created

Jetpack_User_Agent_Info::is_S60_OSSBrowser()   C

Complexity

Conditions 12
Paths 7

Size

Total Lines 27

Duplication

Lines 3
Ratio 11.11 %

Importance

Changes 0
Metric Value
cc 12
nc 7
nop 0
dl 3
loc 27
rs 6.9666
c 0
b 0
f 0

How to fix   Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
use Automattic\Jetpack\Mobile;
4
5
/**
6
 * Determine if the current User Agent matches the passed $kind
7
 *
8
 * @param string $kind Category of mobile device to check for.
9
 *                         Either: any, dumb, smart.
10
 * @param bool   $return_matched_agent Boolean indicating if the UA should be returned
11
 *
12
 * @return bool|string Boolean indicating if current UA matches $kind. If
13
 *                              $return_matched_agent is true, returns the UA string
14
 */
15
function jetpack_is_mobile( $kind = 'any', $return_matched_agent = false ) {
16
	return Mobile::is_mobile( $kind, $return_matched_agent );
17
}
18