Branch Coverage

blib/lib/Game/CharacterSheetGenerator.pm
Criterion Covered Total %
branch 237 316 75.0


line true false branch
336 5 37323 if ($en =~ /(.*)( \(\d+\))$/u)
340 18312 19016 if ($translation->{$en} and $lang eq "de")
355 13 0 if (-f "$dist_dir/$filename") { }
360 0 0 unless $tx->success
374 13 425 if ($tspans->size > 1) { }
391 19 490 if $line eq ""
395 0 490 if ($tag eq 'strong' or $tag eq 'b') { }
0 490 elsif ($tag eq 'em' or $tag eq 'i') { }
0 490 elsif ($tag eq 'a') { }
415 71 419 if (@line)
429 0 638 unless $id =~ /^[-a-z0-9]+$/u
445 11 0 if ($self)
467 125 100 if $id =~ /^text[0-9]+(-[0-9]+)*$/u
468 0 100 unless $id =~ /^[-a-z0-9]+$/u
473 0 100 unless $style =~ s/fill:#\d+/fill:magenta/u
479 0 2 if $id =~ /^text[0-9]+(-[0-9]+)*$/u
480 0 2 unless $id =~ /^[-a-z0-9]+$/u
494 3 681 if $n <= 3
495 34 647 if $n <= 5
496 149 498 if $n <= 8
497 302 196 if $n <= 12
498 166 30 if $n <= 15
499 28 2 if $n <= 17
505 0 7 if $n <= 3
506 2 5 if $n <= 8
507 2 3 if $n <= 12
508 3 0 if $n <= 17
515 43 23 if ($char->{$id} and not defined $$char{"$id-bonus"})
519 7 4 if ($char->{'cha'} and not defined $char->{'reaction'})
522 11 0 unless ($char->{'loyalty'})
525 11 0 unless (defined $char->{'hirelings'})
528 7 4 if ($char->{'thac0'} and not defined $char->{'melee-thac0'})
531 7 4 if ($char->{'thac0'} and not defined $char->{'range-thac0'})
534 7 4 if ($char->{'thac0'} and not defined $char->{'other-thac0'})
540 4 326 if $val > 20
541 120 210 if $val < 1
542 330 0 unless $$char{"$type$n"}
545 11 0 unless (defined $char->{'damage'})
548 11 0 unless (defined $char->{'melee-damage'})
551 11 0 unless (defined $char->{'range-damage'})
554 11 0 unless (defined $char->{'other-damage'})
569 0 304 if $class eq T("hireling") or $class eq T("porter")
580 1 304 if $xp or $level > 1 or not $class
587 109 195 if (member($class, T("magic-user"), T("elf")))
600 256 48 if $gold
601 0 304 if $silver
653 0 6497 unless (defined $price)
664 242 19206 if ($_ eq $item)
665 0 242 if (/\(\d+\)$/u) { }
675 3300 242 if ($item)
685 2010 2002 if (ref $item eq 'ARRAY') { }
687 1327 1564 if (ref $elem eq 'ARRAY') { }
692 538 789 if ($money >= $price)
694 0 538 if $char->{'debug'}
702 1155 409 if ($money >= $price)
704 0 1155 if $char->{'debug'}
712 1301 701 if ($money >= $price)
714 0 1301 if $char->{'debug'}
723 0 304 if $char->{'debug'}
732 0 304 if $char->{'debug'}
733 55 249 if ($class eq T("thief"))
741 0 304 if $char->{'debug'}
749 0 304 if $char->{'debug'}
760 0 304 if $char->{'debug'}
770 0 304 if $char->{'debug'}
774 63 241 if ($class eq T('magic-user')) { }
55 186 elsif ($class eq T('thief')) { }
792 30 274 if (member(T('plate mail'), @property)) { }
77 197 elsif (member(T('chain mail'), @property)) { }
128 69 elsif (member(T('leather armor'), @property)) { }
796 106 198 if (member(T("shield"), @property))
798 30 274 if ($class eq T("halfling"))
814 63 241 if ($class eq T('magic-user')) { }
74 167 elsif ($class eq T('fighter')) { }
36 131 elsif ($class eq T('dwarf')) { }
30 101 elsif ($class eq T('halfling')) { }
46 55 elsif ($class eq T('elf')) { }
55 0 elsif ($class eq T('thief')) { }
0 0 elsif ($class eq T('hireling')) { }
0 0 elsif ($class eq T('porter')) { }
819 1 10 if (good($str) and $hp > 6 and not $shield)
833 20 16 unless $shield
865 36 268 if ($class eq T("dwarf") or member(T("battle axe"), @property))
869 74 230 if ($class eq T("fighter"))
880 94 210 if ($class eq T('fighter') || $class eq T('elf') and average($dex))
889 241 63 if ($class ne T("magic-user"))
890 183 58 if (average($dex))
911 0 304 if $char->{'debug'}
948 4 7 unless $class
950 0 7 if ($class eq T('dwarf') or $class eq T('halfling')) { }
0 7 elsif ($class eq T('elf')) { }
1 6 elsif ($class eq T('fighter')) { }
2 4 elsif ($class eq T('magic-user')) { }
4 0 elsif ($class eq T('thief')) { }
970 5 2 unless $char->{'breath'}
971 5 2 unless $char->{'poison'}
972 5 2 unless $char->{'petrify'}
973 5 2 unless $char->{'wands'}
974 5 2 unless $char->{'spells'}
982 0 0 ref $improvement ? :
1023 394 1131 if ($_[$i] > $max)
1036 1688 1574 if $_[$i] > $limit
1053 4 5032 unless not defined $char->{$key} or $char->{$key} eq ""
1074 561 6482 if $element eq $_
1084 0 0 if (substr($text, $n, 1) eq ' ') { }
1094 0 0 if wantarray
1422 30 275 if ($class eq T('halfling')) { }
46 229 elsif ($class eq T('elf')) { }
36 193 elsif ($class eq T('dwarf')) { }
1433 49 51 if ($char->{'gender'} eq 'F') { }
50 1 elsif ($char->{'gender'} eq 'M') { }
1440 17 83 if ($d == 1) { }
9 74 elsif ($d == 2) { }
23 51 elsif ($d == 3) { }
16 35 elsif ($d == 4) { }
19 16 elsif ($d == 5) { }
16 0 elsif ($d == 6) { }
1457 100 0 if ($other ne $trait)
1469 0 305 $class eq T('hireling') || $class eq T('porter') ? :
1476 0 305 if ($class eq T("dwarf"))
1479 0 305 if ($class eq T("elf"))
1482 0 305 if ($class eq T("halfling"))
1496 0 305 if ($class eq T('hireling') or $class eq T('porter')) { }
1506 302 3 unless ($class)
1507 36 266 if (average($con) and $best eq 'str') { }
46 220 elsif (average($int) and good($str, $dex) and d6() > 2) { }
30 190 elsif (average($str, $dex, $con) == 3 and good($str, $dex, $con) and d6() > 2) { }
47 143 elsif (average($str, $dex, $con) >= 2 and $best eq 'str' || $best eq 'con' or good($str, $dex, $con) >= 2) { }
34 109 elsif ($best eq 'int') { }
24 85 elsif ($best eq 'dex') { }
1533 303 2 unless ($char->{'name'})
1539 2 303 unless ($char->{'gender'})
1544 30 275 if ($class eq T("halfling"))
1551 305 0 unless ($hp)
1552 110 195 if ($class eq T('fighter') or $class eq T('dwarf')) { }
76 119 elsif ($class eq T('elf') or $class eq T('halfling')) { }
1566 109 196 if ($class eq T("magic-user") or $class eq T("elf"))
1572 305 0 if (not $char->{'charsheet'})
1573 0 305 if ($class eq T('hireling') or $class eq T('porter')) { }
0 305 elsif ($char->{'landscape'}) { }
1587 46 259 if ($class eq T('elf')) { }
36 223 elsif ($class eq T('dwarf')) { }
30 193 elsif ($class eq T('halfling')) { }
56 137 elsif ($class eq T('thief')) { }
1602 0 56 if $n > 5
1626 5 300 if (member("portrait", @_))
1627 5 0 unless $char->{'portrait'}
1633 5 0 unless my $face_generator_url = app()->config("face_generator_url")
1635 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') { }
1651 0 0 if ($tx->res->code == 302) { }
1658 0 0 $tx->res->code ? :
1699 35 109 if /starting gold:/u or /gold$/u
1700 39 70 if /Startgold:/u or /Gold$/u
1708 0 0 unless defined $str
1713 0 0 unless $safe{$letter}