Condition Coverage

blib/lib/Validate/CodiceFiscale.pm
Criterion Covered Total %
condition 40 46 86.9


and 3 conditions

line !l l&&!r l&&r condition
108 21 3 2 $checksum ne substr($cf, -1, 1) and not &$cb("invalid checksum (should be: $checksum)")
115 2 1 1 substr($cf, 0, 3) ne _compact_surname($surname) and not &$cb("surname mismatch")
120 2 1 1 substr($cf, 3, 3) ne _compact_name($name) and not &$cb("name mismatch")
127 0 2 2 $got ne $male and $got ne $female
2 1 1 $got ne $male and $got ne $female and not &$cb("birth date mismatch")
135 2 3 1 lc $sex eq 'm' && $day > 31 || lc $sex eq 'f' && $day < 41 and not &$cb("sex mismatch")
143 2 1 1 fc $got ne fc $place and not &$cb("birth place mismatch")
259 0 4 25 $m != 1 || $y % 100 || $d < 29 and eval { do { timegm(30, 30, 12, $d, $m, $y + 1900); 1 } }

or 2 conditions

line l !l condition
33 8 9 $options{'data'} // undef
35 0 17 $options{'all_errors'} // 1

or 3 conditions

line l !l&&r !l&&!r condition
91 28 2 2 substr($cf, 0, 3) =~ /\A$namish\z/msux or &$cb("invalid surname")
95 28 1 1 substr($cf, 3, 3) =~ /\A$namish\z/msux or &$cb("invalid name")
99 25 2 2 _is_valid_cf_date(substr($cf, 6, 5)) or &$cb("invalid birth date")
103 25 1 1 substr($cf, 11, 4) =~ /\A [A-Z] ${digitish}{3} \z/msux or &$cb("invalid birth place")
135 0 4 2 lc $sex eq 'm' && $day > 31 || lc $sex eq 'f' && $day < 41
259 29 0 0 $m != 1 || $y % 100 || $d < 29