Gherkin/ParserContext.pm

filter: Statementstmt 80.0% 24 / 30 Branchbran n/a Conditioncond 42.8% 3 / 7 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 77.7% 7 / 9 Podpod 0.0% 0 / 5 totaltotal 61.8% 34 / 55 CC 4 SCAR 6.4
CC
4
Cov
73%
new
3.1
read_token
2.1
add_tokens
2.0
CRAP 1.9
« Gherkin/TokenScanner.pm ↑ Summary Gherkin/Token.pm »
1 package Gherkin::ParserContext;
2 1 $Gherkin::ParserContext::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 List::Util qw( uniq );
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use Class::XSAccessor accessors =>
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 [ qw/token_scanner token_matcher token_queue _errors/, ];
10  
11 3 ▶sub new {
Subroutine new: called CC=3 SCAR=11.4
Pod undocumented
12 3 my ( $class, $options ) = @_;
13 3 ▶ $options->{'token_queue'} ||= [];
Condition50%1/2
$options->{"token_queue"} ||= []
l!l
03
MC/DC0%0/1
$options->{"token_queue"} ||= []
$options->{"token_queue"}
Truth table50%1/2
A
A= $options->{"token_queue"}
Aresult
11
00
14 3 ▶ $options->{'_errors'} ||= [];
Condition50%1/2
$options->{"_errors"} ||= []
l!l
03
MC/DC0%0/1
$options->{"_errors"} ||= []
$options->{"_errors"}
Truth table50%1/2
A
A= $options->{"_errors"}
Aresult
11
00
15 3 bless $options, $class;
16 }
17  
18 0 ▶sub add_tokens { my $self = shift; push( @{ $self->token_queue }, @_ ); }
Subroutine add_tokens: not called CC=1 SCAR=6.9
Pod undocumented
19 3 ▶sub errors { my $self = shift; return @{ $self->_errors } }
Subroutine errors: called CC=1 SCAR=0.0
Pod undocumented
20 0 ▶sub add_errors {
Subroutine add_errors: not called CC=1 SCAR=6.9
Pod undocumented
21 0 my $self = shift;
22 0 push @{ $self->{'_errors'} }, @_;
23 }
24  
25 36 ▶sub read_token {
Subroutine read_token: called CC=2 SCAR=7.6
Pod undocumented
26 36 my ($self) = shift();
27 36 ▶ return shift( @{ $self->token_queue } ) || $self->token_scanner->read;
Condition33%1/3
shift @{$self->token_queue;} || $self->token_scanner->read
l!l&&r!l&&!r
0360
MC/DC0%0/2
shift @{$self->token_queue;} || $self->token_scanner->read
shift @{$self->token_queue;} $self->token_scanner->read
Truth table33%1/3
A || B
A= shift @{$self->token_queue;}B= $self->token_scanner->read
ABresult
1X1
011
000
28 }
29  
30 1 1;
« Gherkin/TokenScanner.pm ↑ Summary Gherkin/Token.pm »