Code Duplication    Length = 5-8 lines in 2 locations

includes/class-sensei-course.php 2 locations

@@ 208-215 (lines=8) @@
205
						$product_object = get_product( $post_item->ID );
206
						$parent_id = wp_get_post_parent_id( $post_item->ID );
207
208
                        if( sensei_check_woocommerce_version( '2.1' ) ) {
209
							$formatted_variation = wc_get_formatted_variation( $product_object->variation_data, true );
210
211
						} else {
212
                            // fall back to pre wc 2.1
213
							$formatted_variation = woocommerce_get_formatted_variation( $product_object->variation_data, true );
214
215
						}
216
217
                        $product_name = ucwords( $formatted_variation );
218
                        if( empty( $product_name ) ){
@@ 567-571 (lines=5) @@
564
					if ( 0 < absint( $course_woocommerce_product_id ) ) {
565
						if ( 'product_variation' == get_post_type( $course_woocommerce_product_id ) ) {
566
							$product_object = get_product( $course_woocommerce_product_id );
567
							if( sensei_check_woocommerce_version( '2.1' ) ) {
568
								$formatted_variation = wc_get_formatted_variation( $product_object->variation_data, true );
569
							} else {
570
								$formatted_variation = woocommerce_get_formatted_variation( $product_object->variation_data, true );
571
							}
572
							$course_woocommerce_product_id = $product_object->parent->post->ID;
573
							$product_name = $product_object->parent->post->post_title . '<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . ucwords( $formatted_variation );
574
						} else {