blib/lib/Validate/CodiceFiscale.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
condition | 39 | 44 | 88.6 |
line | !l | l&&!r | l&&r | condition |
---|---|---|---|---|
137 | 30 | 3 | 4 | $checksum ne substr($cf, -1, 1) and not &$cb("invalid checksum (should be: $checksum)") |
144 | 3 | 1 | 2 | substr($cf, 0, 3) ne _compact_surname($surname) and not &$cb("surname mismatch") |
149 | 3 | 1 | 2 | substr($cf, 3, 3) ne _compact_name($name) and not &$cb("name mismatch") |
156 | 0 | 3 | 3 | $got ne $male and $got ne $female |
3 | 1 | 2 | $got ne $male and $got ne $female and not &$cb("birth date mismatch") | |
164 | 3 | 3 | 2 | lc $sex eq 'm' && $day > 31 || lc $sex eq 'f' && $day < 41 and not &$cb("sex mismatch") |
172 | 3 | 1 | 2 | fc $got ne fc $place and not &$cb("birth place mismatch") |
line | l | !l | condition |
---|---|---|---|
38 | 34 | 0 | $r->{'errors'} // [] |
68 | 16 | 19 | $options{'data'} // undef |
70 | 18 | 17 | $options{'all_errors'} // 1 |
290 | 22 | 18 | $opts // {} |
line | l | !l&&r | !l&&!r | condition |
---|---|---|---|---|
112 | 46 | 1 | 2 | $portions{'name'} =~ /\A$namish\z/msux or &$cb("invalid name") |
116 | 41 | 2 | 4 | $portions{'surname'} =~ /\A$namish\z/msux or &$cb("invalid surname") |
121 | 37 | 2 | 4 | _is_valid_cf_date($y, $m, $d) or &$cb("invalid birth date") |
164 | 0 | 5 | 3 | lc $sex eq 'm' && $day > 31 || lc $sex eq 'f' && $day < 41 |
171 | 6 | 0 | 0 | $retval->{'place'} // _normalized_birthplace($portions{'place'}) |