InstantArticle/Analytics.pm

filter: Statementstmt 70.5% 12 / 17 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 50.0% 2 / 4 Podpod n/a totaltotal 43.7% 14 / 32 SCAR 21.9
CC
5
Cov
46%
__ANON__
12.0
_build_as_xml_gen
12.0
BEGIN
1.0
CRAP 8.9
« InstantArticle/Embed.pm ↑ Summary InstantArticle/Blockquote.pm »
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
BranchTrueFalseTotal
length $self->source || length $self->content ? : 0 0 0
Condition0%0/3
length $self->source or length $self->content
l!l&&r!l&&!r
000
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
ABresult
1X1
011
000
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
BranchTrueFalseTotal
length $self->source ? : 0 0 0
length $self->content ? : 0 0 0
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;
« InstantArticle/Embed.pm ↑ Summary InstantArticle/Blockquote.pm »