SEOmoz/Links.pm

filter: Statementstmt 66.6% 16 / 24 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 66.6% 4 / 6 Podpod 100% 1 / 1 totaltotal 61.7% 21 / 34 CC 3 SCAR 16.6
CC
3
Cov
62%
new_from_data
12.0
__ANON__
2.0
BEGIN
1.0
CRAP 5.2
↑ Summary SEOmoz.pm »
1 # ABSTRACT: Class to represent the links returned from the SEOmoz API
2 package WWW::SEOmoz::Links;
3  
4 3 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 ▶use Carp qw( croak );
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 3 ▶use WWW::SEOmoz::Link;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 3 our $VERSION = '0.03'; # VERSION
12  
13  
14 has 'links' => (
15 isa => 'ArrayRef[WWW::SEOmoz::Link]',
16 is => 'rw',
17 required => 1,
18 0 ▶ default => sub { [] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
19 3 traits => ['Array'],
20 handles => {
21 add_link => 'push',
22 all_links => 'elements',
23 number_of_links => 'count',
24 },
25  
26 );
27  
28 3 __PACKAGE__->meta->make_immutable;
29  
30  
31 0 ▶sub new_from_data {
Subroutine new_from_data: not called CC=3 SCAR=24.8
Pod documented
32 0 my $class = shift;
33 0 ▶ my $data = shift || croak 'Requires an array ref of data from the API';
Condition0%0/2
shift() || croak('Requires an array ref of data from the API')
l!l
00
MC/DC0%0/1
shift() || croak('Requires an array ref of data from the API')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
34  
35 0 my $self = $class->new;
36 0 foreach ( @{$data} ) {
37 0 $self->add_link( WWW::SEOmoz::Link->new_from_data( $_ ) );
38 }
39  
40 0 return $self;
41 }
42  
43  
44 3 1;
45  
46 __END__
↑ Summary SEOmoz.pm »