DBus/Address.pm

filter: Statementstmt 95.6% 22 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 4 totaltotal 85.2% 29 / 34 SCAR 6.9
CC
2
Cov
96%
parse
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« DBus/Authn/Mechanism.pm ↑ Summary DBus/X.pm »
1 package Protocol::DBus::Address;
2  
3 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 7 ▶use Call::Context;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 # Not a very choosy parser, and it doesn’t try to validate anything.
9 sub parse {
10 4 ▶ Call::Context::must_be_list();
Subroutine parse: called CC=2 SCAR=7.0
Pod undocumented
11  
12 return map {
13 4 my $str = $_;
14  
15 5 my $xport = substr( $_, 0, 1 + index($_, ':'), q<> );
16 5 chop $xport;
17  
18 my %kvs = (
19 5 map { split m<=>, $_ } (split m<,>, $_),
20 );
21  
22 5 s<%(..)><chr hex $1>ge for values %kvs;
23  
24 5 bless { _str => $str, _transport => $xport, _attrs => \%kvs }, __PACKAGE__;
25 } ( split m<;>, $_[0] );
26 }
27  
28 #----------------------------------------------------------------------
29  
30 sub transport {
31 5 ▶ return $_[0]{'_transport'};
Subroutine transport: called CC=1 SCAR=0.0
Pod undocumented
32 }
33  
34 sub to_string {
35 3 ▶ return $_[0]{'_str'};
Subroutine to_string: called CC=1 SCAR=0.0
Pod undocumented
36 }
37  
38 sub attribute {
39 8 ▶ return $_[0]{'_attrs'}{$_[1]};
Subroutine attribute: called CC=1 SCAR=0.0
Pod undocumented
40 }
41  
42 7 1;
« DBus/Authn/Mechanism.pm ↑ Summary DBus/X.pm »