Code Duplication    Length = 5-7 lines in 2 locations

includes/libraries/wpinv-euvat/class-wpinv-euvat.php 2 locations

@@ 1715-1721 (lines=7) @@
1712
            wp_send_json( $response );
1713
        }
1714
        
1715
        if ( empty( $company ) ) {
1716
            $vat_info['valid'] = false;
1717
            $wpi_session->set( 'user_vat_data', $vat_info );
1718
            
1719
            $response['error'] = __( 'Please enter your registered company name!', 'invoicing' );
1720
            wp_send_json( $response );
1721
        }
1722
        
1723
        if ( !empty( $wpinv_options['vat_vies_check'] ) ) {
1724
            if ( empty( $wpinv_options['vat_offline_check'] ) && !self::offline_check( $vat_number ) ) {
@@ 1874-1878 (lines=5) @@
1871
                    
1872
                        $valid_company = $vies_company && $company && ( $vies_company == '---' || strcasecmp( trim( $vies_company ), trim( $company ) ) == 0 ) ? true : false;
1873
1874
                        if ( !( !empty( $wpinv_options['vat_disable_company_name_check'] ) || $valid_company ) ) {         
1875
                            $vat_data['valid'] = false;
1876
                            
1877
                            $message = wp_sprintf( __( 'The company name associated with the %s number provided is not the same as the company name provided.', 'invoicing' ), $vat_name );
1878
                        }
1879
                    } else {
1880
                        $message = wp_sprintf( __( 'Fail to validate the %s number: EU Commission VAT server (VIES) check fails.', 'invoicing' ), $vat_name );
1881
                    }