Branch Coverage

lib/Graph/Easy/As_svg.pm
Criterion Covered Total %
branch 294 458 64.1


line true false branch
122 104 404 unless defined $x
134 74 114 wantarray ? :
281 0 79 if $ts->{'italic'}
282 12 67 if $ts->{'bold'}
284 0 67 if ($ts->{'underline'} or $ts->{'none'} or $ts->{'overline'} or $ts->{'line-through'})
290 23 25 if $ts->{$k}
293 12 0 if $s
301 79 0 if $ff
306 62 17 if $fs eq '16'
311 17 62 if $fs
313 79 0 if @styles > 0
340 1 80 if (@$lines > 1) { }
354 2 0 if $all eq substr($align, 0, 1)
356 0 2 if $all eq 'l'
357 0 2 if $all eq 'r'
358 1 1 if $i < @$lines - 1
367 79 1 if @$lines
370 79 2 if $label ne ''
371 2 79 unless defined $fs
375 15 66 if ref($self) =~ /Edge/
377 66 15 unless (defined $style)
379 3 63 if $align eq 'left'
380 0 66 if $align eq 'right'
397 0 0 if $val eq 'center'
409 0 0 if $val =~ /^\d+\z/
411 0 0 if ($val =~ /em\z/)
431 0 128 if ($s =~ /(\d+)em/)
438 128 0 if $s eq '1'
440 52 76 unless exists $att->{'stroke-dasharray'}
443 76 0 if $s < 2
462 26 3 unless defined $self->{'score'}
468 1 28 if ($options->{'standalone'})
497 29 0 if $title ne ''
566 29 0 if $style ne ''
582 9 20 if ($label ne '')
587 0 9 if ($mx < $lw + $em)
605 29 0 if $bg eq 'inherit'
607 29 0 if $bs eq 'none'
624 29 0 unless $att->{'stroke-dasharray'} ne ''
631 29 0 if ($bs ne '')
654 9 20 if ($label ne '')
656 0 9 if $lp eq 'bottom'
668 0 9 if $link ne ''
673 9 0 if $lp eq 'top'
681 57 33 if (ref $n eq 'Graph::Easy::Node' or ref $n eq 'Graph::Easy::Node::Anon')
691 89 1 if ($obj_txt ne '')
695 88 1 if $id eq ''
714 1 28 if $options->{'standalone'}
754 3 52 if $self->{'has_label'}
773 0 58 if $bg eq ''
776 58 0 if ($bg ne '')
778 58 0 if $bg eq 'inherit'
779 0 58 if $bg eq 'inherit'
780 58 0 if ($bg ne '')
808 0 67 if $class =~ /^(\s+|gi)\z/
865 0 37 if $cell->{'type'} == 11
874 0 30 if $done_cells == 0
919 132 2 if $line_length > $w
932 37 17 if (ref $self->{'edge'})
935 0 37 if $bg eq '' and ref $self->{'edge'}{'group'}
940 8 46 if ($bg ne 'inherit' and $bg ne '')
963 54 6 unless defined $name
964 1 59 if $self->{'class'} eq 'node.anon'
975 1 59 if $shape eq 'invisible'
979 1 58 if $title ne ''
982 56 3 unless $self->isa_cell
985 0 59 if $link ne ''
992 20 39 if $s ne 'rect'
1000 2 57 if ($shape eq 'point') { }
0 57 elsif ($shape eq 'img') { }
1005 2 0 if ($s ne 'invisible') { }
1007 1 1 if $bs =~ /^double/ and $s =~ /^(square|diamond|circle|star)\z/
1020 0 2 if ($s eq 'dot' or $ps eq 'filled')
1028 0 2 if $s =~ /square/
1029 0 2 if $s =~ /square/
1045 0 0 if ($info->{'error'})
1059 54 3 if ($shape ne 'none' and not $self->isa('Graph::Easy::Group::Cell'))
1066 0 54 if ($bs =~ /^double/)
1070 0 0 if exists $att->{$a}
1079 0 54 if ($bs =~ /^double/)
1111 0 57 if $s =~ /^(triangle|trapezium)\z/
1112 0 57 if $s =~ /^inv(triangle|trapezium)\z/
1113 0 57 if $s eq 'house'
1114 0 57 if $s eq 'invhouse'
1124 0 59 if $link ne ''
1137 0 1 if $title ne ''
1174 1 59 if ($self->attribute('border-style') || '') eq 'double'
1184 2 58 if ($shape =~ /^(point|none)\z/) { }
1 57 elsif ($shape eq 'circle') { }
0 57 elsif ($shape eq 'parallelogram') { }
0 57 elsif ($shape eq 'trapezium') { }
0 57 elsif ($shape eq 'invtrapezium') { }
1 56 elsif ($shape eq 'diamond') { }
0 56 elsif ($shape eq 'house') { }
0 56 elsif ($shape eq 'pentagon') { }
0 56 elsif ($shape eq 'invhouse') { }
0 56 elsif ($shape eq 'septagon') { }
0 56 elsif ($shape eq 'octagon') { }
0 56 elsif ($shape eq 'hexagon') { }
0 56 elsif ($shape eq 'triangle') { }
0 56 elsif ($shape eq 'invtriangle') { }
0 56 elsif ($shape eq 'ellipse') { }
1191 0 1 $self->{'minw'} > $self->{'minh'} ? :
1333 13 43 if ($shape eq 'rounded')
1350 1 59 if $border_width ne '1'
1353 4 56 unless ($border_style =~ /^(none|solid)/)
1356 3 1 if exists $strokes->{$border_style}
1360 1 59 if ($border_style eq 'none')
1384 93 606 if $e =~ /^(arrow-?style|arrow-?shape|text-?style|label-?color| rows|columns|size|offset|origin|rotate|colorscheme)\z/x
1389 40 566 if (length $att_line > 75)
1400 6 207 if $r != 0
1401 3 210 if (length $att_line > 75)
1418 4 108 if defined $self->{'w'}
1421 2 106 if ($shape eq 'point')
1436 106 0 if $shape ne 'none'
1438 105 1 if ($border ne 'none')
1446 0 106 if $shape =~ /triangle/
1447 0 106 if $shape =~ /triangle|trapezium/
1448 0 106 if $shape =~ /(parallelogram|trapezium|pentagon)/
1450 2 104 if ($shape =~ /^(diamond|circle|octagon|hexagon|triangle)\z/)
1453 1 1 if $self->{'h'} > $max
1567 0 33 if (exists $arrow_pos->{$cell_type})
1572 0 0 if $dx < 0
1573 0 0 if $dy < 0
1591 0 33 if $arrow_style eq 'none'
1595 32 1 if $class eq 'aho'
1597 0 33 if $s > 1 and $class eq 'ah'
1608 45 30 if $key =~ /^(stroke-dasharray|arrow-style|stroke-width)\z/
1610 30 0 unless exists $DEF->{$key} and $DEF->{$key} eq $att->{$key}
1612 0 33 if ($arrow_style eq 'closed') { }
1 32 elsif ($arrow_style eq 'filled') { }
0 32 elsif ($class eq 'ahb') { }
1615 0 0 if $a->{'fill'} eq 'inherit'
1616 0 0 if $a->{'fill'} eq 'inherit'
1622 0 1 if (defined $fill) { }
1633 0 0 unless $a->{'fill'}
1638 30 3 if ref $self->{'graph'}
1645 0 33 if $ss > 1
1652 1 32 if ($type & 32)
1654 0 1 if $ss > 1
1 0 if $d < 1
1658 3 30 if ($type & 128)
1660 0 3 if $ss > 1
3 0 if $d < 1
1665 0 33 if ($type & 16)
1667 0 0 if $ss > 1
0 0 if $d < 1
1672 29 4 if ($type & 64)
1674 0 29 if $ss > 1
29 0 if $d < 1
1678 0 29 if $scale
1698 41 0 unless defined $add
1705 34 7 if ($ltype == 0) { }
1707 29 5 if $s
1708 28 6 if $e
1710 0 34 if $l == 0.5
1711 1 33 if $r == 0.5
1712 5 29 if $l < 1
1713 5 29 if $r < 1
1717 15 19 if (($type & 16) != 0)
1721 15 0 if $s
15 0 if $e
1727 1 6 if $s
1728 2 5 if $e
1730 1 6 if $l == 0.5
1731 0 7 if $r == 0.5
1732 5 2 if $l < 1
1733 5 2 if $r < 1
1737 0 7 if (($type & 16) != 0)
1741 0 0 if $s
0 0 if $e
1751 15 26 if defined $x3
1770 0 0 unless defined $add
1778 0 0 if $xa < 0
1779 0 0 if $ya < 0
1796 2 35 if defined $self->{'w'}
1810 28 7 if ($self->{'type'} & 4096)
1815 2 26 if $type == 2
1817 26 2 if $type == 1
1822 26 2 if $type == 1
1840 56 224 if ($a != 0)
1847 0 56 if $style =~ /^wide/
1874 15 22 if ($style ne 'solid')
1877 15 0 if exists $strokes->{$style}
1880 0 37 if $style =~ /^bold/
1881 0 37 if $style =~ /^broad/
1882 0 37 if $style =~ /^wide/
1906 0 37 if $title ne ''
1921 0 37 if $style eq 'invisible'
1937 38 0 if ($type != 2) { }
1951 0 38 if ($cross and $type == 1)
1955 0 0 if $style =~ /^bold/
1956 0 0 if $style =~ /^broad/
1957 0 0 if $style =~ /^wide/
1960 0 0 if $self->{'color_ver'}
1962 0 0 if $sn ne $sw
1972 5 33 if ($type == 1) { }
1974 2 3 if $end & 128
1975 0 5 if $end & 32
1976 0 5 if $start & 512
1977 1 4 if $start & 2048
1981 28 5 if $end & 64
1982 0 33 if $end & 16
1983 0 33 if $start & 256
1984 29 4 if $start & 1024
1987 38 0 if ($type != 2) { }
1989 15 23 if $style =~ /^double/
2004 16 21 if (@line_tags > 1) { }
2023 30 7 unless $arrow == 0 or $self->{'edge'}->undirected
2028 30 7 if ($self->{'type'} & 4096)
2030 0 30 unless defined $label
2032 15 15 if ($label ne '')
2045 14 1 if ($type == 1) { }
1 0 elsif ($type == 2) { }
2054 14 0 if ($ac == 1)
2057 0 14 if $style =~ /^broad/
2058 0 14 if $style =~ /^wide/
2060 14 0 if ($end & 64) != 0
2080 0 0 if $stype & 2048
2081 0 0 if $stype & 512
2082 0 0 if $h > 1 and $stype & 512
2086 0 0 if $stype & 256 or $stype & 1024
2089 0 0 if $stype & 256
2090 0 0 if $stype & 1024
2093 0 0 if $stype & 2048 or $stype & 512
2095 0 0 if $stype & 1024
2101 14 1 unless defined $color
2106 1 14 if $link ne ''
2113 22 15 unless $svg =~ /\n\n\z/