Code Duplication    Length = 5-7 lines in 2 locations

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

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