Code Duplication    Length = 3-10 lines in 3 locations

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

@@ 429-431 (lines=3) @@
426
		$params = $data->get_json_params();
427
428
		// Exit if no parameters were passed.
429
		if ( ! is_array( $params ) ) {
430
			return new WP_Error( 'missing_options', esc_html__( 'Missing options.', 'jetpack' ), array( 'status' => 404 ) );
431
		}
432
433
		// Get available module options.
434
		$options = Jetpack_Core_Json_Api_Endpoints::get_updateable_data_list( 'any' === $data['slug']
@@ 1019-1028 (lines=10) @@
1016
		}
1017
1018
		$verification_services_codes = get_option( 'verification_services_codes' );
1019
		if (
1020
			! is_array( $verification_services_codes )
1021
			|| empty( $verification_services_codes )
1022
		) {
1023
			return new WP_Error(
1024
				'empty',
1025
				esc_html__( 'Site not verified with any service.', 'jetpack' ),
1026
				array( 'status' => 404 )
1027
			);
1028
		}
1029
1030
		$services = array();
1031
		foreach ( jetpack_verification_services() as $name => $service ) {

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

@@ 618-620 (lines=3) @@
615
		$param = $data->get_json_params();
616
617
		// Exit if no parameters were passed.
618
		if ( ! is_array( $param ) ) {
619
			return new WP_Error( 'missing_setting', esc_html__( 'Missing setting.', 'jetpack' ), array( 'status' => 404 ) );
620
		}
621
622
		// Get option name and value.
623
		$option = key( $param );