Code Duplication    Length = 3-7 lines in 2 locations

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

@@ 1378-1384 (lines=7) @@
1375
1376
		$key_status = Akismet::check_key_status( empty( $api_key ) ? Akismet::get_api_key() : $api_key );
1377
1378
		if ( ! $key_status || 'invalid' === $key_status || 'failed' === $key_status ) {
1379
			return rest_ensure_response( array(
1380
				'validKey'          => false,
1381
				'invalidKeyCode'    => 'invalid_key',
1382
				'invalidKeyMessage' => esc_html__( 'Invalid Akismet key. Please contact support.', 'jetpack' ),
1383
			) );
1384
		}
1385
1386
		return rest_ensure_response( array(
1387
			'validKey' => isset( $key_status[1] ) && 'valid' === $key_status[1]
@@ 1427-1429 (lines=3) @@
1424
		require_once WP_PLUGIN_DIR . '/akismet/class.akismet-admin.php';
1425
		$akismet_key = Akismet::verify_key( Akismet::get_api_key() );
1426
1427
		if ( ! $akismet_key || 'invalid' === $akismet_key || 'failed' === $akismet_key ) {
1428
			return new WP_Error( 'invalid_key', esc_html__( 'Invalid Akismet key. Please contact support.', 'jetpack' ), array( 'status' => 400 ) );
1429
		}
1430
1431
		return true;
1432
	}