Code Duplication    Length = 4-4 lines in 2 locations

src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php 2 locations

@@ 553-556 (lines=4) @@
550
		}
551
552
		$check_comment_lengths = wp_check_comment_data_max_lengths( $prepared_comment );
553
		if ( is_wp_error( $check_comment_lengths ) ) {
554
			$error_code = $check_comment_lengths->get_error_code();
555
			return new WP_Error( $error_code, __( 'Comment field exceeds maximum length allowed.' ), array( 'status' => 400 ) );
556
		}
557
558
		$prepared_comment['comment_approved'] = wp_allow_comment( $prepared_comment, true );
559
@@ 722-725 (lines=4) @@
719
			$prepared_args['comment_ID'] = $id;
720
721
			$check_comment_lengths = wp_check_comment_data_max_lengths( $prepared_args );
722
			if ( is_wp_error( $check_comment_lengths ) ) {
723
				$error_code = $check_comment_lengths->get_error_code();
724
				return new WP_Error( $error_code, __( 'Comment field exceeds maximum length allowed.' ), array( 'status' => 400 ) );
725
			}
726
727
			$updated = wp_update_comment( wp_slash( (array) $prepared_args ) );
728