Branch Coverage

blib/lib/Game/CharacterSheetGenerator.pm
Criterion Covered Total %
branch 225 308 73.0


line true false branch
332 3 36379 if ($en =~ /(.*)( \(\d+\))$/u)
336 17828 18554 if ($translation->{$en} and $lang eq "de")
351 13 0 if (-f "$dist_dir/$filename") { }
356 0 0 unless $tx->success
370 13 425 if ($tspans->size > 1) { }
387 24 495 if $line eq ""
391 0 495 if ($tag eq 'strong' or $tag eq 'b') { }
0 495 elsif ($tag eq 'em' or $tag eq 'i') { }
0 495 elsif ($tag eq 'a') { }
411 81 414 if (@line)
425 0 633 unless $id =~ /^[-a-z0-9]+$/u
441 11 0 if ($self)
463 125 100 if $id =~ /^text[0-9]+(-[0-9]+)*$/u
464 0 100 unless $id =~ /^[-a-z0-9]+$/u
469 0 100 unless $style =~ s/fill:#\d+/fill:magenta/u
475 0 2 if $id =~ /^text[0-9]+(-[0-9]+)*$/u
476 0 2 unless $id =~ /^[-a-z0-9]+$/u
490 5 675 if $n <= 3
491 22 653 if $n <= 5
492 153 500 if $n <= 8
493 320 180 if $n <= 12
494 157 23 if $n <= 15
495 20 3 if $n <= 17
501 0 7 if $n <= 3
502 2 5 if $n <= 8
503 5 0 if $n <= 12
504 0 0 if $n <= 17
511 43 23 if ($char->{$id} and not defined $$char{"$id-bonus"})
515 7 4 if ($char->{'cha'} and not defined $char->{'reaction'})
518 11 0 unless ($char->{'loyalty'})
521 11 0 unless (defined $char->{'hirelings'})
524 7 4 if ($char->{'thac0'} and not defined $char->{'melee-thac0'})
527 7 4 if ($char->{'thac0'} and not defined $char->{'range-thac0'})
530 7 4 if ($char->{'thac0'} and not defined $char->{'other-thac0'})
536 1 329 if $val > 20
537 120 210 if $val < 1
538 330 0 unless $$char{"$type$n"}
541 11 0 unless (defined $char->{'damage'})
544 11 0 unless (defined $char->{'melee-damage'})
547 11 0 unless (defined $char->{'range-damage'})
550 11 0 unless (defined $char->{'other-damage'})
565 0 304 if $class eq T("hireling") or $class eq T("porter")
576 1 304 if $xp or $level > 1 or not $class
583 118 186 if (member($class, T("magic-user"), T("elf")))
596 271 33 if $gold
597 0 304 if $silver
649 0 6283 unless (defined $price)
660 271 19148 if ($_ eq $item)
661 0 271 if (/\(\d+\)$/u) { }
671 3274 271 if ($item)
681 2008 1984 if (ref $item eq 'ARRAY') { }
683 1276 1497 if (ref $elem eq 'ARRAY') { }
688 548 728 if ($money >= $price)
690 0 548 if $char->{'debug'}
698 1141 356 if ($money >= $price)
700 0 1141 if $char->{'debug'}
708 1296 688 if ($money >= $price)
710 0 1296 if $char->{'debug'}
719 0 304 if $char->{'debug'}
728 0 304 if $char->{'debug'}
729 48 256 if ($class eq T("thief"))
737 0 304 if $char->{'debug'}
745 0 304 if $char->{'debug'}
756 0 304 if $char->{'debug'}
766 0 304 if $char->{'debug'}
770 72 232 if ($class eq T('magic-user')) { }
48 184 elsif ($class eq T('thief')) { }
788 32 272 if (member(T('plate mail'), @property)) { }
88 184 elsif (member(T('chain mail'), @property)) { }
103 81 elsif (member(T('leather armor'), @property)) { }
792 90 214 if (member(T("shield"), @property))
794 26 278 if ($class eq T("halfling"))
810 72 232 if ($class eq T('magic-user')) { }
58 174 elsif ($class eq T('fighter')) { }
54 120 elsif ($class eq T('dwarf')) { }
26 94 elsif ($class eq T('halfling')) { }
46 48 elsif ($class eq T('elf')) { }
48 0 elsif ($class eq T('thief')) { }
0 0 elsif ($class eq T('hireling')) { }
0 0 elsif ($class eq T('porter')) { }
815 0 15 if (good($str) and $hp > 6 and not $shield)
829 27 27 unless $shield
861 54 250 if ($class eq T("dwarf") or member(T("battle axe"), @property))
865 58 246 if ($class eq T("fighter"))
876 75 229 if ($class eq T('fighter') || $class eq T('elf') and average($dex))
885 232 72 if ($class ne T("magic-user"))
886 175 57 if (average($dex))
907 0 304 if $char->{'debug'}
944 4 7 unless $class
946 0 7 if ($class eq T('dwarf') or $class eq T('halfling')) { }
2 5 elsif ($class eq T('elf')) { }
3 2 elsif ($class eq T('fighter')) { }
0 2 elsif ($class eq T('magic-user')) { }
2 0 elsif ($class eq T('thief')) { }
966 5 2 unless $char->{'breath'}
967 5 2 unless $char->{'poison'}
968 5 2 unless $char->{'petrify'}
969 5 2 unless $char->{'wands'}
970 5 2 unless $char->{'spells'}
978 0 0 ref $improvement ? :
1019 340 1185 if ($_[$i] > $max)
1032 1644 1463 if $_[$i] > $limit
1049 4 4928 unless not defined $char->{$key} or $char->{$key} eq ""
1070 526 6283 if $element eq $_
1080 0 0 if (substr($text, $n, 1) eq ' ') { }
1090 0 0 if wantarray
1700 46 54 if ($gender eq 'F') { }
54 0 elsif ($gender eq 'M') { }
1707 12 88 if ($d == 1) { }
17 71 elsif ($d == 2) { }
17 54 elsif ($d == 3) { }
14 40 elsif ($d == 4) { }
23 17 elsif ($d == 5) { }
17 0 elsif ($d == 6) { }
1724 100 0 if ($other ne $trait)
1734 303 2 unless $char->{'name'}
1737 0 305 $class eq T('hireling') || $class eq T('porter') ? :
1744 0 305 if ($class eq T("dwarf"))
1747 0 305 if ($class eq T("elf"))
1750 0 305 if ($class eq T("halfling"))
1764 0 305 if ($class eq T('hireling') or $class eq T('porter')) { }
1774 302 3 unless ($class)
1775 54 248 if (average($con) and $best eq 'str') { }
46 202 elsif (average($int) and good($str, $dex) and d6() > 2) { }
26 176 elsif (average($str, $dex, $con) == 3 and good($str, $dex, $con) and d6() > 2) { }
32 144 elsif (average($str, $dex, $con) >= 2 and $best eq 'str' || $best eq 'con' or good($str, $dex, $con) >= 2) { }
48 96 elsif ($best eq 'int') { }
24 72 elsif ($best eq 'dex') { }
1801 26 279 if ($class eq T("halfling"))
1807 305 0 unless ($hp)
1808 112 193 if ($class eq T('fighter') or $class eq T('dwarf')) { }
72 121 elsif ($class eq T('elf') or $class eq T('halfling')) { }
1822 118 187 if ($class eq T("magic-user") or $class eq T("elf"))
1828 305 0 if (not $char->{'charsheet'})
1829 0 305 if ($class eq T('hireling') or $class eq T('porter')) { }
0 305 elsif ($char->{'landscape'}) { }
1843 46 259 if ($class eq T('elf')) { }
54 205 elsif ($class eq T('dwarf')) { }
26 179 elsif ($class eq T('halfling')) { }
49 130 elsif ($class eq T('thief')) { }
1858 0 49 if $n > 5
1882 5 300 if (member("portrait", @_))
1883 5 0 unless $char->{'portrait'}
1889 5 0 unless my $face_generator_url = app()->config("face_generator_url")
1891 0 0 if ($char->{'class'} eq T('elf') or $char->{'race'} eq T('elf')) { }
0 0 elsif ($char->{'class'} eq T('dwarf') or $char->{'race'} eq T('dwarf')) { }
0 0 elsif ($gender eq 'F') { }
0 0 elsif ($gender eq 'M') { }
1907 0 0 if ($tx->res->code == 302) { }
1914 0 0 $tx->res->code ? :
1955 36 104 if /starting gold:/u or /gold$/u
1956 36 68 if /Startgold:/u or /Gold$/u
1964 0 0 unless defined $str
1969 0 0 unless $safe{$letter}