Code Duplication    Length = 3-7 lines in 2 locations

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

@@ 1432-1438 (lines=7) @@
1429
1430
		$key_status = Akismet::check_key_status( empty( $api_key ) ? Akismet::get_api_key() : $api_key );
1431
1432
		if ( ! $key_status || 'invalid' === $key_status || 'failed' === $key_status ) {
1433
			return rest_ensure_response( array(
1434
				'validKey'          => false,
1435
				'invalidKeyCode'    => 'invalid_key',
1436
				'invalidKeyMessage' => esc_html__( 'Invalid Akismet key. Please contact support.', 'jetpack' ),
1437
			) );
1438
		}
1439
1440
		return rest_ensure_response( array(
1441
			'validKey' => isset( $key_status[1] ) && 'valid' === $key_status[1]
@@ 1481-1483 (lines=3) @@
1478
		require_once WP_PLUGIN_DIR . '/akismet/class.akismet-admin.php';
1479
		$akismet_key = Akismet::verify_key( Akismet::get_api_key() );
1480
1481
		if ( ! $akismet_key || 'invalid' === $akismet_key || 'failed' === $akismet_key ) {
1482
			return new WP_Error( 'invalid_key', esc_html__( 'Invalid Akismet key. Please contact support.', 'jetpack' ), array( 'status' => 400 ) );
1483
		}
1484
1485
		return true;
1486
	}