| 1 | package Facebook::InstantArticle::Analytics; | ||||||||||||||||||||||||||||
| 2 | 2 | ▶ | use Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use namespace::autoclean; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 2 | extends 'Facebook::InstantArticle::BaseElement'; | |||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 2 | has 'source' => ( | |||||||||||||||||||||||||||
| 8 | isa => 'Str', | ||||||||||||||||||||||||||||
| 9 | is => 'rw', | ||||||||||||||||||||||||||||
| 10 | required => 0, | ||||||||||||||||||||||||||||
| 11 | default => '', | ||||||||||||||||||||||||||||
| 12 | ); | ||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 2 | has 'content' => ( | |||||||||||||||||||||||||||
| 15 | isa => 'Str', | ||||||||||||||||||||||||||||
| 16 | is => 'rw', | ||||||||||||||||||||||||||||
| 17 | required => 0, | ||||||||||||||||||||||||||||
| 18 | default => '', | ||||||||||||||||||||||||||||
| 19 | ); | ||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | has 'is_valid' => ( | ||||||||||||||||||||||||||||
| 22 | isa => 'Bool', | ||||||||||||||||||||||||||||
| 23 | is => 'ro', | ||||||||||||||||||||||||||||
| 24 | lazy => 1, | ||||||||||||||||||||||||||||
| 25 | default => sub { | ||||||||||||||||||||||||||||
| 26 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 0 | ▶ | return ( length $self->source || length $self->content ) ? 1 : 0; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
length $self->source or length $self->content
MC/DC0%0/2
length $self->source or length $self->content
length $self->source
length $self->content
Truth table0%0/3
A or B
A= length $self->sourceB= length $self->content
| |||||||||||||||||||||||||||||
| 29 | }, | ||||||||||||||||||||||||||||
| 30 | 2 | ); | |||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 2 | has 'as_xml_gen' => ( | |||||||||||||||||||||||||||
| 33 | isa => 'Object', | ||||||||||||||||||||||||||||
| 34 | is => 'ro', | ||||||||||||||||||||||||||||
| 35 | lazy => 1, | ||||||||||||||||||||||||||||
| 36 | builder => '_build_as_xml_gen', | ||||||||||||||||||||||||||||
| 37 | ); | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | sub _build_as_xml_gen { | ||||||||||||||||||||||||||||
| 40 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
_build_as_xml_gen: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | 0 | my $gen = XML::Generator->new( ':pretty' ); | |||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 0 | ▶ | return $gen->figure( | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 45 | { class => 'op-tracker' }, | ||||||||||||||||||||||||||||
| 46 | $gen->iframe( | ||||||||||||||||||||||||||||
| 47 | ( length $self->source ? { src => $self->source } : undef ), | ||||||||||||||||||||||||||||
| 48 | ( length $self->content ? \$self->content : undef ), | ||||||||||||||||||||||||||||
| 49 | ), | ||||||||||||||||||||||||||||
| 50 | ); | ||||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | 2 | 1; | |||||||||||||||||||||||||||