Branch Coverage

blib/lib/Chart/Gnuplot.pm
Criterion Covered Total %
branch 335 758 44.2


line true false branch
16 36 0 unless (defined $hash{'_multiplot'})
19 0 36 $^O =~ /MSWin/ ? :
24 36 0 unless (defined $hash{'terminal'} or defined $hash{'term'})
31 36 0 if (defined $hash{'output'})
35 0 36 if $hash{'terminal'} =~ /^post/ and $ext eq 'eps'
50 0 47 if $attr eq 'DESTROY'
51 47 0 if defined $key
62 0 3 $opts{$opt} eq 'on' ? :
104 0 0 unless open GPH, ">>$$self{'_script'}"
126 0 0 unless open GPH, ">>$$self{'_script'}"
143 0 0 unless open PLT, ">>$$self{'_script'}"
146 0 0 if (defined $$self{'title'} and defined $$self{'bg'})
152 0 0 if (scalar @charts == 1 and ref $charts[0] eq 'ARRAY') { }
169 0 0 if (defined $$chart{'_dataSets2D'}) { }
0 0 elsif (defined $$chart{'_dataSets3D'}) { }
181 0 0 unless open PLT, ">>$$self{'_script'}"
203 0 0 if (defined $$chart{'_dataSets2D'}) { }
0 0 elsif (defined $$chart{'_dataSets3D'}) { }
215 0 0 unless open PLT, ">>$$self{'_script'}"
236 0 2 unless open PLT, ">>$$self{'_script'}"
237 1 1 ref $cmd eq 'ARRAY' ? :
255 2 36 if defined $$self{'orient'}
258 3 35 if (defined $$self{'imagesize'})
261 3 0 if (defined $$self{'_terminal'} and $$self{'_terminal'} eq 'auto')
264 1 2 if (defined $$self{'orient'} and $$self{'orient'} eq 'portrait') { }
266 1 0 if $ws =~ /^([1-9]\d*)?0?(\.\d+)?$/
267 1 0 if $hs =~ /^([1-9]\d*)?0?(\.\d+)?$/
271 1 1 if $ws =~ /^([1-9]\d*)?0?(\.\d+)?$/
272 1 1 if $hs =~ /^([1-9]\d*)?0?(\.\d+)?$/
279 0 38 if defined $$self{'_multiplot'}
283 0 38 unless open PLT, ">>$pltTmp"
289 0 38 if (defined $$self{'encoding'})
295 2 36 if (defined $$self{'bg'})
298 2 0 if (ref $bg eq 'HASH') { }
302 2 0 if defined $$bg{'density'}
315 2 36 if (defined $$self{'plotbg'})
318 2 0 if (ref $bg eq 'HASH') { }
322 2 0 if defined $$bg{'density'}
341 2 36 if (defined $$self{'timeaxis'})
352 2 0 if (defined $$ds{'timefmt'})
364 2 3 if (defined $$ds{'func'} and ref $$ds{'func'} eq 'HASH')
376 38 172 if ($attr eq 'output') { }
8 164 elsif ($attr eq 'title') { }
6 158 elsif ($attr =~ /^((x|y)2?|z)label$/) { }
7 151 elsif ($attr =~ /^((x|y)2?|z|t|u|v)range$/) { }
9 142 elsif ($attr =~ /^(x|y|x2|y2|z)tics$/) { }
1 141 elsif ($attr eq 'legend') { }
2 139 elsif ($attr eq 'border') { }
4 135 elsif ($attr =~ /^(minor)?grid$/) { }
2 133 elsif ($attr eq 'timestamp') { }
38 95 elsif ($attr eq 'terminal') { }
5 90 elsif (not grep(/^$attr$/, ('gnuplot', 'convert', 'encoding', 'imagesize', 'orient', 'bg', 'plotbg', 'timeaxis')) || $attr =~ /^_/) { }
392 6 1 if (ref $$self{$attr} eq 'ARRAY') { }
0 1 elsif ($$self{$attr} eq 'reverse') { }
395 0 6 if (defined $$self{'timeaxis'} and $$self{'timeaxis'} =~ /(^|,)\s*$1\s*(,|$)/) { }
419 9 0 if (defined $$self{$attr}) { }
423 6 3 if (ref $$self{$attr} eq 'HASH')
425 2 4 if (defined ${$$self{$attr};}{'labelfmt'})
431 1 5 if (defined ${$$self{$attr};}{'minor'})
452 2 0 if (defined $$self{'border'}) { }
455 1 1 if defined $$self{'border'}{'sides'}
467 1 3 if $setGrid == 1
495 3 2 defined $$self{$attr} && $$self{$attr} ne '' ? :
507 3 1 if $isLabelSet == 0
516 0 0 if $isArrowSet == 0
525 0 0 if $isObjectSet == 0
547 1 7 if (ref $title) { }
550 1 0 if defined $$title{'offset'}
554 1 0 if defined $$title{'font'}
555 0 1 if defined $$title{'fontsize'}
556 1 0 if defined $font
559 1 0 if defined $$title{'color'}
562 0 1 if not defined $$title{'enhanced'} or $$title{'enhanced'} ne 'on'
590 2 4 if (ref $label) { }
595 1 1 if defined $$label{'offset'}
599 1 1 if defined $$label{'font'}
600 0 2 if defined $$label{'fontsize'}
601 1 1 if defined $font
604 1 1 if defined $$label{'color'}
607 1 1 if not defined $$label{'enhanced'} or $$label{'enhanced'} ne 'on'
611 1 1 if defined $$label{'rotate'}
651 6 3 if (ref $tic eq 'HASH') { }
1 2 elsif (ref $tic eq 'ARRAY') { }
0 2 elsif ($tic ne 'on') { }
653 0 6 if defined $$tic{'along'}
654 1 5 if defined $$tic{'mirror'} and $$tic{'mirror'} eq 'off'
657 1 5 if defined $$tic{'length'}
658 1 5 if defined $$tic{'rotate'}
659 0 6 if defined $$tic{'offset'}
662 2 4 if (defined $$tic{'incr'})
665 1 1 if (defined $$tic{'start'})
668 1 0 if defined $$tic{'end'}
671 1 1 if $location =~ /^\-/
674 1 5 if defined $$tic{'labels'}
678 1 5 if (defined $$tic{'font'})
681 0 1 if not $font =~ /\,/ and defined $$tic{'fontsize'}
685 1 5 if defined $$tic{'fontcolor'}
736 1 2 if defined $$self{'minorgrid'}
739 2 1 if (ref $grid eq 'HASH' or ref $mgrid eq 'HASH') { }
745 0 2 defined $$grid{'xlines'} && $$grid{'xlines'} =~ /^off/ ? :
747 0 2 defined $$grid{'ylines'} && $$grid{'ylines'} =~ /^off/ ? :
749 0 2 defined $$grid{'zlines'} && $$grid{'zlines'} =~ /^off/ ? :
753 2 0 if defined $$grid{'xlines'} and $$grid{'xlines'} =~ /,\s?on$/ or defined $$self{'minorgrid'} and !defined($$mgrid{'xlines'}) || $$mgrid{'xlines'} eq 'on'
759 1 1 if defined $$grid{'ylines'} and $$grid{'ylines'} =~ /,\s?on$/ or defined $mgrid and !defined($$mgrid{'ylines'}) || $$mgrid{'ylines'} eq 'on'
765 0 2 if defined $$grid{'x2lines'} and $$grid{'x2lines'} eq 'on'
767 0 2 if defined $$grid{'y2lines'} and $$grid{'y2lines'} eq 'on'
771 0 2 if defined $$mgrid{'x2lines'} and $$mgrid{'x2lines'} eq 'on'
773 0 2 if defined $$mgrid{'y2lines'} and $$mgrid{'y2lines'} eq 'on'
777 0 2 if defined $$grid{'layer'}
782 0 2 if (defined $$grid{'linetype'})
785 0 0 if $$grid{'linetype'} =~ /\,/
788 0 2 if defined $$mgrid{'linetype'}
794 2 0 if (defined $$grid{'width'})
797 1 1 if $$grid{'width'} =~ /\,/
800 1 1 if defined $$mgrid{'width'}
806 0 2 if (defined $$grid{'color'})
809 0 0 if $$grid{'color'} =~ /\,/
812 0 2 if defined $$mgrid{'color'}
815 2 0 if $major ne ''
816 2 0 if $minor ne ''
820 1 0 if (defined $grid)
822 0 1 unless $grid =~ /^(on|off)$/
823 0 1 $grid eq 'off' ? :
826 0 1 if defined $mgrid and $mgrid eq 'on'
837 3 1 if ref $grid eq 'HASH'
864 0 2 if defined $$border{'layer'}
865 2 0 if defined $$border{'linetype'}
867 2 0 if defined $$border{'color'}
868 2 0 if defined $$border{'width'}
899 1 0 if (defined $$legend{'position'})
901 0 1 $$legend{'position'} =~ /\d/ ? :
904 1 0 if defined $$legend{'width'}
905 1 0 if defined $$legend{'height'}
906 1 0 if (defined $$legend{'align'})
908 1 0 if $$legend{'align'} eq 'left'
909 0 1 if $$legend{'align'} eq 'right'
911 1 0 if (defined $$legend{'order'})
917 1 0 if (defined $$legend{'title'})
919 0 1 if (ref $$legend{'title'} eq 'HASH') { }
923 0 0 if not defined $$title{'enhanced'} or $$title{'enhanced'} ne 'on'
931 1 0 if (defined $$legend{'sample'})
933 1 0 if defined $$legend{'sample'}{'length'}
935 1 0 if defined $$legend{'sample'}{'position'} or $$legend{'sample'}{'position'} eq 'left'
937 1 0 if defined $$legend{'sample'}{'spacing'}
940 1 0 if (defined $$legend{'border'})
942 0 1 if (ref $$legend{'border'} eq 'HASH') { }
0 1 elsif ($$legend{'border'} eq 'off') { }
1 0 elsif ($$legend{'border'} eq 'on') { }
964 0 0 unless open PLT, ">>$$self{'_script'}"
966 0 0 if defined $$self{'title'}
967 0 0 if defined $nrows
986 1 1 if (ref $ts eq 'HASH') { }
1 0 elsif ($ts ne 'on') { }
988 1 0 if defined $$ts{'fmt'}
989 1 0 if defined $$ts{'offset'}
990 1 0 if defined $$ts{'font'}
1007 0 0 if (defined $$self{'gnuplot'}) { }
1013 0 0 if ($^O =~ /MSWin/)
1016 0 0 unless -e $gnuplotDir
1019 0 0 unless -e $binDir
1022 0 0 unless (-e $gnuplot)
1025 0 0 unless -e $gnuplot
1032 0 0 if $$self{'terminal'} =~ /^(ggi|pm|windows|wxt|x11)(\s|$)/
1038 0 0 if (defined $err and $err ne '')
1041 0 0 if defined $errTmp
1046 0 0 if (defined $$self{'_terminal'} and $$self{'_terminal'} eq 'auto')
1050 0 0 unless $ext =~ /^e?ps$/
1062 0 0 unless open PLT, ">>$$self{'_script'}"
1067 0 0 if ($opt =~ /range$/) { }
0 0 elsif (not grep(/^$opt$/, ('arrow', 'grid', 'label', 'logscale', 'object', 'parametric')) || $opt =~ /tics$/) { }
1101 4 0 if defined $label{'position'}
1102 2 2 if defined $label{'offset'}
1103 0 4 if defined $label{'rotate'}
1104 0 4 if defined $label{'font'}
1105 0 4 if defined $label{'layer'}
1106 0 4 if defined $label{'fontcolor'}
1108 4 0 if not defined $label{'enhanced'} or $label{'enhanced'} ne 'on'
1111 0 1 if (defined $label{'pointtype'} or defined $label{'pointsize'} or defined $label{'pointcolor'})
1115 3 0 if defined $label{'pointtype'}
1117 3 0 if defined $label{'pointsize'}
1118 2 1 if defined $label{'pointcolor'}
1146 0 0 unless defined $arrow{'from'}
1149 0 0 if defined $arrow{'to'}
1150 0 0 if defined $arrow{'rto'}
1151 0 0 if defined $arrow{'layer'}
1152 0 0 if defined $arrow{'linetype'}
1154 0 0 if defined $arrow{'width'}
1155 0 0 if defined $arrow{'color'}
1156 0 0 if defined $arrow{'headsize'}
1159 0 0 if defined $arrow{'head'}
1180 0 0 unless defined $line{'from'}
1183 0 0 if defined $line{'to'}
1184 0 0 if defined $line{'rto'}
1185 0 0 if defined $line{'layer'}
1186 0 0 if defined $line{'linetype'}
1188 0 0 if defined $line{'width'}
1189 0 0 if defined $line{'color'}
1209 0 0 if (ref $head eq 'HASH') { }
1211 0 0 defined $$head{'size'} ? :
1212 0 0 defined $$head{'angle'} ? :
1213 0 0 if $size <= 0
1216 0 0 unless $size =~ /,/
1219 0 0 if (defined $$head{'direction'})
1221 0 0 if ($$head{'direction'} eq 'back') { }
0 0 elsif ($$head{'direction'} eq 'both') { }
0 0 elsif ($$head{'direction'} eq 'off') { }
1237 0 0 if ($head eq 'off') { }
0 0 elsif ($head eq 'back') { }
0 0 elsif ($head eq 'both') { }
1273 0 0 if defined $rect{'index'}
1276 0 0 if (defined $rect{'from'}) { }
0 0 elsif (defined $rect{'width'}) { }
1280 0 0 if (defined $rect{'to'}) { }
0 0 elsif (defined $rect{'rto'}) { }
1295 0 0 if defined $rect{'center'}
1296 0 0 unless defined $rect{'at'}
1297 0 0 unless defined $rect{'width'} and defined $rect{'height'}
1334 0 0 if defined $elli{'center'}
1335 0 0 unless defined $elli{'at'}
1336 0 0 unless defined $elli{'width'} and defined $elli{'height'}
1340 0 0 if defined $elli{'index'}
1342 0 0 if defined $elli{'units'}
1370 0 0 if defined $cir{'center'}
1371 0 0 unless defined $cir{'at'}
1372 0 0 unless defined $cir{'size'}
1375 0 0 if defined $cir{'index'}
1378 0 0 if (defined $cir{'arc'})
1381 0 0 ref $cir{'arc'} eq 'ARRAY' ? :
1406 0 0 unless defined $poly{'vertices'}
1409 0 0 if scalar @$v < 0.5
1412 0 0 if defined $poly{'index'}
1418 0 0 if (ref $$v[$i] eq 'HASH') { }
1443 0 0 if defined $$obj{'layer'}
1444 0 0 if defined $$obj{'linewidth'}
1447 0 0 if (defined $$obj{'fill'}) { }
0 0 elsif (defined $$obj{'border'}) { }
1450 0 0 if defined $$fill{'color'}
1454 0 0 if (defined $$obj{'border'})
1456 0 0 if (ref $$obj{'border'} eq 'HASH') { }
0 0 elsif ($$obj{'border'} =~ /^(off|no)$/) { }
1459 0 0 if defined $$obj{'border'}{'color'}
1470 0 0 if (ref $$obj{'border'} eq 'HASH') { }
0 0 elsif ($$obj{'border'} =~ /^(off|no)$/) { }
1473 0 0 if defined $$obj{'border'}{'color'}
1495 0 0 unless open PLT, ">$pltTmp"
1503 0 0 if defined $$self{'gnuplot'}
1507 0 0 if (defined $$self{'_terminal'} and $$self{'_terminal'} eq 'auto')
1511 0 0 unless $ext =~ /^e?ps$/
1531 0 0 if (defined $$self{'_terminal'} and $$self{'_terminal'} eq 'auto') { }
0 0 elsif (not $$self{'terminal'} =~ /^gif/) { }
1540 0 0 if defined $animate{'delay'}
1544 0 0 unless open PLT, ">>$$self{'_script'}"
1553 0 0 if (defined $$chart{'_dataSets2D'}) { }
0 0 elsif (defined $$chart{'_dataSets3D'}) { }
1565 0 0 unless open PLT, ">>$$self{'_script'}"
1590 0 0 unless -e $$self{'output'}
1598 0 0 if defined $$self{'convert'}
1601 0 0 if (defined $$self{'orient'} and $$self{'orient'} eq 'portrait') { }
1605 0 0 if (defined $err and $err ne '')
1607 0 0 if $err =~ /^convert: unable to open module file/
1611 0 0 if defined $errTmp
1620 0 0 if (defined $err and $err ne '')
1622 0 0 if $err =~ /^convert: unable to open module file/
1626 0 0 if defined $errTmp
1718 0 4 $^O =~ /MSWin/ ? :
1721 1 1 unless defined $num
1739 0 31 $^O =~ /MSWin/ ? :
1753 0 4 if $attr eq 'DESTROY'
1754 4 0 if defined $key
1763 0 0 unless defined $xdata
1776 0 1 unless defined $ydata
1789 0 0 unless defined $zdata
1802 0 0 unless defined $points
1817 0 0 unless defined $datafile
1832 0 1 unless defined $func
1852 0 4 $^O =~ /MSWin/ ? :
1855 1 1 unless defined $num
1875 15 18 if (defined $$self{'ydata'}) { }
5 13 elsif (defined $$self{'points'}) { }
1 12 elsif (defined $$self{'datafile'}) { }
12 0 elsif (defined $$self{'func'}) { }
1882 2 13 if (defined $$self{'zdata'}) { }
1 12 elsif (defined $$self{'xdata'} and defined $$self{'style'} and $$self{'style'} =~ /^(financebars|candlesticks)$/) { }
3 9 elsif (defined $$self{'xdata'} and defined $$self{'style'} and $$self{'style'} =~ /error/) { }
1 8 elsif (defined $$self{'xdata'} and defined $$self{'style'} and $$self{'style'} eq 'hbars') { }
1 7 elsif (defined $$self{'xdata'} and defined $$self{'style'} and $$self{'style'} eq 'hlines') { }
1 6 elsif (defined $$self{'xdata'} and defined $$self{'style'} and $$self{'style'} eq 'histograms') { }
2 4 elsif (defined $$self{'xdata'}) { }
1884 1 1 ref $$self{'xdata'}[0] eq 'ARRAY' ? :
1901 1 2 if ($$self{'style'} =~ /^xerror/) { }
1 1 elsif ($$self{'style'} =~ /^(y|box)error/) { }
1 0 elsif ($$self{'style'} =~ /^(box)?xyerror/) { }
1946 1 3 if (defined $$self{'style'} and $$self{'style'} =~ /^(financebars|candlesticks)$/) { }
1 2 elsif (defined $$self{'style'} and $$self{'style'} =~ /^yerror/) { }
1962 0 4 if defined $$self{'timefmt'}
1973 1 4 if (defined $$self{'style'} and $$self{'style'} eq 'hlines') { }
1 3 elsif (defined $$self{'style'} and $$self{'style'} eq 'hbars') { }
1 2 elsif (defined $$self{'style'} and $$self{'style'} eq 'histograms') { }
1 1 elsif (ref $$pt[0][0] eq 'ARRAY') { }
2001 0 1 if defined $$self{'every'}
2002 0 1 if defined $$self{'index'}
2008 2 10 if (ref $$self{'func'} eq 'HASH') { }
2010 1 1 if (defined ${$$self{'func'};}{'z'}) { }
2031 0 33 if defined $$self{'using'}
2032 2 31 if $using ne ''
2035 5 28 defined $$self{'title'} ? :
2039 1 32 if defined $$self{'smooth'}
2040 1 32 if defined $$self{'axes'}
2041 17 16 if defined $$self{'style'}
2042 1 32 if defined $$self{'linetype'}
2044 1 32 if defined $$self{'color'}
2045 1 32 if defined $$self{'width'}
2046 1 32 if defined $$self{'pointtype'}
2048 1 32 if defined $$self{'pointsize'}
2051 0 33 if (defined $$self{'fill'})
2056 0 0 if (defined $$self{'border'})
2058 0 0 if (ref $$self{'border'} eq 'HASH') { }
0 0 elsif ($$self{'border'} =~ /^(off|no)$/) { }
2061 0 0 if defined $$self{'border'}{'color'}
2082 0 2 unless open DATA, ">$fileTmp"
2099 0 1 unless open DATA, ">$fileTmp"
2121 0 1 unless open DATA, ">$fileTmp"
2138 0 2 if scalar @$ydata != scalar @$xdata
2143 0 2 unless open DATA, ">$fileTmp"
2152 0 2 if (defined $$ds{'timefmt'})
2170 0 1 if scalar @{$$xdata[0];} != scalar @$ydata
2174 0 1 unless open DATA, ">$fileTmp"
2188 0 1 if (defined $$ds{'timefmt'})
2190 0 0 ref $$xdata[0] eq 'ARRAY' ? :
2208 0 1 if scalar @{$$ydata[0];} != scalar @$xdata
2212 0 1 unless open DATA, ">$fileTmp"
2226 0 1 if (defined $$ds{'timefmt'})
2228 0 0 ref $$xdata[0] eq 'ARRAY' ? :
2248 0 1 unless open DATA, ">$fileTmp"
2249 1 0 if (scalar @$xdata == scalar @$ydata) { }
2266 0 0 if (scalar @$xdata == 2) { }
2286 0 1 if (defined $$ds{'timefmt'})
2288 0 0 ref $$xdata[0] eq 'ARRAY' ? :
2306 0 1 if scalar @{$$ydata[0];} != scalar @$xdata
2310 0 1 unless open DATA, ">$fileTmp"
2320 0 1 if (defined $$ds{'timefmt'})
2339 0 1 unless open DATA, ">$fileTmp"
2373 1 0 if (scalar @sortY > 1)
2381 0 1 unless open DATA, ">$fileTmp"
2384 4 1 if $i > 0
2385 4 1 $i < $#sortY ? :
2401 0 1 if scalar @$ydata != scalar @$xdata
2407 0 1 unless open DATA, ">$fileTmp"
2408 0 1 if (ref $$ydata[0] eq 'ARRAY') { }
2438 0 1 if scalar @$ydata != scalar @$xdata
2440 0 1 if scalar @$ydata != scalar @$zdata
2445 0 1 unless open DATA, ">$fileTmp"
2454 0 1 if (defined $$ds{'timefmt'})
2476 0 1 if scalar @$ydata != scalar @$xdata
2478 0 1 if scalar @$ydata != scalar @$zdata
2483 0 1 unless open DATA, ">$fileTmp"
2496 0 1 if (defined $$ds{'timefmt'})
2518 0 1 unless open DATA, ">$fileTmp"
2527 0 1 if (defined $$ds{'timefmt'})
2546 0 1 if defined $$ds{'timefmt'}
2552 0 1 unless open DATA, ">$fileTmp"
2569 0 1 if defined $$ds{'timefmt'}
2590 1 0 if (scalar @sortY > 1)
2598 0 1 unless open DATA, ">$fileTmp"
2601 4 1 if $i > 0
2602 4 1 $i < $#sortY ? :
2622 0 1 unless open DATA, ">$fileTmp"
2644 0 1 unless open DATA, ">$fileTmp"
2657 0 1 if (defined $$ds{'timefmt'})
2694 0 0 defined $$self{'style'} ? :
2705 0 0 if ($paraRef eq 'HASH') { }
0 0 elsif ($paraRef eq 'ARRAY') { }
2711 0 0 unless open PARA, ">$parFile"
2715 0 0 defined ${$hash{'params'};}{$pTmp} ? :
2739 0 0 unless (defined $hash{'using'})
2743 0 0 if (ref $$self{'ydata'}[0] eq 'ARRAY')
2750 0 0 unless -e $data
2754 0 0 unless open FIT, ">$script"
2767 0 0 unless open RES, $result