InstantArticle/Author.pm

filter: Statementstmt 100% 16 / 16 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 95.4% 21 / 22 SCAR 6.9
CC
2
Cov
94%
__ANON__
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« InstantArticle/BaseElement.pm ↑ Summary InstantArticle/Figure/Image.pm »
1 package Facebook::InstantArticle::Author;
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 'name' => (
8 isa => 'Str',
9 is => 'rw',
10 required => 1,
11 default => '',
12 );
13  
14 has 'is_valid' => (
15 isa => 'Bool',
16 is => 'ro',
17 lazy => 1,
18 default => sub {
19 1 ▶ my $self = shift;
Subroutine __ANON__: called CC=2 SCAR=7.2
20  
21 1 ▶ return length $self->name ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
length $self->name ? : 1 0 1
22 },
23 2 );
24  
25 2 has 'as_xml_gen' => (
26 isa => 'Object',
27 is => 'ro',
28 lazy => 1,
29 builder => '_build_as_xml_gen',
30 );
31  
32 sub _build_as_xml_gen {
33 1 ▶ my $self = shift;
Subroutine _build_as_xml_gen: called CC=1 SCAR=0.0
34  
35 1 my $gen = XML::Generator->new( ':pretty' );
36  
37 1 return $gen->address(
38 $gen->a( $self->name ),
39 );
40 }
41  
42 2 1;
« InstantArticle/BaseElement.pm ↑ Summary InstantArticle/Figure/Image.pm »