Code Duplication    Length = 3-7 lines in 2 locations

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

@@ 1329-1335 (lines=7) @@
1326
1327
		$key_status = Akismet::check_key_status( empty( $api_key ) ? Akismet::get_api_key() : $api_key );
1328
1329
		if ( ! $key_status || 'invalid' === $key_status || 'failed' === $key_status ) {
1330
			return rest_ensure_response( array(
1331
				'validKey'          => false,
1332
				'invalidKeyCode'    => 'invalid_key',
1333
				'invalidKeyMessage' => esc_html__( 'Invalid Akismet key. Please contact support.', 'jetpack' ),
1334
			) );
1335
		}
1336
1337
		return rest_ensure_response( array(
1338
			'validKey' => isset( $key_status[1] ) && 'valid' === $key_status[1]
@@ 1378-1380 (lines=3) @@
1375
		require_once WP_PLUGIN_DIR . '/akismet/class.akismet-admin.php';
1376
		$akismet_key = Akismet::verify_key( Akismet::get_api_key() );
1377
1378
		if ( ! $akismet_key || 'invalid' === $akismet_key || 'failed' === $akismet_key ) {
1379
			return new WP_Error( 'invalid_key', esc_html__( 'Invalid Akismet key. Please contact support.', 'jetpack' ), array( 'status' => 400 ) );
1380
		}
1381
1382
		return true;
1383
	}