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']
@@ 986-995 (lines=10) @@
983
		}
984
985
		$verification_services_codes = get_option( 'verification_services_codes' );
986
		if (
987
			! is_array( $verification_services_codes )
988
			|| empty( $verification_services_codes )
989
		) {
990
			return new WP_Error(
991
				'empty',
992
				esc_html__( 'Site not verified with any service.', 'jetpack' ),
993
				array( 'status' => 404 )
994
			);
995
		}
996
997
		$services = array();
998
		foreach ( jetpack_verification_services() as $name => $service ) {

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

@@ 626-628 (lines=3) @@
623
		$param = $data->get_json_params();
624
625
		// Exit if no parameters were passed.
626
		if ( ! is_array( $param ) ) {
627
			return new WP_Error( 'missing_setting', esc_html__( 'Missing setting.', 'jetpack' ), array( 'status' => 404 ) );
628
		}
629
630
		// Get option name and value.
631
		$option = key( $param );