SEOmoz/Link.pm

filter: Statementstmt 85.0% 17 / 20 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 75.0% 21 / 28 CC 2 SCAR 11.0
CC
2
Cov
77%
new_from_data
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« SEOmoz.pm ↑ Summary SEOmoz/URLMetrics.pm »
1 # ABSTRACT: Class to represent a link returned from the SEOmoz API.
2 package WWW::SEOmoz::Link;
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 our $VERSION = '0.03'; # VERSION
10  
11  
12 3 has 'target_url' => (
13 isa => 'Str|Undef',
14 is => 'ro',
15 );
16  
17  
18 3 has 'source_url' => (
19 isa => 'Str|Undef',
20 is => 'ro',
21 );
22  
23  
24 3 has 'link_id' => (
25 isa => 'Int|Undef',
26 is => 'ro',
27 );
28  
29  
30 3 has 'source_url_id' => (
31 isa => 'Int|Undef',
32 is => 'ro',
33 );
34  
35  
36 3 has 'target_url_id' => (
37 isa => 'Int|Undef',
38 is => 'ro',
39 );
40  
41 3 __PACKAGE__->meta->make_immutable;
42  
43  
44 0 ▶sub new_from_data {
Subroutine new_from_data: not called CC=2 SCAR=17.9
Pod documented
45 0 my $class = shift;
46 0 ▶ my $data = shift || croak 'Requires a hash ref of data returned from the API';
Condition0%0/2
shift() || croak('Requires a hash ref of data returned from the API')
l!l
00
MC/DC0%0/1
shift() || croak('Requires a hash ref of data returned from the API')
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
47  
48 return $class->new({
49 target_url => $data->{luuu},
50 source_url => $data->{uu},
51 link_id => $data->{lrid},
52 source_url_id => $data->{lsrc},
53 target_url_id => $data->{ltgt},
54 0 });
55 }
56  
57  
58 3 1;
59  
60 __END__
« SEOmoz.pm ↑ Summary SEOmoz/URLMetrics.pm »