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'] );
@@ 872-881 (lines=10) @@
869
		}
870
871
		$verification_services_codes = get_option( 'verification_services_codes' );
872
		if (
873
			! is_array( $verification_services_codes )
874
			|| empty( $verification_services_codes )
875
		) {
876
			return new WP_Error(
877
				'empty',
878
				esc_html__( 'Site not verified with any service.', 'jetpack' ),
879
				array( 'status' => 404 )
880
			);
881
		}
882
883
		$services = array();
884
		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 );