blib/lib/Web/ID/SAN.pm

filter: Statementstmt 89.5% 43 / 48 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 88.2% 15 / 17 Podpod 100% 3 / 3 totaltotal 87.5% 63 / 72 CC 3 SCAR 3.7
CC
3
Cov
87%
__ANON__
3.1
uri_object
2.0
to_string
2.0
CRAP 1.4
« blib/lib/Web/ID/SAN/URI.pm ↑ Summary blib/lib/Web/ID/Types.pm »
1 package Web::ID::SAN;
2  
3 3 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
7 3 $Web::ID::SAN::AUTHORITY = 'cpan:TOBYINK';
8 3 $Web::ID::SAN::VERSION = '1.927';
9 }
10  
11 3 ▶use Web::ID::Types -types;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 3 ▶use RDF::Query 2.900;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 3 ▶use URI 0;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 3 ▶use URI::Escape 0 qw/uri_escape/;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 3 ▶use Web::ID::RSAKey;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 3 ▶use Web::ID::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 3 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 3 ▶use namespace::sweep;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 has $_ => (
22 is => read_only,
23 isa => Str,
24 required => true,
25 coerce => false,
26 3 ) for qw(type value);
27  
28 3 has model => (
29 is => read_only,
30 isa => Model,
31 lazy_build => true,
32 );
33  
34 3 has key_factory => (
35 is => read_only,
36 isa => CodeRef,
37 lazy_build => true,
38 );
39  
40 sub _build_model
41 7 ▶{
Subroutine _build_model: called CC=1 SCAR=0.0
42 7 return Model->new;
43 }
44  
45 my $default_key_factory = sub
46 5 ▶{
Subroutine __ANON__: called CC=3 SCAR=11.4
47 5 my (%args) = @_;
48 5 ▶ return unless $args{exponent};
Branch: 1 branch
BranchTrueFalseTotal
unless $args{"exponent"} 0 5 5
49 5 ▶ return unless $args{modulus};
Branch: 1 branch
BranchTrueFalseTotal
unless $args{"modulus"} 0 5 5
50 5 Rsakey->new(%args);
51 3 };
52  
53 sub _build_key_factory
54 5 ▶{
Subroutine _build_key_factory: called CC=1 SCAR=0.0
55 5 return $default_key_factory;
56 }
57  
58 sub uri_object
59 0 ▶{
Subroutine uri_object: not called CC=1 SCAR=6.9
Pod documented
60 0 my ($self) = @_;
61 0 return Uri->coerce(sprintf 'urn:x-subject-alt-name:%s:%s', map {uri_escape $_} $self->type, $self->value);
62 }
63  
64 sub to_string
65 0 ▶{
Subroutine to_string: not called CC=1 SCAR=6.9
Pod documented
66 0 my ($self) = @_;
67 0 sprintf('%s=%s', $self->type, $self->value);
68 }
69  
70 sub associated_keys
71 7 ▶{
Subroutine associated_keys: called CC=1 SCAR=0.0
Pod documented
72 7 return;
73 }
74  
75 3 __PACKAGE__
76 __END__
« blib/lib/Web/ID/SAN/URI.pm ↑ Summary blib/lib/Web/ID/Types.pm »