Code Duplication    Length = 3-5 lines in 2 locations

includes/abstracts/abstract-wc-product.php 2 locations

@@ 745-749 (lines=5) @@
742
	public function is_visible() {
743
		if ( ! $this->post ) {
744
			$visible = false;
745
		} elseif ( 'publish' !== $this->post->post_status && ! current_user_can( 'edit_post', $this->id ) ) {
746
			// Published/private.
747
			$visible = false;
748
		} elseif ( 'yes' === get_option( 'woocommerce_hide_out_of_stock_items' ) && ! $this->is_in_stock() ) {
749
			// Out of stock visibility.
750
			$visible = false;
751
		} elseif ( 'hidden' === $this->visibility ) {
752
			// visibility setting.
@@ 792-794 (lines=3) @@
789
			// Other products types need a price to be set.
790
			$purchasable = false;
791
792
		} elseif ( 'publish' !== $this->post->post_status && ! current_user_can( 'edit_post', $this->id ) ) {
793
			// Check the product is published.
794
			$purchasable = false;
795
		}
796
797
		return apply_filters( 'woocommerce_is_purchasable', $purchasable, $this );