Condition Coverage

lib/Locale/Unicode/Data.pm
Criterion Covered Total %
condition 201 658 30.5


and 2 conditions

line l !l condition
1075 0 0 $ref = $self->alias("alias", $backup, "type", "language") and ref($ref->{'replacement'} // "") eq "ARRAY" and scalar @{$ref->{'replacement'};}
1096 9 1 $ref = $self->alias("alias", "$locale", "type", "language") and ref($ref->{'replacement'} // "") eq "ARRAY" and scalar @{$ref->{'replacement'};}
5 4 $ref = $self->alias("alias", $locale->language_extended, "type", "language") and ref($ref->{'replacement'} // "") eq "ARRAY" and scalar @{$ref->{'replacement'};}
1103 0 1 $ref = $self->alias("alias", $grandfathered, "type", "language") and ref($ref->{'replacement'} // "") eq "ARRAY" and scalar @{$ref->{'replacement'};}
1125 1 0 $self->alias('alias', $repl, 'type', 'language') && ref($ref->{'replacement'} // '') eq 'ARRAY' && scalar @{$ref->{'replacement'};}
1140 4 0 $self->alias('alias', $repl, 'type', 'language') && ref($ref->{'replacement'} // '') eq 'ARRAY' && scalar @{$ref->{'replacement'};}
1155 3 3 $locale->territory and $ref = $self->alias("alias", $locale->territory, "type", "territory") and ref($ref->{'replacement'} // "") eq "ARRAY" and scalar @{$ref->{'replacement'};}
1228 9 1 $ref = $self->alias("alias", "und-@$combo", "type", "language") and ref $ref->{'replacement'} eq "ARRAY" and scalar @{$ref->{'replacement'};}
1269 0 0 $ref = $self->alias("alias", 'und-' . $variant, "type", "language") and ref $ref->{'replacement'} eq "ARRAY" and scalar @{$ref->{'replacement'};}
1285 0 0 $ref = $self->alias("alias", $variant, "type", "variant") and ref $ref->{'replacement'} eq "ARRAY" and scalar @{$ref->{'replacement'};}
1298 3 0 $script = $locale->script and $ref = $self->alias("alias", $script, "type", "script") and ref $ref->{'replacement'} eq "ARRAY" and scalar @{$ref->{'replacement'};}
2588 0 182 $all and scalar @$all
2948 0 3 $ref->{'alias'} and ref $ref->{'alias'} eq "ARRAY" and scalar @{$ref->{'alias'};}
3533 345 0 $opts->{'has'} and scalar @$sql_arrays_in
3607 0 345 $all and scalar @$sql_arrays_in
3772 39 531 $ref and scalar @$sql_arrays_in
4243 0 0 not length $self->{'_reset'} and scalar @_

and 3 conditions

line !l l&&!r l&&r condition
66 4 0 0 scalar @args == 1 and defined $args[0]
4 0 0 scalar @args == 1 and defined $args[0] and ref $args[0] eq "HASH"
99 0 0 0 defined $val and $self->error
272 0 0 0 defined $opts->{'sequence'} and not $opts->{'sequence'} =~ /^\d+$/
293 0 0 0 defined $opts->{'code'} and not $opts->{'code'} =~ /^[a-zA-Z]+(?:\-[a-zA-Z]+)*$/
768 0 0 19 defined $key and length($key // "")
774 0 0 30 exists $opts->{$_} and defined $opts->{$_}
0 0 30 exists $opts->{$_} and defined $opts->{$_} and length($opts->{$_} // "")
799 18 0 1 exists $type_to_table->{$type}{'has_array'} and $self->{'decode_sql_arrays'}
909 2 433 9 $ref = $self->locale("locale", $locale) and $ref->{'parent'}
918 429 6 0 $locale->territory and $locale->script || $locale->variant
924 0 0 0 $ref = $self->locale("locale", $clone) and $ref->{'parent'}
982 0 0 0 $ref = $self->locale("locale", $locale) and $ref->{'parent'}
995 0 6 0 $ref = $self->locale("locale", $locale) and $ref->{'parent'}
1008 0 0 0 $ref = $self->locale("locale", $locale) and $ref->{'parent'}
1021 0 0 0 $ref = $self->locale("locale", $locale) and $ref->{'parent'}
1068 11 0 1 builtin::blessed($orig) and $orig->isa("Locale::Unicode")
1075 0 0 0 $ref = $self->alias("alias", $backup, "type", "language") and ref($ref->{'replacement'} // "") eq "ARRAY"
1096 9 0 1 $ref = $self->alias("alias", "$locale", "type", "language") and ref($ref->{'replacement'} // "") eq "ARRAY"
5 0 4 $ref = $self->alias("alias", $locale->language_extended, "type", "language") and ref($ref->{'replacement'} // "") eq "ARRAY"
1103 0 0 1 $ref = $self->alias("alias", $grandfathered, "type", "language") and ref($ref->{'replacement'} // "") eq "ARRAY"
1155 6 3 3 $locale->territory and $ref = $self->alias("alias", $locale->territory, "type", "territory")
9 0 3 $locale->territory and $ref = $self->alias("alias", $locale->territory, "type", "territory") and ref($ref->{'replacement'} // "") eq "ARRAY"
1168 2 0 2 $likely and $likely->{'target'}
1228 9 0 1 $ref = $self->alias("alias", "und-@$combo", "type", "language") and ref $ref->{'replacement'} eq "ARRAY"
1269 0 0 0 $ref = $self->alias("alias", 'und-' . $variant, "type", "language") and ref $ref->{'replacement'} eq "ARRAY"
1285 0 0 0 $ref = $self->alias("alias", $variant, "type", "variant") and ref $ref->{'replacement'} eq "ARRAY"
1298 9 3 0 $script = $locale->script and $ref = $self->alias("alias", $script, "type", "script")
12 0 0 $script = $locale->script and $ref = $self->alias("alias", $script, "type", "script") and ref $ref->{'replacement'} eq "ARRAY"
1380 0 0 0 scalar @_ == 1 and ref $_[0] eq "HASH"
1386 0 0 0 scalar @_ > 1 and ref $_[-1] eq "HASH"
1393 0 0 0 not defined $err and exists $opts->{'error'}
0 0 0 not defined $err and exists $opts->{'error'} and defined $opts->{'error'}
0 0 0 not defined $err and exists $opts->{'error'} and defined $opts->{'error'} and length $opts->{'error'}
1395 0 0 0 exists $opts->{'class'} and defined $opts->{'class'}
0 0 0 exists $opts->{'class'} and defined $opts->{'class'} and length $opts->{'class'}
1396 0 0 0 exists $opts->{'code'} and defined $opts->{'code'}
0 0 0 exists $opts->{'code'} and defined $opts->{'code'} and length $opts->{'code'}
1401 0 0 0 not defined $err and !scalar(@_) || defined $class
0 0 0 defined $err and builtin::blessed($err)
0 0 0 defined $err and builtin::blessed($err) and scalar @_ == 1 || scalar @_ == 2 && defined $class
1422 0 0 0 defined $code and $self->{'error'}->can("code")
1424 0 0 0 defined ${"${class}::FATAL_EXCEPTIONS";} and ${"${class}::FATAL_EXCEPTIONS";}
2492 372 336 245 exists $rules->{$category} and $rules->{$category}->($number)
2590 0 0 182 $all->[0]{'aliases'} and ref $all->[0]{'aliases'} eq "ARRAY"
2751 0 0 0 exists $equivalent->{$check} and $pos == -1
2772 0 0 0 scalar @bests > 1 and length $bests[1] == $max_len
2948 0 0 3 $ref->{'alias'} and ref $ref->{'alias'} eq "ARRAY"
3177 0 0 246 $Locale::Unicode::Data::DBH and ref $Locale::Unicode::Data::DBH eq "HASH"
0 4 242 $Locale::Unicode::Data::DBH and ref $Locale::Unicode::Data::DBH eq "HASH" and exists $Locale::Unicode::Data::DBH->{$file}
4 0 242 $Locale::Unicode::Data::DBH and ref $Locale::Unicode::Data::DBH eq "HASH" and exists $Locale::Unicode::Data::DBH->{$file} and $Locale::Unicode::Data::DBH->{$file}
0 0 242 $Locale::Unicode::Data::DBH and ref $Locale::Unicode::Data::DBH eq "HASH" and exists $Locale::Unicode::Data::DBH->{$file} and $Locale::Unicode::Data::DBH->{$file} and builtin::blessed($Locale::Unicode::Data::DBH->{$file})
0 0 242 $Locale::Unicode::Data::DBH and ref $Locale::Unicode::Data::DBH eq "HASH" and exists $Locale::Unicode::Data::DBH->{$file} and $Locale::Unicode::Data::DBH->{$file} and builtin::blessed($Locale::Unicode::Data::DBH->{$file}) and $Locale::Unicode::Data::DBH->{$file}->isa("DBI::db")
0 0 242 $Locale::Unicode::Data::DBH and ref $Locale::Unicode::Data::DBH eq "HASH" and exists $Locale::Unicode::Data::DBH->{$file} and $Locale::Unicode::Data::DBH->{$file} and builtin::blessed($Locale::Unicode::Data::DBH->{$file}) and $Locale::Unicode::Data::DBH->{$file}->isa("DBI::db") and $Locale::Unicode::Data::DBH->{$file}->ping
3236 272631 217 0 ref($ref // "") ne "HASH" and builtin::reftype($ref // "") ne "ARRAY"
3251 0 28330 254466 exists $ref->{$field} and defined $ref->{$field}
28330 0 254466 exists $ref->{$field} and defined $ref->{$field} and length $ref->{$field}
3348 10 0 335 exists $def->{'by'} && ref $def->{'by'} eq 'ARRAY'
3350 345 0 0 exists $opts->{'order_by_value'} and defined $opts->{'order_by_value'}
3413 0 0 0 defined $field and defined $datatype
3442 129 0 216 exists $def->{'has_array'} && ref $def->{'has_array'} eq 'ARRAY'
3465 0 0 0 defined $val and $val =~ s/^[[:blank:]\h]*(?<op>\<|\<=|\>|\>=|=|\!=|\~)[[:blank:]\h]*(?<val>.*?)$/$+{'val'}/
0 0 0 defined $val and ref $val eq "Regexp"
3488 0 0 0 builtin::blessed($val) && overload::Method($val, '""')
3496 7 311 0 defined $val and $val =~ s/^[[:blank:]\h]*(?<op>\<|\<=|\>|\>=|=|\!=|\~)[[:blank:]\h]*(?<val>.*?)$/$+{'val'}/
7 310 1 defined $val and ref $val eq "Regexp"
3519 311 0 0 builtin::blessed($val) && overload::Method($val, '""')
3523 327 18 0 defined $status and exists $opts->{$status}
3611 345 0 0 not $all and want("ARRAY")
3630 62 0 509 exists $def->{'has_array'} && ref $def->{'has_array'} eq 'ARRAY'
3633 482 0 89 exists $def->{'requires'} && ref $def->{'requires'} eq 'ARRAY'
3648 125 1 24 not exists $opts->{$_} and exists $defaults->{$_}
3661 0 0 2 defined $val and $val =~ s/^[[:blank:]\h]*(?<op>\<|\<=|\>|\>=|=|\!=|\~)[[:blank:]\h]*(?<val>.*?)$/$+{'val'}/
0 0 0 defined $val and ref $val eq "Regexp"
3685 2 0 0 builtin::blessed($val) && overload::Method($val, '""')
3693 24 124 0 defined $val and $val =~ s/^[[:blank:]\h]*(?<op>\<|\<=|\>|\>=|=|\!=|\~)[[:blank:]\h]*(?<val>.*?)$/$+{'val'}/
24 124 0 defined $val and ref $val eq "Regexp"
3717 124 0 0 builtin::blessed($val) && overload::Method($val, '""')
3727 0 570 1 defined $_ and s/^[[:blank:]\h]*(?<op>\<|\<=|\>|\>=|=|\!=|\~)[[:blank:]\h]*(?<val>.*?)$/$+{'val'}/
0 570 0 defined $_ and ref $_ eq "Regexp"
3750 121 0 450 builtin::blessed($_) && overload::Method($_, '""')
3776 531 39 0 not $ref and want("HASH")
3790 241 0 701 exists $Locale::Unicode::Data::STHS->{$file}{$id} and defined $Locale::Unicode::Data::STHS->{$file}{$id}
241 0 701 exists $Locale::Unicode::Data::STHS->{$file}{$id} and defined $Locale::Unicode::Data::STHS->{$file}{$id} and builtin::blessed($Locale::Unicode::Data::STHS->{$file}{$id})
0 0 701 exists $Locale::Unicode::Data::STHS->{$file}{$id} and defined $Locale::Unicode::Data::STHS->{$file}{$id} and builtin::blessed($Locale::Unicode::Data::STHS->{$file}{$id}) and $Locale::Unicode::Data::STHS->{$file}{$id}->isa("DBI::st")
3831 1314 0 2 builtin::blessed($locale) and $locale->isa("Locale::Unicode")
3845 0 0 241 builtin::blessed($sth) && $sth->isa('DBI::st')
3870 2 0 0 exists $def->{'regexp'} and defined $def->{'regexp'}
2 0 0 exists $def->{'regexp'} and defined $def->{'regexp'} and ref $def->{'regexp'} eq "Regexp"
0 0 2 exists $def->{'type'} and defined $def->{'type'}
0 0 2 exists $def->{'type'} and defined $def->{'type'} and length $def->{'type'}
3882 2 0 0 exists $def->{'isa'} and defined $def->{'isa'}
2 0 0 exists $def->{'isa'} and defined $def->{'isa'} and length $def->{'isa'}
3892 0 0 1 defined $val and length $val
3895 1 0 0 defined $re and not $val =~ /^$re$/
1 0 0 defined $type and $type eq "boolean"
3927 0 0 0 builtin::blessed($val) and not $val->isa($isa)
3947 1181 0 0 scalar @_ == 1 and defined $_[0]
1181 0 0 scalar @_ == 1 and defined $_[0] and (ref $_[0] || '') eq "HASH"
3967 0 0 5 defined $Locale::Unicode::Data::STHS and ref $Locale::Unicode::Data::STHS eq "HASH"
3973 0 241 0 defined $sth and builtin::blessed($sth)
3993 0 0 0 $serialiser eq "Sereal" and "Sereal::Encoder"->VERSION <= "version"->parse("4.023")
4007 0 0 0 scalar @args == 1 && ref $args[0] eq 'ARRAY'
4008 0 0 0 defined $ref && ref $ref eq 'ARRAY' && scalar @$ref > 1
4090 0 0 0 $serialiser eq "Sereal" and "Sereal::Encoder"->VERSION <= "version"->parse("4.023")
4105 0 0 0 scalar @args == 1 and ref $args[0] eq "ARRAY"
4161 0 0 0 ref $_[0] and $_[0]->isa("Locale::Unicode::Data::Exception")
4201 0 0 0 $self->{'_cache_value'} and not length $self->{'_reset'}
4230 0 0 0 defined $file and defined $line
4296 0 0 0 $serialiser eq "Sereal" and "Sereal::Encoder"->VERSION <= "version"->parse("4.023")
4310 0 0 0 scalar @args == 1 && ref $args[0] eq 'ARRAY'
4311 0 0 0 defined $ref && ref $ref eq 'ARRAY' && scalar @$ref > 1

or 2 conditions

line l !l condition
64 0 4 $Locale::Unicode::Data::FATAL_EXCEPTIONS // 0
106 4 0 $self->{'datafile'} || (return $self->error('No SQLite data file set.'))
107 4 0 $self->_dbh || (return $self->pass_error)
275 0 0 $opts->{'sequence'} // "undef"
279 0 0 $self->_dbh || (return $self->pass_error)
281 0 0 eval {
296 0 0 $opts->{'code'} // "undef"
300 0 0 $self->_dbh || (return $self->pass_error)
302 0 0 eval {
333 0 0 $self->_dbh || (return $self->pass_error)
335 0 0 eval {
345 0 0 $self->_dbh || (return $self->pass_error)
347 0 0 eval {
356 0 0 $opts->{'calendar'} // ""
617 0 0 $opts->{'locale'} || (return $self->error('No locale provided to get all the interval formats.'))
619 0 0 $opts->{'calendar'} || (return $self->error('No calendar ID provided to get all the interval formats.'))
620 0 0 $self->calendar_interval_formats('locale', $locale, 'calendar', $cal_id) || (return $self->pass_error)
627 0 0 $$formats{$ref->{'format_id'}} ||= []
637 19 0 $opts->{'type'} || (return $self->error('No localisation type was provided.'))
768 19 0 $key // ""
774 30 0 $opts->{$_} // ""
786 19 0 $self->_dbh || (return $self->pass_error)
788 19 0 eval {
903 444 0 $self->_locale_object(shift @_) || (return $self->pass_error)
905 444 0 $self->_locale_object($locale->clone->base) || (return $self->pass_error)
912 9 0 $self->make_inheritance_tree($ref->{'parent'}) || (return $self->pass_error)
927 0 0 $self->make_inheritance_tree($ref->{'parent'}) || (return $self->pass_error)
985 0 0 $self->make_inheritance_tree($ref->{'parent'}) || (return $self->pass_error)
998 0 0 $self->make_inheritance_tree($ref->{'parent'}) || (return $self->pass_error)
1011 0 0 $self->make_inheritance_tree($ref->{'parent'}) || (return $self->pass_error)
1024 0 0 $self->make_inheritance_tree($ref->{'parent'}) || (return $self->pass_error)
1075 0 0 $ref->{'replacement'} // ""
1079 0 0 'Locale::Unicode'->new($ref->{'replacement'}[0]) || (return $self->pass_error('Locale::Unicode'->error))
1096 1 0 $ref->{'replacement'} // ""
4 0 $ref->{'replacement'} // ""
1103 1 0 $ref->{'replacement'} // ""
1110 1 0 $self->normalise($tmp) || (return $self->pass_error)
1155 3 0 $ref->{'replacement'} // ""
1162 2 0 $self->make_inheritance_tree($locale) || (return $self->pass_error)
1173 2 0 'Locale::Unicode'->new($likely->{'target'}) || (return $self->pass_error('Locale::Unicode'->error))
2462 246 0 $number // ""
2470 246 0 $self->_locale_object($locale) || (return $self->pass_error)
2474 246 0 $self->make_inheritance_tree($locale->base) || (return $self->pass_error)
2507 222 0 shift @_ || (return $self->error('No locale has been provided to retrieve its Gettext plural forms.'))
2574 182 0 $self->_locale_object($locale) || (return $self->pass_error)
2577 182 0 $self->make_inheritance_tree($locale->base) || (return $self->pass_error)
2586 182 0 $self->plural_rules('locale', $loc) || (return $self->pass_error)
2694 0 0 $opts->{'greatest_diff'} || (return $self->error(q[No 'greatest_diff' argument value was provided.]))
2696 0 0 $opts->{'pattern'} || (return $self->error('No pattern was provided.'))
2923 4 0 shift @_ || (return $self->error('No timezone was provided to get its canonical version.'))
2925 4 0 $self->_dbh || (return $self->pass_error)
2933 1 0 eval {
2963 2 0 eval {
3219 4 0 'DBI'->connect("dbi:SQLite:dbname=$file", '', '', $params) || (return $self->error("Unable to make connection to Unicode CLDR SQLite database file ${file}: ", $DBI::errstr))
3236 272848 0 $ref // ""
217 0 $ref // ""
3336 345 0 shift @_ || (return $self->error('No hash definition provided.'))
3338 345 0 $def->{'table'} || (return $self->error('No SQL table name was provided.'))
3375 0 0 $order_by_value->[0] // "undef"
3415 0 0 $field // ""
0 0 $datatype // ""
3435 0 0 $field // ""
3458 311 7 $opts->{$_} // ""
3550 0 0 $opts->{'has'} // "undef"
3580 95 0 $self->_dbh || (return $self->pass_error)
3582 95 0 eval {
3592 58 0 $self->_dbh || (return $self->pass_error)
3594 58 0 eval {
3621 571 0 shift @_ || (return $self->error('No hash definition provided.'))
3623 571 0 $def->{'field'} || (return $self->error('No table field was provided.'))
3625 571 0 $def->{'table'} || (return $self->error('No SQL table name was provided.'))
3626 28 543 $def->{'default'} || {}
3654 125 24 $opts->{$_} // ""
3758 65 0 $self->_dbh || (return $self->pass_error)
3760 65 0 eval {
3787 942 0 $id // ""
3789 939 3 $Locale::Unicode::Data::STHS->{$file} //= {}
3803 1 0 shift @_ || die('No metadata property provided.')
3804 1 0 $self->_dbh || (return $self->pass_error)
3809 1 0 eval {
3829 1316 0 shift @_ || (return $self->error('No locale provided to ensure a Locale::Unicode.'))
3834 1314 0 'Locale::Unicode'->new($locale) || (return $self->pass_error('Locale::Unicode'->error))
3844 241 0 $id // ""
3855 241 0 $Locale::Unicode::Data::STHS->{$file} //= {}
3863 1434 0 shift @_ || (return $self->error('No field was provided.'))
3869 2 0 $def->{'field'} || die(q[No 'field' property was provided in the field dictionary hash reference.])
3947 0 0 ref $_[0] || ''
3986 0 0 shift @_ // ""
4086 0 0 shift @_ // ""
4161 1 0 ref $_[0] || ''
4169 1 0 $args->{'message'} ||= ""
4205 0 0 $self->{'package'} // "undef"
0 0 $self->{'line'} // "undef"
0 0 $self->{'file'} // "undef"
4283 0 0 shift @_ || die('No object property was provided.')
4291 0 0 shift @_ // ""

or 3 conditions

line l !l&&r !l&&!r condition
60 0 4 0 ref $this || $this
287 0 0 0 $@ || $sth->errstr
308 0 0 0 $@ || $sth->errstr
357 0 0 0 $@ || $sth->errstr
796 0 0 0 $@ || $sth->errstr
918 0 0 6 $locale->script || $locale->variant
1372 0 0 0 ref $self || $self
1401 0 0 0 !scalar(@_) || defined $class
0 0 0 scalar @_ == 1 || scalar @_ == 2 && defined $class
1424 0 0 0 $self->{'fatal'} or defined ${"${class}::FATAL_EXCEPTIONS";} and ${"${class}::FATAL_EXCEPTIONS";}
2943 0 0 0 $@ || $sth->errstr
2970 0 0 0 $@ || $sth->errstr
3175 246 0 0 $opts->{'datafile'} || $self->datafile || $Locale::Unicode::Data::DB_FILE
3295 0 0 0 ref $this->{$k} eq "ARRAY" or not ref $this->{$k}
3307 0 0 0 ref $this->[$i] eq "HASH" or not ref $this->[$i]
3339 345 0 0 $def->{'id'} || $table
3340 0 345 0 $def->{'what'} || $table
3576 284 0 61 $by_key or defined $has
3604 0 0 0 $@ || $sth->errstr
3624 0 571 0 $def->{'what'} || $field
3769 0 0 0 $@ || $sth->errstr
3770 0 1 569 $def->{'multi'} || scalar @$id > 1
3788 942 0 0 $self->datafile || $Locale::Unicode::Data::DB_FILE
3817 0 0 0 $@ || $sth->errstr
3854 241 0 0 $self->datafile || $Locale::Unicode::Data::DB_FILE
3927 0 0 0 not builtin::blessed($val) or builtin::blessed($val) and not $val->isa($isa)
4008 0 0 0 ref $self || $self
4058 0 0 0 ref $this || $this
4111 0 0 0 ref $self || $self
4155 0 1 0 ref $this || $this
4311 0 0 0 ref $self || $self
4353 0 0 0 ref $this || $this