Code Duplication    Length = 4-4 lines in 5 locations

projects/plugins/jetpack/_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-videopress.php 1 location

@@ 142-145 (lines=4) @@
139
					);
140
				}
141
142
				if ( isset( $json_params['display_embed'] ) && isset( $meta['videopress']['display_embed'] ) ) {
143
					$meta['videopress']['display_embed'] = $json_params['display_embed'];
144
					$should_update_meta                  = true;
145
				}
146
147
				if ( isset( $json_params['rating'] ) && isset( $meta['videopress']['rating'] ) && videopress_is_valid_video_rating( $meta['videopress']['rating'] ) ) {
148
					$meta['videopress']['rating'] = $json_params['rating'];

projects/plugins/jetpack/class.json-api-endpoints.php 2 locations

@@ 1372-1375 (lines=4) @@
1369
1370
		if ( in_array( $ext, array( 'jpg', 'jpeg', 'png', 'gif' ) ) ) {
1371
			$metadata = wp_get_attachment_metadata( $media_item->ID );
1372
			if ( isset( $metadata['height'], $metadata['width'] ) ) {
1373
				$response['height'] = $metadata['height'];
1374
				$response['width']  = $metadata['width'];
1375
			}
1376
1377
			if ( isset( $metadata['sizes'] ) ) {
1378
				/**
@@ 1430-1433 (lines=4) @@
1427
		if ( $is_video ) {
1428
			$metadata = wp_get_attachment_metadata( $media_item->ID );
1429
1430
			if ( isset( $metadata['height'], $metadata['width'] ) ) {
1431
				$response['height'] = $metadata['height'];
1432
				$response['width']  = $metadata['width'];
1433
			}
1434
1435
			if ( isset( $metadata['length'] ) ) {
1436
				$response['length'] = $metadata['length'];

projects/plugins/jetpack/sal/class.json-api-post-base.php 2 locations

@@ 585-588 (lines=4) @@
582
583
		if ( in_array( $ext, array( 'jpg', 'jpeg', 'png', 'gif' ) ) ) {
584
			$metadata = wp_get_attachment_metadata( $media_item->ID );
585
			if ( isset( $metadata['height'], $metadata['width'] ) ) {
586
				$response['height'] = $metadata['height'];
587
				$response['width'] = $metadata['width'];
588
			}
589
590
			if ( isset( $metadata['sizes'] ) ) {
591
				/**
@@ 625-628 (lines=4) @@
622
623
		if ( in_array( $ext, array( 'ogv', 'mp4', 'mov', 'wmv', 'avi', 'mpg', '3gp', '3g2', 'm4v' ) ) ) {
624
			$metadata = wp_get_attachment_metadata( $media_item->ID );
625
			if ( isset( $metadata['height'], $metadata['width'] ) ) {
626
				$response['height'] = $metadata['height'];
627
				$response['width']  = $metadata['width'];
628
			}
629
630
			if ( isset( $metadata['length'] ) ) {
631
				$response['length'] = $metadata['length'];