Code Duplication    Length = 3-10 lines in 3 locations

_inc/lib/core-api/class.jetpack-core-api-module-endpoints.php 2 locations

@@ 412-414 (lines=3) @@
409
		$params = $data->get_json_params();
410
411
		// Exit if no parameters were passed.
412
		if ( ! is_array( $params ) ) {
413
			return new WP_Error( 'missing_options', esc_html__( 'Missing options.', 'jetpack' ), array( 'status' => 404 ) );
414
		}
415
416
		// Get available module options.
417
		$options = Jetpack_Core_Json_Api_Endpoints::get_updateable_data_list( 'any' === $data['slug']
@@ 992-1001 (lines=10) @@
989
		}
990
991
		$verification_services_codes = get_option( 'verification_services_codes' );
992
		if (
993
			! is_array( $verification_services_codes )
994
			|| empty( $verification_services_codes )
995
		) {
996
			return new WP_Error(
997
				'empty',
998
				esc_html__( 'Site not verified with any service.', 'jetpack' ),
999
				array( 'status' => 404 )
1000
			);
1001
		}
1002
1003
		$services = array();
1004
		foreach ( jetpack_verification_services() as $name => $service ) {

_inc/lib/class.core-rest-api-endpoints.php 1 location

@@ 612-614 (lines=3) @@
609
		$param = $data->get_json_params();
610
611
		// Exit if no parameters were passed.
612
		if ( ! is_array( $param ) ) {
613
			return new WP_Error( 'missing_setting', esc_html__( 'Missing setting.', 'jetpack' ), array( 'status' => 404 ) );
614
		}
615
616
		// Get option name and value.
617
		$option = key( $param );