Code Duplication    Length = 3-7 lines in 2 locations

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

@@ 1251-1257 (lines=7) @@
1248
1249
		$key_status = Akismet::check_key_status( empty( $api_key ) ? Akismet::get_api_key() : $api_key );
1250
1251
		if ( ! $key_status || 'invalid' === $key_status || 'failed' === $key_status ) {
1252
			return rest_ensure_response( array(
1253
				'validKey'          => false,
1254
				'invalidKeyCode'    => 'invalid_key',
1255
				'invalidKeyMessage' => esc_html__( 'Invalid Akismet key. Please contact support.', 'jetpack' ),
1256
			) );
1257
		}
1258
1259
		return rest_ensure_response( array(
1260
			'validKey' => isset( $key_status[1] ) && 'valid' === $key_status[1]
@@ 1300-1302 (lines=3) @@
1297
		require_once WP_PLUGIN_DIR . '/akismet/class.akismet-admin.php';
1298
		$akismet_key = Akismet::verify_key( Akismet::get_api_key() );
1299
1300
		if ( ! $akismet_key || 'invalid' === $akismet_key || 'failed' === $akismet_key ) {
1301
			return new WP_Error( 'invalid_key', esc_html__( 'Invalid Akismet key. Please contact support.', 'jetpack' ), array( 'status' => 400 ) );
1302
		}
1303
1304
		return true;
1305
	}