Lite/Provider/Discover.pm

filter: Statementstmt 62.0% 18 / 29 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 57.1% 4 / 7 Podpod 0.0% 0 / 1 totaltotal 45.8% 22 / 48 CC 5 SCAR 26.6
CC
5
Cov
47%
discover
30.0
_build__fetcher
2.0
_build__parser
2.0
CRAP 14.4
« Lite/Message/Decoder/Hash.pm ↑ Summary Lite/Provider/AssociationBuilder.pm »
1 package OpenID::Lite::Provider::Discover;
2  
3 2 ▶use Any::Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use OpenID::Lite::Provider::Discover::Parser;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use OpenID::Lite::RelyingParty::Discover::Fetcher::Yadis;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 with 'OpenID::Lite::Role::AgentHandler';
7 2 with 'OpenID::Lite::Role::ErrorHandler';
8  
9 2 has '_fetcher' => (
10 is => 'ro',
11 lazy_build => 1,
12 );
13  
14 2 has '_parser' => (
15 is => 'ro',
16 lazy_build => 1,
17 );
18  
19 0 ▶sub discover {
Subroutine discover: not called CC=5 SCAR=34.0
Pod undocumented
20 0 my ( $self, $rp_realm_url, $not_allow_redirection ) = @_;
21  
22 0 ▶ my $result = $self->_fetcher->fetch($rp_realm_url)
Branch: 1 branch
BranchTrueFalseTotal
my $result = $self->_fetcher->fetch($rp_realm_url) or return $self->ERROR($self->_fetcher->errstr) 0 0 0
23 or return $self->ERROR( $self->_fetcher->errstr );
24  
25 # when discovery is carried out for validating realm,
26 # must not allow redirection.
27 0 ▶ return $self->ERROR(q{redirected.})
Branch: 1 branch
BranchTrueFalseTotal
if $not_allow_redirection and $rp_realm_url ne $result->final_url 0 0 0
Condition0%0/3
$not_allow_redirection and $rp_realm_url ne $result->final_url
!ll&&!rl&&r
000
MC/DC0%0/2
$not_allow_redirection and $rp_realm_url ne $result->final_url
$not_allow_redirection $rp_realm_url ne $result->final_url
Truth table0%0/3
A and B
A= $not_allow_redirectionB= $rp_realm_url ne $result->final_url
ABresult
0X0
100
111
28 if ( $not_allow_redirection && $rp_realm_url ne $result->final_url );
29  
30 0 ▶ my $return_to_urls = $self->_parser->parse($result)
Branch: 1 branch
BranchTrueFalseTotal
my $return_to_urls = $self->_parser->parse($result) or return $self->ERROR($self->_parser->errstr) 0 0 0
31 or return $self->ERROR( $self->_parser->errstr );
32 0 return $return_to_urls;
33  
34 }
35  
36 0 ▶sub _build__fetcher {
Subroutine _build__fetcher: not called CC=1 SCAR=6.9
37 0 my $self = shift;
38 0 my $fetcher = OpenID::Lite::RelyingParty::Discover::Fetcher::Yadis->new(
39 agent => $self->agent );
40 0 return $fetcher;
41 }
42  
43 0 ▶sub _build__parser {
Subroutine _build__parser: not called CC=1 SCAR=6.9
44 0 my $self = shift;
45 0 my $parser = OpenID::Lite::Provider::Discover::Parser->new;
46 0 return $parser;
47 }
48  
49 2 ▶no Any::Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
50 2 __PACKAGE__->meta->make_immutable;
51 2 1;
52  
« Lite/Message/Decoder/Hash.pm ↑ Summary Lite/Provider/AssociationBuilder.pm »