Code Duplication    Length = 10-14 lines in 4 locations

class.jetpack-user-agent.php 4 locations

@@ 993-1006 (lines=14) @@
990
	/*
991
	 is_webkit() can be used to check the User Agent for an webkit generic browser
992
	 */
993
	static function is_webkit() {
994
995
		if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
996
		return false;
997
998
		$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
999
1000
		$pos_webkit = strpos( $agent, 'webkit' );
1001
1002
		if ( $pos_webkit !== false )
1003
			return true;
1004
		else
1005
			return false;
1006
	}
1007
1008
    /**
1009
     * Detects if the current browser is the Native Android browser.
@@ 1083-1092 (lines=10) @@
1080
 	*
1081
 	* @return boolean true if the browser is Kindle monochrome Native browser otherwise false
1082
 	*/
1083
 	static function is_kindle_touch( ) {
1084
 		if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
1085
 			return false;
1086
 		$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
1087
 		$pos_kindle_touch = strpos( $agent, 'kindle/3.0+' );
1088
 		if ( $pos_kindle_touch !== false && self::is_kindle_fire() === false )
1089
 			return true;
1090
 		else
1091
 			return false;
1092
 		}
1093
1094
1095
	// Detect if user agent is the WordPress.com Windows 8 app (used ONLY on the custom oauth stylesheet)
@@ 1096-1106 (lines=11) @@
1093
1094
1095
	// Detect if user agent is the WordPress.com Windows 8 app (used ONLY on the custom oauth stylesheet)
1096
	static function is_windows8_auth( ) {
1097
		if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
1098
			return false;
1099
1100
		$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
1101
		$pos = strpos( $agent, 'msauthhost' );
1102
		if ( $pos !== false )
1103
	   		return true;
1104
		else
1105
			return false;
1106
	}
1107
1108
	// Detect if user agent is the WordPress.com Windows 8 app.
1109
	static function is_wordpress_for_win8( ) {
@@ 1109-1119 (lines=11) @@
1106
	}
1107
1108
	// Detect if user agent is the WordPress.com Windows 8 app.
1109
	static function is_wordpress_for_win8( ) {
1110
		if ( empty( $_SERVER['HTTP_USER_AGENT'] ) )
1111
			return false;
1112
1113
		$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
1114
		$pos   = strpos( $agent, 'wp-windows8' );
1115
		if ( $pos !== false )
1116
			return true;
1117
		else
1118
			return false;
1119
	}
1120
1121
1122
	/*