| 1 | package Games::TF2::Demo::StringTable; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 11 | ▶ | use v5.26; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 11 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 11 | ▶ | use feature 'signatures'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 11 | ▶ | no warnings 'experimental::signatures'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 11 | our $VERSION = '0.01'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 11 | ▶ | use Object::Pad 0.800; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | class Games::TF2::Demo::StringTable :strict(params) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 11 | ▶ | use Games::TF2::Demo::Error; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 0 | ▶ | field $name :param :reader; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
name: not called CC=1 SCAR=2.6
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 11 | field $texts :param; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 11 | field $user_data :param; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 0 | ▶ | method size () { return scalar $texts->@* } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
size: not called CC=1 SCAR=4.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | ▶ | method text ($index) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
text: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | return $texts->[ $self->_checked_index($index) ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 11 | } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 0 | ▶ | method user_data ($index) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
user_data: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | return $user_data->[ $self->_checked_index($index) ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 11 | } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | ▶ | method _checked_index ($index) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_checked_index: not called CC=5 SCAR=34.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | ▶ | return $index if defined $index && !ref $index && $index =~ /\A[0-9]+\z/ && $index < $texts->@*; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/9
defined $index and not ref $index and $index =~ /\A[0-9]+\z/u and $index < @$texts
defined $index and not ref $index and $index =~ /\A[0-9]+\z/u
defined $index and not ref $index
MC/DC0%0/4
defined $index and not ref $index and $index =~ /\A[0-9]+\z/u and $index < @$texts
defined $index
not ref $index
$index =~ /\A[0-9]+\z/u
$index < @$texts
Truth table0%0/5
A and not(B) and C and D
A= defined $indexB= not ref $indexC= $index =~ /\A[0-9]+\z/uD= $index < @$texts
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 0 | Games::TF2::Demo::Error::Argument->throw( message => "Games::TF2::Demo::StringTable: no entry $index in $name, it has " . scalar( $texts->@* ) ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 11 | } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 11 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||