Code Duplication    Length = 3-7 lines in 2 locations

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

@@ 1289-1295 (lines=7) @@
1286
1287
		$key_status = Akismet::check_key_status( empty( $api_key ) ? Akismet::get_api_key() : $api_key );
1288
1289
		if ( ! $key_status || 'invalid' === $key_status || 'failed' === $key_status ) {
1290
			return rest_ensure_response( array(
1291
				'validKey'          => false,
1292
				'invalidKeyCode'    => 'invalid_key',
1293
				'invalidKeyMessage' => esc_html__( 'Invalid Akismet key. Please contact support.', 'jetpack' ),
1294
			) );
1295
		}
1296
1297
		return rest_ensure_response( array(
1298
			'validKey' => isset( $key_status[1] ) && 'valid' === $key_status[1]
@@ 1338-1340 (lines=3) @@
1335
		require_once WP_PLUGIN_DIR . '/akismet/class.akismet-admin.php';
1336
		$akismet_key = Akismet::verify_key( Akismet::get_api_key() );
1337
1338
		if ( ! $akismet_key || 'invalid' === $akismet_key || 'failed' === $akismet_key ) {
1339
			return new WP_Error( 'invalid_key', esc_html__( 'Invalid Akismet key. Please contact support.', 'jetpack' ), array( 'status' => 400 ) );
1340
		}
1341
1342
		return true;
1343
	}