StreamSend/Response.pm

filter: Statementstmt 37.0% 10 / 27 Branchbran 12.5% 1 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 3 / 6 Podpod 0.0% 0 / 3 totaltotal 31.8% 14 / 44 CC 6 SCAR 22.0
CC
6
Cov
31%
fields
20.0
AUTOLOAD
4.5
new
2.0
CRAP 9.1
« StreamSend.pm ↑ Summary StreamSend/Audience.pm »
1 package WWW::StreamSend::Response;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
7 0 my ($class, $params) = @_;
8 my $self = {
9 data => $params->{data},
10 xml => $params->{xml},
11 0 };
12 0 bless $self => $class;
13 0 return $self;
14 }
15  
16 0 ▶sub as_xml {
Subroutine as_xml: not called CC=1 SCAR=6.9
Pod undocumented
17 0 my ($self) = @_;
18 0 return $self->{xml};
19 }
20  
21 0 ▶sub fields {
Subroutine fields: not called CC=4 SCAR=30.0
Pod undocumented
22 0 my ($self) = @_;
23 0 my @out = ();
24 0 foreach my $key (keys %{$self->{data}}) {
25 0 ▶ next if (ref $self->{data}{$key}[0] ne ref {});
Branch: 1 branch
BranchTrueFalseTotal
if ref $self->{"data"}{$key}[0] ne ref {} 0 0 0
26 0 ▶ next unless ($self->{data}{$key}[0]{content});
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"data"}{$key}[0]{"content"} 0 0 0
27 0 $key=~s/-/_/g;
28 0 push @out, $key;
29 }
30 0 return @out;
31 }
32  
33 # all unknown methods are accessors
34 124498 ▶sub UNIVERSAL::AUTOLOAD {
Subroutine AUTOLOAD: called CC=3 SCAR=15.1
35 124498 my ($self) = @_;
36 124498 my ($methodname) = $UNIVERSAL::AUTOLOAD =~ /.*::(.*)/;
37 124498 ▶ return if $methodname eq 'DESTROY';
Branch: 1 branch
BranchTrueFalseTotal
if $methodname eq "DESTROY" 124498 0 124498
38 0 $methodname=~s/_/-/g;
39 0 ▶ return (exists $self->{data}->{$methodname}) ? $self->{data}{$methodname}[0]{content} : undef;
Branch: 1 branch
BranchTrueFalseTotal
exists $self->{'data'}{$methodname} ? : 0 0 0
40 }
41  
42 1 1;
« StreamSend.pm ↑ Summary StreamSend/Audience.pm »