Branch Coverage

blib/lib/PML.pm
Criterion Covered Total %
branch 314 518 60.6


line true false branch
353 311 22 if ($class eq 'PML::Token')
360 311 0 if defined $v
364 20 2 if (not ref $ref) { }
398 0 2 unless eval { do { require Storable } }
432 1 21 if defined $v
459 0 19 unless defined $self and defined $x
465 18 1 if (ref $x eq 'ARRAY') { }
471 0 1 unless open SOURCE, $x
511 0 19 unless defined $self and defined $x
522 1 18 unless (ref $x)
525 0 1 unless (chdir($dir))
535 158 18 unless defined $line and length $line
536 18 158 unless defined $line
538 0 158 if ($$self[16])
539 0 0 if ($line =~ /$$self[16]/)
548 149 8 if @tokens
552 0 2 unless (exists $$self[13]{$$invalid_function[0]} and defined $$self[13]{$$invalid_function[0]})
604 0 18 unless defined $self
609 0 18 unless ($$self[3])
638 148 0 if defined $tmp
641 0 148 if ($$self[22])
643 0 0 if ($$self[22] =~ /$RE_LOOP_INT/o) { }
645 0 0 if ($1 eq 'next') { }
0 0 elsif ($1 eq 'redo') { }
0 0 elsif ($1 eq 'last') { }
738 0 2 unless ($self)
743 0 2 unless ($variable)
747 0 2 if (ref $variable eq 'HASH')
754 0 2 if (defined $value)
790 0 0 unless ref $regex eq 'Regexp'
872 0 8 unless (defined $options{'token'} and defined $options{'name'})
877 8 8 unless defined $options{$_}
878 0 8 unless (ref $options{$_} eq 'CODE')
879 0 0 unless (ref $options{$_} eq 'ARRAY' and ref $options{$_}[0] eq 'CODE')
885 2 6 if ($options{'type'} == 1) { }
4 2 elsif ($options{'type'} == 2) { }
2 0 elsif ($options{'type'} == 3) { }
886 1 1 if (ref $ref) { }
892 1 3 if (ref $ref) { }
898 1 1 if (ref $ref) { }
908 3 5 if (ref $ref) { }
936 382 36 if (ref $callback eq 'CODE') { }
36 0 elsif (ref $callback eq 'ARRAY' and ref $$callback[0] eq 'CODE') { }
983 0 2 unless defined $self
985 2 0 if $flag
1035 0 329 unless defined $self
1042 0 329 unless @tokens
1046 65 264 if (@tokens == 1 and ref $tokens[0] eq 'ARRAY')
1053 1 345 unless defined $token
1056 0 345 if (ref $token eq 'ARRAY')
1062 2 343 unless (ref $token eq 'PML::Token')
1068 3 340 if (exists $$self[24]{$token->id}) { }
340 0 elsif (exists $tokens{$token->id}) { }
1085 1 342 if ($@)
1093 67 262 if (wantarray) { }
1123 0 203 unless defined $self and defined $line_ref
1124 0 158 unless $lines or defined $$self[5]
1131 82 121 if ($$line_ref =~ s/$RE_FUNCTION//o) { }
1136 1 81 if ($loop_functions{$func} and $pre_text =~ s/$RE_LABEL//o)
1142 4 78 if ($pre_text and $$self[9])
1147 4 78 if ($pre_text)
1153 32 50 if (exists $function_arg_only{$func} or exists $$self[23]{'function_arg_only'}{$func}) { }
32 18 elsif (exists $function_arg_block{$func} or exists $$self[23]{'function_arg_block'}{$func}) { }
9 9 elsif (exists $function_block_no_parse{$func} or exists $$self[23]{'function_block_no_parse'}{$func}) { }
2 7 elsif (exists $function_block_only{$func} or exists $$self[23]{'function_block_only'}{$func}) { }
1157 1 31 if (exists $$self[23]{'function_arg_only'}{$func}) { }
1164 0 32 if ($token and $label)
1165 29 3 if ($token)
1170 1 31 if (exists $$self[23]{'function_arg_block'}{$func}) { }
1179 1 31 if ($token and $label)
1180 27 5 if ($token)
1186 0 9 if (exists $$self[23]{'function_block_no_parse'}{$func}) { }
1197 0 9 if ($token and $label)
1198 9 0 if ($token)
1203 1 1 if (exists $$self[23]{'function_block_only'}{$func}) { }
1210 0 2 if ($token and $label)
1211 2 0 if ($token)
1215 1 6 if ($func =~ /$RE_VAR_TEST/o) { }
1221 0 7 if ($token and $label)
1222 7 0 if ($token)
1224 1 6 if ($self->peek(qr/^{/o, $line_ref, $lines))
1228 3 3 unless ($token->id == 14 or exists $$self[13]{$func})
1238 62 19 if ($allow_remove_newline{$func})
1278 0 75 unless defined $self and defined $line_ref
1288 0 75 if (not defined $x or $x ne '(')
1296 4 71 unless length $guts
1307 27 76 if ($x eq '"' or $x eq q[']) { }
9 67 elsif ($guts =~ s/^(\${$RE_VAR})\s*(?=,|=>|$)//o) { }
35 32 elsif ($guts =~ s/^((?:\d+)(?:\.\d+)?)\s*(?=,|=>|$)//o) { }
1314 27 0 if (length $y)
1328 3 29 if ($guts =~ /^[^,]*?(?
1334 29 0 if (length $y)
1344 103 0 if ($guts =~ s/^\s*(?:(?:,\s*)|(?:=>\s*)|$)//o)
1345 0 103 if (@queue > 1) { }
1349 103 0 if @queue
1355 0 71 if (@queue)
1356 0 0 if (@queue > 1) { }
1365 0 103 if (ref $token eq 'ARRAY')
1401 0 44 unless defined $self and defined $line_ref
1413 0 44 unless ($x eq '{')
1459 0 138 unless $$self[9] and $$self[10]
1463 0 173 unless length $$line_ref or @{$lines;}
1464 35 138 unless length $$line_ref
1466 138 35 if length $$line_ref
1469 0 138 unless (length $$line_ref)
1493 0 44 unless $$self[9] and $$self[10]
1517 44 0 unless $$self[9] and $$self[11]
1557 374 1567 unless (@repository)
1559 0 374 unless length $$line_ref or @{$lines;}
1560 87 287 unless length $$line_ref
1562 0 374 unless length $$line_ref
1568 0 1941 unless defined $char
1570 256 1685 unless ($got_od)
1572 0 256 if (not $char eq $od) { }
1586 31 72 if ($last_real_char ne '\\' and $char =~ /^(['"])/o and $od ne $1 and not $sflag)
1595 91 0 if ($char eq $od and $last_real_char ne '\\' || $ds)
1597 33 58 unless $od eq $cd
1600 289 0 if ($char eq $cd and $last_real_char ne '\\' || $ds)
1603 256 33 unless $count
1608 0 1398 if ($last_real_char eq '\\' and $char eq '\\') { }
1615 1117 281 unless $char =~ /^(\s|\n|\\)/o
1619 0 256 if ($count)
1625 199 57 if @repository
1627 23 233 if @sub_gut
1656 0 280 unless defined $self and defined $lines
1664 318 0 if ($lines == $$self[5])
1670 0 318 unless defined $line
1671 56 262 if $line =~ /^\s*#/o
1703 9 18 if ($$line_ref =~ /(\S+)/o)
1704 8 1 $1 =~ /$regex/ ? :
1708 11 17 unless $$lines[$i] =~ /(\S+)/o
1709 3 14 $1 =~ /$regex/ ? :
1736 0 70 unless ($v =~ /^$RE_VAR/o)
1745 4 3 if $1
1750 68 2 if length $v
1756 0 70 unless ($v = $x) =~ /$RE_VAR/o
1760 6 64 if ($v =~ /^(.*?)\[(\d+)\]$/o) { }
4 60 elsif ($v =~ /^([^\.]+)\.([^\.]+)$/o) { }
1 59 elsif (ref $$self[0]{$v} eq 'ARRAY') { }
0 59 elsif (ref $$self[0]{$v} eq 'HASH') { }
1764 0 6 unless (ref $$self[0]{$v} eq 'ARRAY')
1765 0 0 if $$self[6]
1766 0 0 unless wantarray
1769 6 0 if (defined $$self[0]{$v}[$index]) { }
1772 0 0 if $$self[6]
1779 0 4 unless (ref $$self[0]{$v} eq 'HASH')
1780 0 0 if $$self[6]
1784 4 0 if (defined $$self[0]{$v}{$index}) { }
1787 0 0 if $$self[6]
1791 1 0 if wantarray
1794 0 0 if wantarray
1797 59 0 if (defined $$self[0]{$v}) { }
1800 0 0 if $$self[6]
1832 0 0 if $current_part eq '.'
1833 0 0 if $current_part eq '..'
1834 0 0 unless $current_part eq '..'
1905 0 1 if ($$self[15])
1932 0 77 if ($$self[18] > $$self[17])
2013 312 1032 if (defined $id)
2038 148 43 if (defined $context)
2039 0 148 unless ($context == 1 or $context == 2)
2071 148 223 if (defined $fli)
2072 0 148 unless ($fli == 0 or $fli == 1 or $fli == 2)
2105 312 344 if (defined $data)
2130 1 2 if (defined $label)
2155 0 0 if (defined $dir)
2156 0 0 if (not -d $dir) { }
0 0 elsif (-w $dir) { }
2238 0 16 if ($#{$a;} > 1) { }
2246 3 13 if ($unless) { }
2266 4 6 if ($1 eq 'elsif') { }
6 0 elsif ($1 eq 'else') { }
2269 0 4 if (@{$elsif_a;} > 1)
2337 0 23 unless (defined $$a[0])
2367 0 1 unless (@args)
2376 1 0 if (not $file =~ m[^(?:\.(?:\./|/)|/)]o) { }
2380 1 0 if (-e "$path/$file")
2390 0 0 if (-e $file)
2393 0 0 unless $file =~ m[^/]o
2397 0 1 unless ($found)
2405 0 1 if ($PML::DEBUG)
2417 0 1 if ($PML::DEBUG)
2450 0 5 unless (defined $$a[0])
2457 0 5 if (exists $$self[13]{$name} and $$self[6])
2483 0 2 unless (@$a == 1)
2510 0 2 unless (@$a)
2543 0 1 if ($@)
2550 0 0 if ($PML::DEBUG and $@)
2578 0 3 if (@{$a;} > 1) { }
2585 1 2 if ($until) { }
2638 0 0 unless (@$a <= 3)
2666 0 4 unless (@$a == 1)
2695 0 1 if (@$a > 1)
2736 0 223 unless defined $string and length $string
2740 16 24 if $1
2745 209 14 if length $string
2757 135 88 unless $token->file_loc == 1
2790 0 21 unless @tokens >= 2
2800 16 5 if ($self->tokens_execute($a))
2864 0 20 if ($@ and $self->warning)
2871 3 17 if ($token->context == 2) { }
2901 0 25 if (not $v =~ /^$RE_VAR/o or $v =~ /[\$\{\}]/o or $v =~ /^(\.|ARGV)$/o)
2909 0 25 if ($v =~ /^(.*?)\[(\d+)\]$/o) { }
0 25 elsif ($v =~ /^([^\.]+)\.([^\.]+)$/o) { }
2912 0 0 if (defined $$self[0]{$array} and ref $$self[0]{$array} ne 'ARRAY')
2924 0 0 if (defined $$self[0]{$hash} and ref $$self[0]{$hash} ne 'HASH')
2934 16 9 unless exists $$self[0]{$v}
2938 20 5 if ($sub_token == 1) { }
3 2 elsif ($sub_token == 2) { }
1 1 elsif ($sub_token == 3) { }
1 0 elsif ($sub_token == 4) { }
0 0 elsif ($sub_token == 5) { }
2939 3 17 if (@values > 1) { }
2940 0 3 if ($array or $hash) { }
2950 2 1 if defined $ref and $$ref
2955 0 1 if (not $array || $hash and ref $$self[0]{$v} eq 'ARRAY') { }
2960 1 0 if defined $$ref
2965 0 1 if (not $array || $hash and ref $$self[0]{$v} eq 'ARRAY') { }
2970 1 0 if defined $$ref
2975 0 0 if (not $array || $hash and ref $$self[0]{$v} eq 'ARRAY') { }
2980 0 0 if defined $$ref
3016 0 1 unless defined $file
3018 0 1 if $PML::DEBUG
3021 0 1 if $PML::DEBUG
3048 0 5 unless (exists $$self[13]{$name})
3060 0 5 if (defined $arg_names[0] and $arg_names[0] eq '_ALL_')
3073 0 5 if (not @args >= @arg_names and $$self[6])
3089 1 4 if (@args)
3135 0 23 if $1
3140 0 23 if length $v
3142 23 0 if ($token->context == 2) { }
3177 1 1 if ($havelabel = $token->label)
3186 3 3 if $havelabel
3189 0 6 if ($$self[22])
3190 0 0 if ($$self[22] =~ /$RE_LOOP_INT/) { }
3192 0 0 if (not $2 or $2 eq $token->label) { }
3194 0 0 if ($1 eq 'next') { }
0 0 elsif ($1 eq 'redo') { }
0 0 elsif ($1 eq 'last') { }
3208 1 1 if $havelabel
3244 1 14 if ($$self[22])
3245 1 0 if ($$self[22] =~ /$RE_LOOP_INT/) { }
3247 1 0 if (not $2 or $2 eq $token->label) { }
3249 0 1 if ($1 eq 'next') { }
0 1 elsif ($1 eq 'redo') { }
1 0 elsif ($1 eq 'last') { }
3313 0 0 if ($1)
3317 0 0 if ($2)
3377 0 1 unless (exists $$self[13]{$name})
3378 0 0 if ($self->warning)
3411 0 1 if $label
3415 1 0 if (grep {$_ >= 1;} values %{$$self[21];}) { }
3418 0 0 if ($self->warning)
3444 2254 0 if ($class eq 'PML::Token') { }
3445 1033 1221 if ($method eq 'id') { }
191 1030 elsif ($method eq 'context') { }
371 659 elsif ($method eq 'file_loc' or $method eq 'fli') { }
656 3 elsif ($method eq 'data') { }
3 0 elsif ($method eq 'label') { }