| 1 | package Gherkin::AstNode; | ||||||||||||
| 2 | 1 | $Gherkin::AstNode::VERSION = '42.0.1'; | |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | |||||||||||||
| 6 | 1 | ▶ | use Class::XSAccessor accessors => [ qw/rule_type/, ]; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | 39 | ▶ | sub new { | ||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 9 | 39 | my ( $class, $rule_type ) = @_; | |||||||||||
| 10 | 39 | bless { rule_type => $rule_type, _sub_items => {} }, $class; | |||||||||||
| 11 | } | ||||||||||||
| 12 | |||||||||||||
| 13 | 69 | ▶ | sub add { | ||||||||||
|
Subroutine
add: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 14 | 69 | my ( $self, $rule_type, $obj ) = @_; | |||||||||||
| 15 | 69 | ▶ | push( @{ ( $self->{'_sub_items'}->{$rule_type} ||= [] ) }, $obj ); | ||||||||||
|
Condition100%2/2
$self->{"_sub_items"}{$rule_type} ||= []
MC/DC100%1/1
$self->{"_sub_items"}{$rule_type} ||= []
$self->{"_sub_items"}{$rule_type}
Truth table100%2/2
A
A= $self->{"_sub_items"}{$rule_type}
| |||||||||||||
| 16 | } | ||||||||||||
| 17 | |||||||||||||
| 18 | 78 | ▶ | sub get_single { | ||||||||||
|
Subroutine
get_single: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 19 | 78 | my ( $self, $rule_type ) = @_; | |||||||||||
| 20 | 78 | my $items = $self->{'_sub_items'}->{$rule_type}; | |||||||||||
| 21 | 78 | ▶ | return $items unless $items; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 22 | 39 | return $items->[0]; | |||||||||||
| 23 | } | ||||||||||||
| 24 | |||||||||||||
| 25 | 21 | ▶ | sub get_items { | ||||||||||
|
Subroutine
get_items: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 26 | 21 | my ( $self, $rule_type ) = @_; | |||||||||||
| 27 | 21 | ▶ | return $self->{'_sub_items'}->{$rule_type} || []; | ||||||||||
|
Condition100%2/2
$self->{'_sub_items'}{$rule_type} || []
MC/DC100%1/1
$self->{'_sub_items'}{$rule_type} || []
$self->{'_sub_items'}{$rule_type}
Truth table100%2/2
A
A= $self->{'_sub_items'}{$rule_type}
| |||||||||||||
| 28 | } | ||||||||||||
| 29 | |||||||||||||
| 30 | 21 | ▶ | sub get_token { | ||||||||||
|
Subroutine
get_token: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 31 | 21 | my ( $self, $token_type ) = @_; | |||||||||||
| 32 | 21 | return $self->get_single($token_type); | |||||||||||
| 33 | } | ||||||||||||
| 34 | |||||||||||||
| 35 | 0 | ▶ | sub get_tokens { | ||||||||||
|
Subroutine
get_tokens: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||
| 36 | 0 | my ( $self, $token_type ) = @_; | |||||||||||
| 37 | 0 | ▶ | return $self->{'_sub_items'}->{$token_type} || []; | ||||||||||
|
Condition0%0/2
$self->{'_sub_items'}{$token_type} || []
MC/DC0%0/1
$self->{'_sub_items'}{$token_type} || []
$self->{'_sub_items'}{$token_type}
Truth table0%0/2
A
A= $self->{'_sub_items'}{$token_type}
| |||||||||||||
| 38 | } | ||||||||||||
| 39 | |||||||||||||
| 40 | 1 | 1; | |||||||||||