Branch Coverage

blib/lib/Business/CreditCard.pm
Criterion Covered Total %
branch 39 58 67.2


line true false branch
258 0 44 if UNIVERSAL::isa($_[0], "Business::CreditCard")
265 0 44 if $number =~ /[^\dx]/io
270 0 44 unless length $number >= 13 || length $number == 8 || length $number == 9 and 0 + $number
277 3 41 if $number =~ /^4[0-8][\dx]{11,17}$/o
279 1 38 if $number =~ /^5[1-5][\dx]{14}$/o or $number =~ /^2 ( 22[1-9] | 2[3-9][\dx] | [3-6][\dx]{2} | 7[0-1][\dx] | 720 ) [\dx]{12}$/ox or $number =~ /^2[2-7]xx[\dx]{12}$/o
284 2 36 if $number =~ /^3[47][\dx]{13}$/o
286 7 22 if $number =~ /^30[0-5x][\dx]{13,16}$/o or $number =~ /^309[5x][\dx]{12}$/o or $number =~ /^36[\dx]{12,17}$/o or $number =~ /^3[89][\dx]{14,17}$/o or $number =~ /^60[1x]{2}[\dx]{12,15}$/o or $number =~ /^64[4-9x][\dx]{13,16}$/o or $number =~ /^65[\dx]{14,17}$/o or $number =~ /^62[24-68x][\dx]{13,16}$/o and $Country =~ /^(US|MX|AI|AG|AW|BS|BB|BM|BQ|VG|KY|CW|DM|DO|GD|GP|JM|MQ|MS|BL|KN|LC|VC|MF|SX|TT|TC)$/io or $number =~ /^35(2[89x]|[3-8][\dx]|xx)[\dx]{12,15}$/o and $Country =~ /^(US|PR|VI|MP|PW|GU)$/io
297 0 22 if $number =~ /^49(03(0[2-9]|3[5-9])|11(0[1-2]|7[4-9]|8[1-2])|36[0-9]{2})[\dx]{10}([\dx]{2,3})?$/o or $number =~ /^564182[\dx]{10}([\dx]{2,3})?$/o or $number =~ /^6(3(33[0-4][0-9])|759[0-9]{2})[\dx]{10}([\dx]{2,3})?$/o
302 1 21 if $number =~ /^4[\dx]{12,18}$/o
305 2 19 if $number =~ /^2(014|149)[\dx]{11}$/o
307 11 8 if $number =~ /^(3[\dx]{4}|2131|1800)[\dx]{11}$/o
309 1 7 if $number =~ /^56(10[\dx][\dx]|022[1-5])[\dx]{10}$/o
311 0 7 if $number =~ /^6(3(34[5-9][0-9])|767[0-9]{2})[\dx]{10}([\dx]{2,3})?$/o
314 2 5 if $number =~ /^62[24-68][\dx]{13}$/o
317 1 4 if $number =~ /^6(304|7(06|09|71))[\dx]{12,15}$/o
320 2 2 if $number =~ /^[\dx]{8,9}$/
328 0 0 if UNIVERSAL::isa($_[0], "Business::CreditCard")
336 0 0 if $number =~ /^6(01104|506[01]0)[\dx]{10,13}$/o
343 0 0 if UNIVERSAL::isa($_[0], "Business::CreditCard")
347 0 0 if length $number == 8 or length $number == 9
355 0 0 $weight < 10 ? :
381 0 6 if UNIVERSAL::isa($_[0], "Business::CreditCard")
387 0 6 if $number =~ /[^\d\s]/
391 2 4 if ($number =~ /^[\dx]{8,9}$/)
392 1 1 if length $number == 8
396 2 0 if $sum % 11 == 0
400 0 4 unless length $number >= 13 and 0 + $number
404 44 16 $weight < 10 ? :
407 2 2 if substr($number, -1) == (10 - $sum % 10) % 10