Code Duplication    Length = 12-16 lines in 4 locations

packages/device-detection/src/class-user-agent-info.php 4 locations

@@ 1031-1046 (lines=16) @@
1028
	/*
1029
		is_webkit() can be used to check the User Agent for an webkit generic browser
1030
		*/
1031
	static function is_webkit() {
1032
1033
		if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
1034
			return false;
1035
		}
1036
1037
		$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
1038
1039
		$pos_webkit = strpos( $agent, 'webkit' );
1040
1041
		if ( $pos_webkit !== false ) {
1042
			return true;
1043
		} else {
1044
			return false;
1045
		}
1046
	}
1047
1048
	/**
1049
	 * Detects if the current browser is the Native Android browser.
@@ 1131-1142 (lines=12) @@
1128
	 *
1129
	 * @return boolean true if the browser is Kindle monochrome Native browser otherwise false
1130
	 */
1131
	static function is_kindle_touch() {
1132
		if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
1133
			return false;
1134
		}
1135
		$agent            = strtolower( $_SERVER['HTTP_USER_AGENT'] );
1136
		$pos_kindle_touch = strpos( $agent, 'kindle/3.0+' );
1137
		if ( false !== $pos_kindle_touch && false === self::is_kindle_fire() ) {
1138
			return true;
1139
		} else {
1140
			return false;
1141
		}
1142
	}
1143
1144
1145
	// Detect if user agent is the WordPress.com Windows 8 app (used ONLY on the custom oauth stylesheet)
@@ 1146-1158 (lines=13) @@
1143
1144
1145
	// Detect if user agent is the WordPress.com Windows 8 app (used ONLY on the custom oauth stylesheet)
1146
	static function is_windows8_auth() {
1147
		if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
1148
			return false;
1149
		}
1150
1151
		$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
1152
		$pos   = strpos( $agent, 'msauthhost' );
1153
		if ( false !== $pos ) {
1154
			return true;
1155
		} else {
1156
			return false;
1157
		}
1158
	}
1159
1160
	// Detect if user agent is the WordPress.com Windows 8 app.
1161
	static function is_wordpress_for_win8() {
@@ 1161-1173 (lines=13) @@
1158
	}
1159
1160
	// Detect if user agent is the WordPress.com Windows 8 app.
1161
	static function is_wordpress_for_win8() {
1162
		if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
1163
			return false;
1164
		}
1165
1166
		$agent = strtolower( $_SERVER['HTTP_USER_AGENT'] );
1167
		$pos   = strpos( $agent, 'wp-windows8' );
1168
		if ( false !== $pos ) {
1169
			return true;
1170
		} else {
1171
			return false;
1172
		}
1173
	}
1174
1175
1176
	// Detect if user agent is the WordPress.com Desktop app.