Code Duplication    Length = 3-10 lines in 3 locations

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

@@ 360-362 (lines=3) @@
357
		$params = $data->get_json_params();
358
359
		// Exit if no parameters were passed.
360
		if ( ! is_array( $params ) ) {
361
			return new WP_Error( 'missing_options', esc_html__( 'Missing options.', 'jetpack' ), array( 'status' => 404 ) );
362
		}
363
364
		// Get available module options.
365
		$options = Jetpack_Core_Json_Api_Endpoints::get_module_available_options( $data['slug'] );
@@ 879-888 (lines=10) @@
876
		}
877
878
		$verification_services_codes = get_option( 'verification_services_codes' );
879
		if (
880
			! is_array( $verification_services_codes )
881
			|| empty( $verification_services_codes )
882
		) {
883
			return new WP_Error(
884
				'empty',
885
				esc_html__( 'Site not verified with any service.', 'jetpack' ),
886
				array( 'status' => 404 )
887
			);
888
		}
889
890
		$services = array();
891
		foreach ( jetpack_verification_services() as $name => $service ) {

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

@@ 567-569 (lines=3) @@
564
		$param = $data->get_json_params();
565
566
		// Exit if no parameters were passed.
567
		if ( ! is_array( $param ) ) {
568
			return new WP_Error( 'missing_setting', esc_html__( 'Missing setting.', 'jetpack' ), array( 'status' => 404 ) );
569
		}
570
571
		// Get option name and value.
572
		$option = key( $param );