Branch Coverage

blib/lib/Chart/Gnuplot.pm
Criterion Covered Total %
branch 325 740 43.9


line true false branch
16 35 0 unless (defined $hash{'_multiplot'})
19 0 35 $^O =~ /MSWin/ ? :
24 35 0 unless (defined $hash{'terminal'} or defined $hash{'term'})
31 35 0 if (defined $hash{'output'})
35 0 35 if $hash{'terminal'} =~ /^post/ and $ext eq 'eps'
50 0 46 if $attr eq 'DESTROY'
51 46 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 35 if defined $$self{'orient'}
258 3 34 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 37 if defined $$self{'_multiplot'}
283 0 37 unless open PLT, ">>$pltTmp"
289 0 37 if (defined $$self{'encoding'})
295 2 35 if (defined $$self{'bg'})
298 2 0 if (ref $bg eq 'HASH') { }
302 2 0 if defined $$bg{'density'}
315 2 35 if (defined $$self{'plotbg'})
318 2 0 if (ref $bg eq 'HASH') { }
322 2 0 if defined $$bg{'density'}
341 2 35 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 37 167 if ($attr eq 'output') { }
8 159 elsif ($attr eq 'title') { }
6 153 elsif ($attr =~ /^((x|y)2?|z)label$/) { }
7 146 elsif ($attr =~ /^((x|y)2?|z|t|u|v)range$/) { }
7 139 elsif ($attr =~ /^(x|y|x2|y2|z)tics$/) { }
1 138 elsif ($attr eq 'legend') { }
2 136 elsif ($attr eq 'border') { }
4 132 elsif ($attr =~ /^(minor)?grid$/) { }
2 130 elsif ($attr eq 'timestamp') { }
37 93 elsif ($attr eq 'terminal') { }
5 88 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 7 0 if (defined $$self{$attr}) { }
423 4 3 if (ref $$self{$attr} eq 'HASH')
425 2 2 if (defined ${$$self{$attr};}{'labelfmt'})
431 1 3 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'}
648 4 3 if (ref $tic eq 'HASH') { }
1 2 elsif (ref $tic eq 'ARRAY') { }
0 2 elsif ($tic ne 'on') { }
650 0 4 if defined $$tic{'along'}
651 1 3 if defined $$tic{'mirror'} and $$tic{'mirror'} eq 'off'
654 1 3 if defined $$tic{'length'}
655 1 3 if defined $$tic{'rotate'}
656 0 4 if defined $$tic{'offset'}
657 1 3 if defined $$tic{'labels'}
661 1 3 if (defined $$tic{'font'})
664 0 1 if not $font =~ /\,/ and defined $$tic{'fontsize'}
668 1 3 if defined $$tic{'fontcolor'}
718 1 2 if defined $$self{'minorgrid'}
721 2 1 if (ref $grid eq 'HASH' or ref $mgrid eq 'HASH') { }
727 0 2 defined $$grid{'xlines'} && $$grid{'xlines'} =~ /^off/ ? :
729 0 2 defined $$grid{'ylines'} && $$grid{'ylines'} =~ /^off/ ? :
731 0 2 defined $$grid{'zlines'} && $$grid{'zlines'} =~ /^off/ ? :
735 2 0 if defined $$grid{'xlines'} and $$grid{'xlines'} =~ /,\s?on$/ or defined $$self{'minorgrid'} and !defined($$mgrid{'xlines'}) || $$mgrid{'xlines'} eq 'on'
741 1 1 if defined $$grid{'ylines'} and $$grid{'ylines'} =~ /,\s?on$/ or defined $mgrid and !defined($$mgrid{'ylines'}) || $$mgrid{'ylines'} eq 'on'
747 0 2 if defined $$grid{'x2lines'} and $$grid{'x2lines'} eq 'on'
749 0 2 if defined $$grid{'y2lines'} and $$grid{'y2lines'} eq 'on'
753 0 2 if defined $$mgrid{'x2lines'} and $$mgrid{'x2lines'} eq 'on'
755 0 2 if defined $$mgrid{'y2lines'} and $$mgrid{'y2lines'} eq 'on'
761 0 2 if (defined $$grid{'linetype'})
764 0 0 if $$grid{'linetype'} =~ /\,/
767 0 2 if defined $$mgrid{'linetype'}
773 2 0 if (defined $$grid{'width'})
776 1 1 if $$grid{'width'} =~ /\,/
779 1 1 if defined $$mgrid{'width'}
785 0 2 if (defined $$grid{'color'})
788 0 0 if $$grid{'color'} =~ /\,/
791 0 2 if defined $$mgrid{'color'}
794 2 0 if $major ne ''
795 2 0 if $minor ne ''
799 1 0 if (defined $grid)
801 0 1 unless $grid =~ /^(on|off)$/
802 0 1 $grid eq 'off' ? :
805 0 1 if defined $mgrid and $mgrid eq 'on'
816 3 1 if ref $grid eq 'HASH'
845 2 0 if defined $$border{'linetype'}
847 2 0 if defined $$border{'color'}
848 2 0 if defined $$border{'width'}
879 1 0 if (defined $$legend{'position'})
881 0 1 $$legend{'position'} =~ /\d/ ? :
884 1 0 if defined $$legend{'width'}
885 1 0 if defined $$legend{'height'}
886 1 0 if (defined $$legend{'align'})
888 1 0 if $$legend{'align'} eq 'left'
889 0 1 if $$legend{'align'} eq 'right'
891 1 0 if (defined $$legend{'order'})
897 1 0 if (defined $$legend{'title'})
899 0 1 if (ref $$legend{'title'} eq 'HASH') { }
903 0 0 if not defined $$title{'enhanced'} or $$title{'enhanced'} ne 'on'
911 1 0 if (defined $$legend{'sample'})
913 1 0 if defined $$legend{'sample'}{'length'}
915 1 0 if defined $$legend{'sample'}{'position'} or $$legend{'sample'}{'position'} eq 'left'
917 1 0 if defined $$legend{'sample'}{'spacing'}
920 1 0 if (defined $$legend{'border'})
922 0 1 if (ref $$legend{'border'} eq 'HASH') { }
0 1 elsif ($$legend{'border'} eq 'off') { }
1 0 elsif ($$legend{'border'} eq 'on') { }
944 0 0 unless open PLT, ">>$$self{'_script'}"
946 0 0 if defined $$self{'title'}
947 0 0 if defined $nrows
966 1 1 if (ref $ts eq 'HASH') { }
1 0 elsif ($ts ne 'on') { }
968 1 0 if defined $$ts{'fmt'}
969 1 0 if defined $$ts{'offset'}
970 1 0 if defined $$ts{'font'}
987 0 0 if (defined $$self{'gnuplot'}) { }
993 0 0 if ($^O =~ /MSWin/)
996 0 0 unless -e $gnuplotDir
999 0 0 unless -e $binDir
1002 0 0 unless (-e $gnuplot)
1005 0 0 unless -e $gnuplot
1012 0 0 if $$self{'terminal'} =~ /^(ggi|pm|windows|wxt|x11)(\s|$)/
1018 0 0 if (defined $err and $err ne '')
1021 0 0 if defined $errTmp
1026 0 0 if (defined $$self{'_terminal'} and $$self{'_terminal'} eq 'auto')
1030 0 0 unless $ext =~ /^e?ps$/
1042 0 0 unless open PLT, ">>$$self{'_script'}"
1047 0 0 if ($opt =~ /range$/) { }
0 0 elsif (not grep(/^$opt$/, ('arrow', 'grid', 'label', 'logscale', 'object', 'parametric')) || $opt =~ /tics$/) { }
1083 4 0 if defined $label{'position'}
1084 2 2 if defined $label{'offset'}
1085 0 4 if defined $label{'rotate'}
1086 0 4 if defined $label{'font'}
1087 0 4 if defined $label{'fontcolor'}
1089 4 0 if not defined $label{'enhanced'} or $label{'enhanced'} ne 'on'
1092 0 1 if (defined $label{'pointtype'} or defined $label{'pointsize'} or defined $label{'pointcolor'})
1096 3 0 if defined $label{'pointtype'}
1098 3 0 if defined $label{'pointsize'}
1099 2 1 if defined $label{'pointcolor'}
1129 0 0 unless defined $arrow{'from'}
1132 0 0 if defined $arrow{'to'}
1133 0 0 if defined $arrow{'rto'}
1134 0 0 if defined $arrow{'linetype'}
1136 0 0 if defined $arrow{'width'}
1137 0 0 if defined $arrow{'color'}
1138 0 0 if defined $arrow{'headsize'}
1141 0 0 if defined $arrow{'head'}
1164 0 0 unless defined $line{'from'}
1167 0 0 if defined $line{'to'}
1168 0 0 if defined $line{'rto'}
1169 0 0 if defined $line{'linetype'}
1171 0 0 if defined $line{'width'}
1172 0 0 if defined $line{'color'}
1192 0 0 if (ref $head eq 'HASH') { }
1194 0 0 defined $$head{'size'} ? :
1195 0 0 defined $$head{'angle'} ? :
1196 0 0 if $size <= 0
1199 0 0 unless $size =~ /,/
1202 0 0 if (defined $$head{'direction'})
1204 0 0 if ($$head{'direction'} eq 'back') { }
0 0 elsif ($$head{'direction'} eq 'both') { }
0 0 elsif ($$head{'direction'} eq 'off') { }
1220 0 0 if ($head eq 'off') { }
0 0 elsif ($head eq 'back') { }
0 0 elsif ($head eq 'both') { }
1256 0 0 if defined $rect{'index'}
1259 0 0 if (defined $rect{'from'}) { }
0 0 elsif (defined $rect{'width'}) { }
1263 0 0 if (defined $rect{'to'}) { }
0 0 elsif (defined $rect{'rto'}) { }
1278 0 0 if defined $rect{'center'}
1279 0 0 unless defined $rect{'at'}
1280 0 0 unless defined $rect{'width'} and defined $rect{'height'}
1317 0 0 if defined $elli{'center'}
1318 0 0 unless defined $elli{'at'}
1319 0 0 unless defined $elli{'width'} and defined $elli{'height'}
1323 0 0 if defined $elli{'index'}
1325 0 0 if defined $elli{'units'}
1353 0 0 if defined $cir{'center'}
1354 0 0 unless defined $cir{'at'}
1355 0 0 unless defined $cir{'size'}
1358 0 0 if defined $cir{'index'}
1361 0 0 if (defined $cir{'arc'})
1364 0 0 ref $cir{'arc'} eq 'ARRAY' ? :
1389 0 0 unless defined $poly{'vertices'}
1392 0 0 if scalar @$v < 0.5
1395 0 0 if defined $poly{'index'}
1401 0 0 if (ref $$v[$i] eq 'HASH') { }
1426 0 0 if defined $$obj{'layer'}
1427 0 0 if defined $$obj{'linewidth'}
1430 0 0 if (defined $$obj{'fill'}) { }
0 0 elsif (defined $$obj{'border'}) { }
1433 0 0 if defined $$fill{'color'}
1437 0 0 if (defined $$obj{'border'})
1439 0 0 if (ref $$obj{'border'} eq 'HASH') { }
0 0 elsif ($$obj{'border'} =~ /^(off|no)$/) { }
1442 0 0 if defined $$obj{'border'}{'color'}
1453 0 0 if (ref $$obj{'border'} eq 'HASH') { }
0 0 elsif ($$obj{'border'} =~ /^(off|no)$/) { }
1456 0 0 if defined $$obj{'border'}{'color'}
1478 0 0 unless open PLT, ">$pltTmp"
1486 0 0 if defined $$self{'gnuplot'}
1490 0 0 if (defined $$self{'_terminal'} and $$self{'_terminal'} eq 'auto')
1494 0 0 unless $ext =~ /^e?ps$/
1514 0 0 if (defined $$self{'_terminal'} and $$self{'_terminal'} eq 'auto') { }
0 0 elsif (not $$self{'terminal'} =~ /^gif/) { }
1523 0 0 if defined $animate{'delay'}
1527 0 0 unless open PLT, ">>$$self{'_script'}"
1536 0 0 if (defined $$chart{'_dataSets2D'}) { }
0 0 elsif (defined $$chart{'_dataSets3D'}) { }
1548 0 0 unless open PLT, ">>$$self{'_script'}"
1573 0 0 unless -e $$self{'output'}
1581 0 0 if defined $$self{'convert'}
1584 0 0 if (defined $$self{'orient'} and $$self{'orient'} eq 'portrait') { }
1588 0 0 if (defined $err and $err ne '')
1590 0 0 if $err =~ /^convert: unable to open module file/
1594 0 0 if defined $errTmp
1603 0 0 if (defined $err and $err ne '')
1605 0 0 if $err =~ /^convert: unable to open module file/
1609 0 0 if defined $errTmp
1701 0 4 $^O =~ /MSWin/ ? :
1704 1 1 unless defined $num
1722 0 31 $^O =~ /MSWin/ ? :
1736 0 4 if $attr eq 'DESTROY'
1737 4 0 if defined $key
1746 0 0 unless defined $xdata
1759 0 1 unless defined $ydata
1772 0 0 unless defined $zdata
1785 0 0 unless defined $points
1800 0 0 unless defined $datafile
1815 0 1 unless defined $func
1835 0 4 $^O =~ /MSWin/ ? :
1838 1 1 unless defined $num
1858 15 18 if (defined $$self{'ydata'}) { }
5 13 elsif (defined $$self{'points'}) { }
1 12 elsif (defined $$self{'datafile'}) { }
12 0 elsif (defined $$self{'func'}) { }
1865 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'}) { }
1867 1 1 ref $$self{'xdata'}[0] eq 'ARRAY' ? :
1884 1 2 if ($$self{'style'} =~ /^xerror/) { }
1 1 elsif ($$self{'style'} =~ /^(y|box)error/) { }
1 0 elsif ($$self{'style'} =~ /^(box)?xyerror/) { }
1929 1 3 if (defined $$self{'style'} and $$self{'style'} =~ /^(financebars|candlesticks)$/) { }
1 2 elsif (defined $$self{'style'} and $$self{'style'} =~ /^yerror/) { }
1945 0 4 if defined $$self{'timefmt'}
1956 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') { }
1984 0 1 if defined $$self{'every'}
1985 0 1 if defined $$self{'index'}
1991 2 10 if (ref $$self{'func'} eq 'HASH') { }
1993 1 1 if (defined ${$$self{'func'};}{'z'}) { }
2014 0 33 if defined $$self{'using'}
2015 2 31 if $using ne ''
2018 5 28 defined $$self{'title'} ? :
2022 1 32 if defined $$self{'smooth'}
2023 1 32 if defined $$self{'axes'}
2024 17 16 if defined $$self{'style'}
2025 1 32 if defined $$self{'linetype'}
2027 1 32 if defined $$self{'color'}
2028 1 32 if defined $$self{'width'}
2029 1 32 if defined $$self{'pointtype'}
2031 1 32 if defined $$self{'pointsize'}
2034 0 33 if (defined $$self{'fill'})
2039 0 0 if (defined $$self{'border'})
2041 0 0 if (ref $$self{'border'} eq 'HASH') { }
0 0 elsif ($$self{'border'} =~ /^(off|no)$/) { }
2044 0 0 if defined $$self{'border'}{'color'}
2065 0 2 unless open DATA, ">$fileTmp"
2082 0 1 unless open DATA, ">$fileTmp"
2104 0 1 unless open DATA, ">$fileTmp"
2121 0 2 if scalar @$ydata != scalar @$xdata
2126 0 2 unless open DATA, ">$fileTmp"
2135 0 2 if (defined $$ds{'timefmt'})
2153 0 1 if scalar @{$$xdata[0];} != scalar @$ydata
2157 0 1 unless open DATA, ">$fileTmp"
2171 0 1 if (defined $$ds{'timefmt'})
2173 0 0 ref $$xdata[0] eq 'ARRAY' ? :
2191 0 1 if scalar @{$$ydata[0];} != scalar @$xdata
2195 0 1 unless open DATA, ">$fileTmp"
2209 0 1 if (defined $$ds{'timefmt'})
2211 0 0 ref $$xdata[0] eq 'ARRAY' ? :
2231 0 1 unless open DATA, ">$fileTmp"
2232 1 0 if (scalar @$xdata == scalar @$ydata) { }
2249 0 0 if (scalar @$xdata == 2) { }
2269 0 1 if (defined $$ds{'timefmt'})
2271 0 0 ref $$xdata[0] eq 'ARRAY' ? :
2289 0 1 if scalar @{$$ydata[0];} != scalar @$xdata
2293 0 1 unless open DATA, ">$fileTmp"
2303 0 1 if (defined $$ds{'timefmt'})
2322 0 1 unless open DATA, ">$fileTmp"
2356 1 0 if (scalar @sortY > 1)
2364 0 1 unless open DATA, ">$fileTmp"
2367 4 1 if $i > 0
2368 4 1 $i < $#sortY ? :
2384 0 1 if scalar @$ydata != scalar @$xdata
2390 0 1 unless open DATA, ">$fileTmp"
2391 0 1 if (ref $$ydata[0] eq 'ARRAY') { }
2421 0 1 if scalar @$ydata != scalar @$xdata
2423 0 1 if scalar @$ydata != scalar @$zdata
2428 0 1 unless open DATA, ">$fileTmp"
2437 0 1 if (defined $$ds{'timefmt'})
2459 0 1 if scalar @$ydata != scalar @$xdata
2461 0 1 if scalar @$ydata != scalar @$zdata
2466 0 1 unless open DATA, ">$fileTmp"
2479 0 1 if (defined $$ds{'timefmt'})
2501 0 1 unless open DATA, ">$fileTmp"
2510 0 1 if (defined $$ds{'timefmt'})
2529 0 1 if defined $$ds{'timefmt'}
2535 0 1 unless open DATA, ">$fileTmp"
2552 0 1 if defined $$ds{'timefmt'}
2573 1 0 if (scalar @sortY > 1)
2581 0 1 unless open DATA, ">$fileTmp"
2584 4 1 if $i > 0
2585 4 1 $i < $#sortY ? :
2605 0 1 unless open DATA, ">$fileTmp"
2627 0 1 unless open DATA, ">$fileTmp"
2640 0 1 if (defined $$ds{'timefmt'})
2677 0 0 defined $$self{'style'} ? :
2688 0 0 if ($paraRef eq 'HASH') { }
0 0 elsif ($paraRef eq 'ARRAY') { }
2694 0 0 unless open PARA, ">$parFile"
2698 0 0 defined ${$hash{'params'};}{$pTmp} ? :
2722 0 0 unless (defined $hash{'using'})
2726 0 0 if (ref $$self{'ydata'}[0] eq 'ARRAY')
2733 0 0 unless -e $data
2737 0 0 unless open FIT, ">$script"
2750 0 0 unless open RES, $result