Branch Coverage

lib/Graph/Easy/Attributes.pm
Criterion Covered Total %
branch 382 488 78.2


line true false branch
1943 4 5 unless $$color_values{$scheme}{$color}
1954 0 9 if $color =~ s[^([a-z0-9])/][]
1956 0 9 unless $$color_names{$scheme}{$color}
1964 0 9 if $scheme eq 'inherit'
1965 8 1 exists $$color_names{$scheme} ? :
1985 10 253 if ($color =~ s[^(w3c|[a-z]+\d{0,2})/][])
1988 10 0 if exists $$color_names{$scheme}{$color}
1991 0 0 exists $$color_names{$scheme}{$color} ? :
1997 186 67 if exists $$all_color_names{$color}
2000 61 6 defined $self->color_as_hex($color) ? :
2010 6 29 if ($s < $e)
2012 2 4 if $v > 255
2025 16 13 if ($h1 == 0 or $h1 == 6) { }
4 9 elsif ($h1 == 1) { }
2 7 elsif ($h1 == 2) { }
4 3 elsif ($h1 == 3) { }
3 0 elsif ($h1 == 4) { }
2053 8 21 if $r > 255
2054 4 25 if $g > 255
2055 7 22 if $b > 255
2066 6 15 if ($s < $e)
2069 2 4 if $l > 255
2074 2 13 if ($l < 0.5) { }
2087 2 13 if $h >= 360
2096 0 15 if $tr < 0
3 12 if $tr > 1
2097 0 15 if $tg < 0
0 15 if $tg > 1
2098 8 7 if $tb < 0
0 15 if $tb > 1
2106 8 37 if ($t3 < 0.16666666666666666) { }
15 22 elsif ($t3 < 0.5) { }
5 17 elsif ($t3 < 0.66666666666666663) { }
2122 15 30 if $c > 255
2144 0 725 if $color =~ s[^([a-z0-9])/][]
2147 612 113 if exists $$color_names{$scheme}{$color}
2151 12 101 if exists $$color_names{'x11'}{$color}
2160 57 44 if ($color =~ /^(rgb|hsv|hsl)\($qr_num,$qr_num,$qr_num(?:,$qr_num)?\s*\)\z/)
2162 55 2 unless defined $a
2171 15 213 if ($c =~ /^([0-9]+)%\z/) { }
2177 90 123 if $c =~ /^([0-9]+\.[0-9]+)\z/
2181 21 36 if $format eq 'hsv'
2182 11 46 if $format eq 'hsl'
2184 0 57 if $a > 255
2191 9 92 if $color =~ /^#([a-f0-9])([a-f0-9])([a-f[0-9])\z/
2197 8 93 unless $color =~ /^#([a-f0-9]{6}|[a-f0-9]{8})\z/i
2207 5 15 if $style =~ /^(normal|none|)\z/
2211 0 15 if grep((!/^(underline|overline|line-through|italic|bold)\z/), @styles)
2223 2 81 if $style =~ /^(normal|none)\z/
2224 79 2 if $style eq ''
2241 0 81 if $$ts{'italic'}
2242 0 81 if $$ts{'bold'}
2244 0 79 if ($$ts{'underline'} or $$ts{'none'} or $$ts{'overline'} or $$ts{'line-through'})
2250 2 6 if $$ts{$k}
2253 2 0 if $s
2258 2 79 if $fs
2260 5 76 unless ($align)
2264 5 0 if $al
2274 0 0 unless defined $val
2275 0 0 if $fs eq ''
2277 0 0 if ($fs =~ /^([\d.]+)em\z/) { }
0 0 elsif ($fs =~ /^([\d.]+)%\z/) { }
0 0 elsif ($fs =~ /^([\d.]+)px\z/) { }
2327 0 743 unless defined $d
2336 201 311 unless exists $$sides{$dir}
2353 1863 103 if ($dir =~ /^(south|north|west|east|up|down|0|90|180|270)\z/)
2363 0 103 unless defined $in
2364 0 103 unless defined $modifier
2386 2 203 if ($dir =~ /^(south|north|west|east|up|down|0|90|180|270)\z/)
2396 0 203 unless defined $in
2397 0 203 unless defined $modifier
2400 0 203 if $out >= 360
2410 76 0 $dir =~ /^(south|east|west|north|down|up|0|90|180|270|front|forward|back|left|right)\z/ ? :
2420 0 94 unless defined $width
2421 0 94 unless defined $color
2423 2 92 unless $color =~ /^#/
2425 2 92 if $style =~ /^(none|)\z/
2428 4 88 if $style =~ /^double/
2432 0 92 if $style eq 'broad'
2433 0 92 if $style =~ /^bold/
2434 0 92 if $style eq 'wide'
2435 0 92 if $style =~ /(broad|wide|bold)\z/
2436 0 92 if $style eq 'bold-dash'
2437 3 89 if $style eq 'double-dash'
2439 88 4 if $width =~ /^\s*\d+\s*\z/
2441 0 92 if $width eq '' and $style ne 'double'
2457 0 1165 unless defined $width
2458 0 1165 unless defined $color
2460 44 1121 if $style =~ /^(none|)\z/
2462 9 1112 if $width =~ /^\s*\d+\s*\z/
2476 64 1831 if $bw eq '0'
2480 22 1809 if $bs eq 'none'
2481 3 1806 if $bs =~ /^bold/
2482 1 1805 if $bs =~ /^broad/
2483 0 1805 if $bs =~ /^wide/
2486 1805 0 if $bw =~ /^([\d.]+)\z/
2488 0 0 if ($bw =~ /^([\d.]+)em\z/) { }
0 0 elsif ($bw =~ /^([\d.]+)%\z/) { }
0 0 elsif ($bw =~ /^([\d.]+)px\z/) { }
2513 0 19 unless $angle =~ /^([+-]?\d{1,3}|south|west|east|north|up|down|left|right|front|back|forward)\z/
2523 0 1 unless $val =~ /^\d+\z/
2526 0 1 if $val > 4096
2545 3 36 if $border eq '0'
2564 10 26 if $border ne ''
2566 0 36 unless defined $color
2569 31 5 if $width eq ''
2570 26 10 if $color eq ''
2571 0 36 if $style eq ''
3302 845 1323 if ref $$self{'graph'}
3307 1299 869 if (defined $class) { }
3310 222 1077 if $style eq 'none'
3316 1071 6 if $def_width eq $width
3320 1068 9 if $def_color eq $color
3325 39 830 if $style eq 'none'
3331 827 3 if $def_width eq $width
3335 820 10 if $def_color eq $color
3338 787 5 if $def_style eq $style and ($color eq '' and $width eq '')
3348 6 48 if ($$self{'_warn_on_unknown_attributes'}) { }
3365 3683 2591 if (scalar @_ == 2)
3375 2 6272 if exists $$att_aliases{$name}
3380 0 6274 if $name =~ /$qr_custom_attribute/
3383 0 6274 if exists $$s{$class}
3390 0 6274 unless ref $entry
3397 4341 1933 if (ref $def)
3400 3265 1076 unless defined $val
3401 3193 1148 unless defined $val
3415 0 7354 if exists $$att_aliases{$name}
3421 0 7354 if exists $$s{$class}
3428 0 7354 if $name =~ /$qr_custom_attribute/
3432 0 7354 unless ref $entry
3441 1125 6229 if (exists $$a{'graph'}) { }
3444 384 741 if exists $$a{'graph'}{$name}
3449 195 6034 if exists $$a{$name}
3453 0 7354 if $name eq 'background' and ref $$self{'group'}
3456 578 1 if not defined $val or $val ne 'inherit' or $name =~ /^x-([a-z_]+-)*[a-z_]+([0-9]*)\z/
3462 0 1 if $class eq 'graph'
3469 1 0 if ($class =~ /\./)
3478 0 1 unless ref $g
3487 1 0 if exists $$att{$name}
3490 0 1 unless (defined $val)
3496 0 0 if (ref $def)
3499 0 0 if (not defined $val and $try =~ /\./)
3504 0 0 unless defined $val
3511 1 0 if ($name ne 'label')
3513 0 1 unless defined $val
3517 0 1 if $type >= 6
3520 1 0 if defined $val and $val ne 'inherit'
3537 297 35 if (not $color =~ /^#/ and $color ne '')
3553 27 7 unless defined $color
3555 7 0 if (not $color =~ /^#/ and $color ne '')
3570 0 452 if exists $$att_aliases{$name}
3575 0 452 if exists $$s{$class}
3588 8309 62881 if (scalar @_ == 3) { }
3591 0 8309 if exists $$self{'graph'}
3594 0 8309 unless ($class =~ /^(node|group|edge|graph\z)/)
3599 851 7458 if $name eq 'border'
3605 76 62805 if $name eq 'class'
3606 62805 76 if ($name ne 'class')
3609 37783 25022 unless defined $class
3612 62 62819 if $name eq 'border'
3613 25 62794 if $name eq 'size'
3619 26 70226 if exists $$att_aliases{$name}
3622 27206 43046 unless defined $sub_class
3623 76 70176 if ($name eq 'class')
3626 9 67 if $sub_class ne ''
3632 550 69693 if exists $$s{$class}
3638 4 70239 if $name =~ /$qr_custom_attribute/
3642 0 70243 unless ref $entry
3648 62785 7458 if ($three_arg == 0)
3653 2212 60573 if (exists $$a{'graph'}) { }
3656 539 1673 if exists $$a{'graph'}{$name}
3661 7672 52901 if exists $$a{$name}
3665 0 108 if ($name eq 'background' and $val and $val eq 'inherit')
3668 0 0 if $parent and $parent != $self
3672 2069 4 if defined $val and $type >= 6 || $val ne 'inherit' || $class eq 'graph'
3695 68115 4 unless defined $val
3696 2393 65726 if $class =~ /\./
3697 65025 3094 unless @tries and $tries[-1] eq 'graph'
3702 9971 58148 unless ref $g
3705 9856 58263 if $$self{'class'} eq 'graph'
3715 1508 79159 if exists $$att{$name}
3718 79195 1472 unless (defined $val)
3724 38220 40975 if (ref $def)
3727 1231 36989 if (not defined $val and $try =~ /\./)
3733 884 37336 if not defined $val and $try =~ /\./
3735 16928 20408 unless defined $val
3742 74206 5577 if ($name ne 'label')
3744 0 74206 unless defined $val
3748 7229 72554 if $type >= 6
3751 60890 11664 if defined $val and $val ne 'inherit' || $try eq 'graph'
3758 141 13 if ($name eq 'background' and $val and $val eq 'inherit')
3761 89 52 if $parent and $parent != $self
3804 25 59 if defined $error and $error == 1
3805 2 57 if defined $error and $error == 2
3826 0 1254 if ref $value
3827 0 1254 if ref $name
3832 80 1174 if $name =~ /$qr_custom_attribute/
3834 20 1154 unless defined $class
3838 39 1135 if exists $$att_aliases{$name}
3841 113 1061 if exists $$s{$class}
3847 54 1120 unless ref $entry
3852 250 870 if $type == 1
3853 19 1101 if $type == 2
3854 1 1119 if $type == 4
3864 920 200 if (keys %{$$attributes{'special'};} == 0)
3866 10 910 if $value =~ /(^|[^\\])\|/
3869 10 1110 if @values > 1
3870 0 1120 if $no_multiples and $multiples
3877 5 1129 if $multiples and $v eq ''
3879 381 748 if (defined $check and not ref $check) { }
431 317 elsif ($check) { }
3883 7 374 unless (defined $checked)
3892 71 360 if (ref $check eq 'ARRAY')
3899 7 424 unless ($v =~ /$check/)
3911 35 1080 if $type == 7
3915 1096 10 unless $multiples
3939 1964 922 if ref $object
3955 1964 922 if ref $object
3956 919 1967 if defined $object and not ref $object
3959 0 2886 if defined $color_scheme and $color_scheme eq 'inherit'
3969 1141 0 unless (ref $object or exists $$ral{$atr})
3972 223 713 if not defined $val or $val eq '' or exists $$r{$atr} and not defined $$r{$atr} or exists $$ra{$atr} and not defined $$ra{$atr}
3980 63 0 if ($color_remap and defined $entry and defined $val)
3984 23 40 if ($$entry[4] || 0) == 1
3991 1583 1202 if (exists $$r{$atr} or exists $$ra{$atr} or defined $x and $atr =~ /^x-/)
3993 1624 1817 unless defined $rc
3994 1255 2186 unless defined $rc
3997 2055 1386 if (ref $rc eq 'CODE') { }
4004 1215 859 if defined $a and defined $v
4011 177 1209 if defined $val and defined $rc
4019 383 2211 if not defined $at && defined $v or $v eq ''
4024 2 2209 if $encode and $v =~ /[;"\x00-\x1f]/
4027 0 2211 unless $noquote
4045 1 435 if $class eq 'graph'
4050 2 434 unless ($$g{'strict'})
4055 0 6 unless defined $val
4066 6 500 unless defined $val
4070 499 1 unless $val eq 'inherit'
4073 0 1 if exists $$s{$class}
4079 0 1 unless ref $entry
4084 1 0 if $type < 6
4097 0 70 if @_ > 0
4108 2222 62 if defined $val
4128 0 0 if @_ > 0