Branch Coverage

blib/lib/Matplotlib/Simple.pm
Criterion Covered Total %
branch 133 646 20.5


line true false branch
285 0 12 if (ref $args ne "HASH")
294 0 12 if (scalar @undef_args > 0)
312 0 14 if (ref $args ne "HASH")
321 0 14 if (scalar @undef_args > 0)
330 0 14 if (scalar @bad_args > 0)
344 0 0 if ($args->{'args'}{$item} =~ /^([^\"\',]+)$/)
353 0 0 if ($ref ne "ARRAY" and $ref ne "")
356 0 0 if ($ref eq "")
357 0 0 if ($method eq 'show') { }
370 0 14 unless defined $args->{'ax'}
373 0 14 if (defined $args->{'args'}{'plot.type'} and $args->{'args'}{'plot.type'} eq "pie")
377 0 14 if $pie_plot == 1
388 0 0 if (ref $args ne "HASH")
397 0 0 if (scalar @undef_args > 0)
408 0 0 if (scalar @bad_opt > 0)
417 0 0 if (scalar keys %ref_counts > 1)
423 0 0 if (defined $ref_counts{''}) { }
0 0 elsif (defined $ref_counts{'ARRAY'}) { }
0 0 elsif (defined $ref_counts{'HASH'}) { }
448 0 0 if ($plot_type eq "grouped" and defined $plot->{'width'} and $plot->{'stacked'} == 0)
456 0 0 if (defined $plot->{'key.order'}) { }
462 0 0 if ($plot->{'log'} or $plot->{'logscale'})
466 0 0 if $c eq "color" and $plot_type eq "grouped" and ref $plot->{$c} ne ""
468 0 0 if ($ref eq '') { }
0 0 elsif ($ref eq 'ARRAY') { }
0 0 elsif ($ref eq 'HASH') { }
480 0 0 if ($ref eq '') { }
0 0 elsif ($ref eq 'ARRAY') { }
491 0 0 if ($ref eq '') { }
0 0 elsif ($ref eq 'HASH') { }
496 0 0 if (scalar @{$plot->{$err}{$i};} != 2)
512 0 0 if ($plot_type eq 'simple') { }
0 0 elsif ($plot_type eq 'grouped') { }
519 0 0 if (defined $plot->{'color'} and ref $plot->{'color'} eq "HASH")
521 0 0 if (scalar @undef_args > 0)
538 0 0 if ($plot->{'stacked'} == 0)
544 0 0 if $plot->{'plot.type'} eq "bar"
554 0 0 if ref $plot->{$_} eq "ARRAY"
558 0 0 if ($plot->{'stacked'} > 0)
559 0 0 $plot->{'plot.type'} eq 'barh' ? :
567 0 0 if $plot->{'stacked'} > 0
569 0 0 if $plot->{'stacked'} <= 0
574 0 0 if $plot->{'plot.type'} eq "bar"
589 0 0 if (ref $args ne "HASH")
597 0 0 if (scalar @undef_args > 0)
609 0 0 if (scalar @bad_opt > 0)
614 0 0 unless ($plot->{'orientation'} =~ /^(?:horizontal|vertical)$/)
618 0 0 if (ref $plot->{'data'} eq "ARRAY")
623 0 0 if (defined $plot->{'key.order'}) { }
639 0 0 if ($axis =~ /^([^xy])$/)
649 0 0 if (scalar @non_numeric > 0)
656 0 0 if (defined $plot->{'colors'}) { }
660 0 0 if (scalar @bad_keys > 0)
675 0 0 if (defined $plot->{'color'})
684 0 0 if ($plot->{'orientation'} eq 'vertical') { }
698 0 0 if (ref $args ne "HASH")
706 0 0 if (scalar @undef_args > 0)
714 0 0 if (scalar @bad_args > 0)
725 0 0 if (defined $plot->{'col.labels'}) { }
733 0 0 if $plot->{'mirror'} > 0
736 0 0 if (defined $plot->{'row.labels'}) { }
759 0 0 if $plot->{'cb_logscale'} > 0
769 0 0 unless (&looks_like_number($plot->{$opt}))
775 0 0 if (scalar @options > 0)
778 0 0 if ($plot->{'cb_logscale'}) { }
784 0 0 if (defined $plot->{'cblabel'}) { }
787 0 0 if $plot->{'colorbar.on'}
795 0 0 if ($plot->{'show.numbers'}) { }
804 0 0 if ($axis =~ /^([^xy])$/)
822 0 0 if (ref $args ne "HASH")
830 0 0 if (scalar @undef_args > 0)
843 0 0 if (scalar @undef_args > 0)
853 0 0 if ($plot->{'xbins'} == 0 or $plot->{'ybins'} == 0)
858 0 0 if (defined $plot->{'key.order'}) { }
863 0 0 if (scalar @keys != 2)
868 0 0 if (scalar @{$plot->{'data'}{$keys[1]};} != $n_points)
881 0 0 if ($plot->{'cb_logscale'})
892 0 0 if ($plot->{$opt} ne "log" and $plot->{$opt} ne "linear")
899 0 0 if (defined $plot->{'marginals'} and $plot->{'marginals'} > 0)
915 0 0 unless &looks_like_number($plot->{$o})
921 0 0 if ($plot->{'colorbar.on'} and defined $plot->{'shared.colorbar'})
925 0 0 if (defined $plot->{'cblabel'}) { }
941 0 0 unless defined $format
951 0 0 if (ref $args ne "HASH")
961 0 0 if (scalar @undef > 0)
971 0 0 if (scalar @undef > 0)
978 0 0 if ref $plot->{$arg} eq "HASH"
980 0 0 if ($ref eq '') { }
0 0 elsif ($ref eq 'ARRAY') { }
981 0 0 if ($plot->{$arg} =~ /^[A-Za-z]+$/) { }
994 0 0 if ($axis =~ /^([^xy])$/)
1000 0 0 if (ref $plot->{'data'} eq "ARRAY")
1004 0 0 if (scalar keys %{$$plot{'data'};} > 1) { }
1011 0 0 if (scalar @non_numeric > 0)
1019 0 0 unless defined $plot->{$arg}{$set}
1020 0 0 if ($plot->{$arg}{$set} =~ /^[A-Za-z]+$/) { }
1027 0 0 if ($plot->{'show.legend'}) { }
1039 0 0 if (ref $args ne "HASH")
1047 0 0 if (scalar @undef_args > 0)
1057 0 0 if (scalar @undef_args > 0)
1066 0 0 if ($plot->{'xbins'} == 0 or $plot->{'ybins'} == 0)
1071 0 0 if (defined $plot->{'key.order'}) { }
1076 0 0 if (scalar @keys != 2)
1081 0 0 if (scalar @{$plot->{'data'}{$keys[1]};} != $n_points)
1092 0 0 if ($plot->{'cb_logscale'})
1097 0 0 unless (&looks_like_number($plot->{$arg}))
1115 0 0 if ($bad_pts > 0)
1124 0 0 if ($bad_pts > 0)
1143 0 0 if ($plot->{'logscale'}) { }
1146 0 0 if ($axis =~ /^([^xy])$/)
1171 0 0 if $plot->{'show.colorbar'} == 0
1179 0 0 unless &looks_like_number($plot->{$o})
1185 0 0 if ($plot->{'colorbar.on'} and defined $plot->{'shared.colorbar'})
1190 0 0 if (defined $plot->{'cblabel'}) { }
1201 0 0 if (ref $args ne "HASH")
1211 0 0 if (scalar @undef_args > 0)
1221 0 0 if (scalar @undef_args > 0)
1227 0 0 if ($data_ref ne "ARRAY")
1233 0 0 if (grep {not &looks_like_number($_);} @{$row;})
1238 0 0 if ($non_numeric_data and not defined $plot->{'stringmap'})
1248 0 0 if ($non_numeric_data)
1255 0 0 if ($non_numeric_data)
1261 0 0 if defined $plot->{'cmap'}
1273 0 0 if $non_numeric_data
1288 0 0 if ($non_numeric_data)
1297 0 0 unless &looks_like_number($plot->{$o})
1303 0 0 if ($plot->{'colorbar.on'} and defined $plot->{'shared.colorbar'})
1307 0 0 if $plot->{'colorbar.on'}
1308 0 0 if ($non_numeric_data and $plot->{'colorbar.on'})
1317 0 0 if (ref $args ne "HASH")
1327 0 0 if (scalar @undef_args > 0)
1337 0 0 if (scalar @undef_opt > 0)
1343 0 0 if (defined $plot->{'key.order'}) { }
1350 0 0 if ($plot->{'autopct'} ne "")
1371 0 18 if (ref $args ne "HASH")
1379 0 18 if (scalar @undef_args > 0)
1389 0 18 if (scalar @bad_opt > 0)
1396 0 0 if ($axis =~ /^([^xy])$/)
1411 12 3 if (ref $plot->{'data'} eq "ARRAY" and scalar @{$plot->{'data'};} == 2 and ref $plot->{'data'}[0] eq "ARRAY" and ref $plot->{'data'}[1] eq "ARRAY" and ref $plot->{'data'}[0][0] ne "ARRAY")
1419 16 2 if (ref $plot->{'data'} eq "ARRAY")
1420 9 7 if (defined $plot->{'set.options'})
1424 2 7 if ($ref_type eq 'ARRAY') { }
1 6 elsif ($ref_type ne '') { }
1427 1 1 if ($n_set_opt > $n_data)
1436 0 14 if (defined $plot->{'twinx'})
1437 0 0 if (ref $plot->{'twinx'} eq '') { }
0 0 elsif (ref $plot->{'twinx'} eq 'ARRAY') { }
1438 0 0 unless $plot->{'twinx'} =~ /^\d+$/
1442 0 0 if (scalar @bad_opt > 0)
1449 0 14 if (defined $plot->{'twinx.args'})
1451 0 0 unless $ref eq "HASH"
1453 0 0 if (scalar @bad_opt > 0)
1458 0 0 if grep {$idx == $_;} @twinx
1465 0 17 if ($ref ne "ARRAY")
1470 0 17 if ($n_elem != 2)
1475 0 17 if ($bad_opt[0] != $bad_opt[1])
1483 34 0 if scalar @bad_opt == 0
1494 9 8 if (defined $plot->{'set.options'})
1496 7 2 if ($so_ref eq '') { }
2 0 elsif ($so_ref eq 'ARRAY' and defined $plot->{'set.options'}[$arr_i]) { }
1504 0 17 if (grep {$arr_i == $_;} @twinx) { }
1507 0 0 if (defined $plot->{'twinx.args'}{$arr_i})
1522 0 2 if (defined $plot->{'key.order'}) { }
1527 0 2 if (defined $plot->{'set.options'} and ref $plot->{'set.options'} eq "HASH")
1529 0 0 if (scalar @bad_opt > 0)
1534 0 2 if (defined $plot->{'twinx'})
1535 0 0 if (ref $plot->{'twinx'} eq '') { }
0 0 elsif (ref $plot->{'twinx'} eq 'HASH') { }
1536 0 0 unless defined $plot->{'data'}{$plot->{'twinx'}}
1540 0 0 if (scalar @bad_opt > 0)
1547 0 2 if (defined $plot->{'twinx.args'})
1549 0 0 unless $ref eq "HASH"
1551 0 0 if (scalar @bad_opt > 0)
1556 0 0 if grep {$set eq $_;} @twinx
1563 0 2 if ($set_ref ne "ARRAY")
1568 0 2 if ($n_arrays != 2)
1573 0 2 if ($n_elem[0] != $n_elem[1])
1581 0 4 if (scalar @undef_i > 0)
1591 0 2 if (defined $plot->{'set.options'} and ref $plot->{'set.options'} eq "")
1596 0 2 if (ref $plot->{'set.options'} eq "HASH" and defined $plot->{'set.options'}{$set})
1600 2 0 if ($plot->{'show.legend'})
1604 0 2 if (grep {$set eq $_;} @twinx) { }
1607 0 0 if (defined $plot->{'twinx.args'}{$set})
1626 0 0 if (ref $args ne "HASH")
1634 0 0 if (scalar @undef_args > 0)
1644 0 0 if (scalar @undef_args > 0)
1649 0 0 if ($overall_ref ne "HASH")
1658 0 0 if (scalar %ref_counts > 1)
1662 0 0 if (defined $ref_counts{'ARRAY'}) { }
0 0 elsif (defined $ref_counts{'HASH'}) { }
1675 0 0 if ($plot_type eq 'single') { }
0 0 elsif ($plot_type eq 'multiple') { }
1678 0 0 if (defined $plot->{'keys'}) { }
1684 0 0 if ($n_keys != 2 and $n_keys != 3)
1688 0 0 if (defined $plot->{'color_key'}) { }
0 0 elsif (scalar @keys == 3) { }
1696 0 0 if (scalar @undef_i > 0)
1703 0 0 if (defined $plot->{'set.options'} and ref $plot->{'set.options'} eq "")
1710 0 0 unless &looks_like_number($plot->{$o})
1715 0 0 if (defined $color_key) { }
1716 0 0 unless (defined $plot->{'data'}{$color_key})
1731 0 0 if grep {$set eq $_;} keys %{$$plot{"data"};}
1734 0 0 if (scalar @undefined_opts > 0)
1745 0 0 if (defined $plot->{'keys'}) { }
1751 0 0 if ($n_keys != 2 and $n_keys != 3)
1757 0 0 if (scalar @undef_args > 0)
1762 0 0 if (defined $plot->{'color_key'}) { }
0 0 elsif (scalar @keys == 3) { }
1768 0 0 if (not defined $color_key and $n_keys == 3)
1771 0 0 if (defined $plot->{'set.options'}{$set})
1776 0 0 if (defined $color_key) { }
1777 0 0 unless (defined $plot->{'data'}{$set}{$color_key})
1781 0 0 unless ($options =~ /label\s*=/)
1792 0 0 if defined $color_key
1800 0 0 if (ref $args ne "HASH")
1808 0 0 if (scalar @undef_args > 0)
1818 0 0 if (scalar @undef_opt > 0)
1823 0 0 unless ($plot->{'orientation'} =~ /^(?:horizontal|vertical)$/)
1826 0 0 if (ref $plot->{'data'} eq "ARRAY")
1831 0 0 if (defined $plot->{'key.order'}) { }
1844 0 0 if defined $_
1850 0 0 if ($axis =~ /^([^xy])$/)
1857 0 0 if (defined $plot->{'colors'}) { }
1860 0 0 if (scalar @wrong_keys > 0)
1875 0 0 if (defined $plot->{'color'})
1882 0 0 if ($plot->{'whiskers'})
1908 0 0 if ($plot->{'orientation'} eq 'vertical') { }
1923 0 0 if ($plot->{'orientation'} eq 'vertical') { }
1934 0 0 if ($plot->{'orientation'} eq 'vertical') { }
1949 0 0 if (ref $args ne "HASH")
1957 0 0 if (scalar @undef_args > 0)
1968 0 0 if (scalar @undef_opt > 0)
1976 0 0 if ($ref_type eq 'HASH') { }
0 0 elsif ($ref_type eq 'ARRAY') { }
2000 0 0 if ($plot->{'show.legend'} > 0) { }
2042 0 0 if (&looks_like_number($str))
2045 0 0 if ($str =~ /\w+\h*=\h*["'\(]/)
2048 0 0 if ($str =~ /^\w+$/) { }
0 0 elsif ($str =~ /^\[\h*\-?\d.+\d\h*\]$/) { }
0 0 elsif ($str =~ m"[!\@#\$\%^&*\(\)\{\}\[\]\<\>,/\-\h:;\+=\w]+$") { }
0 0 elsif ($str =~ /,/ and not $str =~ /[\]\[]/) { }
2075 1 11 if (ref $p ne "ARRAY")
2078 1 10 if (scalar @{$p;} == 0)
2088 1 5 if (scalar keys %kind != 1)
2092 1 4 if ($kind eq 'HASH') { }
4 0 elsif ($kind eq 'ARRAY') { }
2098 1 0 if scalar @group
2103 1 5 if (scalar @{$group;} == 0)
2108 0 5 if (ref $main ne "HASH")
2112 1 4 if scalar @g
2129 1 22 if (scalar @_ == 1 and ref $_[0] eq 'HASH') { }
21 1 elsif (scalar @_ % 2 == 0) { }
2137 12 10 if defined $args->{'p'}
2138 0 14 if (scalar grep({$args->{$_};} "output.file", "show") == 0)
2142 0 14 $args->{'show'} ? :
2176 0 14 if (scalar @undef_args > 0)
2180 0 3 unless (defined $args->{'plot.type'} or defined $args->{'plots'})
2186 0 14 if (ref $args->{'output.file'} ne "")
2195 0 14 if (scalar @bad_args > 0)
2201 0 14 if defined $args->{'nrow'}
2202 2 12 if defined $args->{'ncol'}
2206 11 3 if (defined $args->{'plot.type'} and defined $args->{'data'})
2209 0 14 if ($single_plot == 1 and not defined $args->{'plot.type'})
2214 0 14 if ($single_plot == 0 and not defined $args->{'plots'})
2218 0 14 if ($single_plot == 0 and ref $args->{'plots'} ne "ARRAY")
2222 0 14 if ($single_plot == 0 and scalar @{$args->{'plots'};} == 0)
2226 11 3 if ($single_plot == 1)
2227 22 0 if defined $args->{$_}
2232 0 14 if ($single_plot == 0 and $args->{'nrows'} * $args->{'ncols'} < scalar @{$args->{'plots'};})
2242 3 11 if ($single_plot == 0)
2246 0 3 if (scalar @bad_args > 0)
2254 0 3 if (scalar @output_file > 0)
2260 0 11 if ($single_plot == 1 and ref $args->{'data'} eq "HASH" and scalar keys %{$$args{"data"};} == 0)
2264 28 56 if defined $args->{$_}
2265 0 14 if (scalar @bad_args > 0)
2282 0 14 if (defined $args->{'shared.colorbar'} and $single_plot == 1)
2286 0 14 if (defined $args->{'shared.colorbar'})
2288 0 0 if ($ref ne "ARRAY")
2293 0 0 if ($max_subplot_idx > $args->{'nrows'} * $args->{'ncols'} - 1)
2298 1 13 if (defined $args->{'add'})
2300 0 1 if ($ref ne "ARRAY")
2304 0 14 if (defined $args->{'fh'}) { }
2306 0 0 if ($ref ne "File::Temp")
2317 3 11 if ($single_plot == 0) { }
11 0 elsif ($single_plot == 1) { }
2328 3 11 if (defined $args->{'plots'})
2332 5 0 if defined $plot->{'plot.type'}
2336 0 3 if (scalar @undef_plot_types > 0)
2352 11 3 if ($single_plot == 1)
2356 0 1 unless defined $type
2357 0 1 unless defined $dispatch{$type}
2366 0 11 unless (defined $dispatch{$type})
2393 0 5 if (defined $args->{'shared.colorbar'} and grep {$_ == $ax;} @{$$args{"shared.colorbar"};})
2397 0 0 if ($ax == &max(@{$$args{'shared.colorbar'};})) { }
2405 1 4 if (defined $plot->{'add'})
2407 0 1 if ($ref ne "ARRAY")
2414 0 1 unless defined $type
2415 0 1 unless defined $dispatch{$type}
2427 0 5 if (scalar @undef_keys > 0)
2459 0 0 if ($ref eq '') { }
0 0 elsif ($ref eq 'ARRAY') { }
2461 0 0 if ($plt_method eq 'show') { }
0 0 elsif ($type eq 'single quotes') { }
0 0 elsif ($type eq 'no quotes') { }
2471 0 0 if ($type eq 'single quotes') { }
0 0 elsif ($type eq 'no quotes') { }
2485 0 0 if ($ref eq '') { }
0 0 elsif ($ref eq 'ARRAY') { }
2496 0 12 if (defined $args->{'scale'})
2500 0 12 if (defined $args->{'scalex'})
2503 0 12 if (defined $args->{'scaley'})
2506 12 0 if (defined $args->{'output.file'})
2516 0 12 if $args->{'show'}
2518 12 0 if $args->{'execute'} == 0
2519 0 12 if ($args->{'execute'}) { }
2523 0 0 if ($exit != 0)
2529 0 0 if defined $args->{'output.file'}
2532 12 0 if defined $args->{'output.file'}
2544 0 1 if (scalar @_ == 1 and ref $_[0] eq 'HASH') { }
1 0 elsif (scalar @_ % 2 == 0) { }
2552 0 1 if (defined $args->{'plot.type'} and $args->{'plot.type'} ne $sub_name)
2555 0 1 if (defined $args->{'plots'})
2558 1 0 if (defined $args->{'p'})