| 1 | #!/usr/bin/perl | ||||||||||||||||||||||||||||
| 2 | 38 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 38 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | package WWW::Shopify::Liquid::Tag::Enclosing; | ||||||||||||||||||||||||||||
| 6 | 38 | ▶ | use base 'WWW::Shopify::Liquid::Tag'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 0 | ▶ | sub abstract { my $package = ref($_[0]) ? ref($_[0]) : $_[0]; return ($package eq __PACKAGE__); } | ||||||||||||||||||||||||||
|
Subroutine
abstract: not called CC=2 SCAR=17.9
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 8 | 0 | ▶ | sub is_enclosing { return 1; } | ||||||||||||||||||||||||||
|
Subroutine
is_enclosing: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 9 | 0 | ▶ | sub inner_tags { return (); } | ||||||||||||||||||||||||||
|
Subroutine
inner_tags: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 10 | 0 | ▶ | sub inner_ignore_whitespace { return 0; } | ||||||||||||||||||||||||||
|
Subroutine
inner_ignore_whitespace: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 11 | # Interprets the inner of this tag as being completely text. Used for comments and raws. | ||||||||||||||||||||||||||||
| 12 | 0 | ▶ | sub inner_halt_lexing { return 0; } | ||||||||||||||||||||||||||
|
Subroutine
inner_halt_lexing: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 13 | 0 | ▶ | sub subelements { qw(contents arguments) } | ||||||||||||||||||||||||||
|
Subroutine
subelements: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 0 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 16 | 0 | my ($package, $line, $tag, $arguments, $contents) = @_; | |||||||||||||||||||||||||||
| 17 | 0 | my $self = { line => $line, core => $tag, arguments => $arguments, contents => @{$contents->[0]} }; | |||||||||||||||||||||||||||
| 18 | 0 | ▶ | die new WWW::Shopify::Liquid::Exception::Parser($self, "Uncustomized tags can only have one element following their contents.") unless int(@$contents) == 1; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 19 | 0 | return bless $self, $package; | |||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 0 | ▶ | sub strip_left_end { $_[0]->{strip_left_end} = $_[1] if @_ > 1; return $_[0]->{strip_left_end}; } | ||||||||||||||||||||||||||
|
Subroutine
strip_left_end: not called CC=2 SCAR=17.9
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 23 | 0 | ▶ | sub strip_right_end { $_[0]->{strip_right_end} = $_[1] if @_ > 1; return $_[0]->{strip_right_end}; } | ||||||||||||||||||||||||||
|
Subroutine
strip_right_end: not called CC=2 SCAR=17.9
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 0 | ▶ | sub process { | ||||||||||||||||||||||||||
|
Subroutine
process: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 27 | 0 | my ($self, $hash, $action, $pipeline) = @_; | |||||||||||||||||||||||||||
| 28 | 0 | my ($contents, $arguments) = $self->process_subelements($hash, $action, $pipeline); | |||||||||||||||||||||||||||
| 29 | 0 | ▶ | return $self unless $self->is_processed($contents) && int(grep { !$self->is_processed($_) } @$arguments) == 0; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->is_processed($contents) and int grep({not $self->is_processed($_);} @$arguments) == 0
MC/DC0%0/2
$self->is_processed($contents) and int grep({not $self->is_processed($_);} @$arguments) == 0
$self->is_processed($contents)
int grep({not $self->is_processed($_);} @$arguments) == 0
Truth table0%0/3
A and B
A= $self->is_processed($contents)B= int grep({not $self->is_processed($_);} @$arguments) == 0
| |||||||||||||||||||||||||||||
| 30 | 0 | return $self->operate($hash, $contents, @$arguments); | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 37 | 1; | |||||||||||||||||||||||||||