Client/XMLRPC/Handler.pm

filter: Statementstmt 20.5% 8 / 39 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 18.1% 2 / 11 Podpod 0.0% 0 / 9 totaltotal 13.8% 10 / 72 CC 6 SCAR 14.8
CC
6
Cov
16%
new
6.0
parser
6.0
level
6.0
CRAP 4.4
« Client/API.pm ↑ Summary Client/BugUserLastVisit.pm »
1 #!/bin/false
2 # PODNAME: BZ::Client::XMLRPC::Handler
3 # ABSTRACT: Abstract event handler for parsing an XML-RPC response.
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 package BZ::Client::XMLRPC::Handler;
8 1 $BZ::Client::XMLRPC::Handler::VERSION = '4.91';
9 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
10 0 my $class = shift;
11 0 my $self = { @_ };
12 0 $self->{'level'} = 0;
13 0 ▶ bless($self, ref($class) || $class);
Condition0%0/3
ref $class || $class
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table0%0/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
14 0 return $self
15 }
16  
17 0 ▶sub init {
Subroutine init: not called CC=1 SCAR=6.9
Pod undocumented
18 0 my($self,$parser) = @_;
19 0 $self->parser($parser);
20 }
21  
22 0 ▶sub parser {
Subroutine parser: not called CC=2 SCAR=17.9
Pod undocumented
23 0 my $self = shift;
24 0 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) { } 0 0 0
25 0 $self->{'parser'} = shift;
26 }
27 else {
28 0 return $self->{'parser'};
29 }
30 }
31  
32 0 ▶sub level {
Subroutine level: not called CC=2 SCAR=17.9
Pod undocumented
33 0 my $self = shift;
34 0 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) { } 0 0 0
35 0 $self->{'level'} = shift;
36 }
37 else {
38 0 return $self->{'level'};
39 }
40 }
41  
42 0 ▶sub inc_level {
Subroutine inc_level: not called CC=1 SCAR=6.9
Pod undocumented
43 0 my $self = shift;
44 0 my $res = $self->{'level'}++;
45 0 return $res
46 }
47  
48 0 ▶sub dec_level {
Subroutine dec_level: not called CC=1 SCAR=6.9
Pod undocumented
49 0 my $self = shift;
50 0 my $res = --$self->{'level'};
51 0 return $res
52 }
53  
54 0 ▶sub error {
Subroutine error: not called CC=1 SCAR=6.9
Pod undocumented
55 0 my($self, $msg) = @_;
56 0 $self->parser()->error($msg);
57 }
58  
59 0 ▶sub characters {
Subroutine characters: not called CC=2 SCAR=17.9
Pod undocumented
60 0 my($self, $text) = @_;
61 0 ▶ if ($text !~ m/^\s*$/s) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $text =~ /^\s*$/s) 0 0 0
62 0 $self->error("Unexpected non-whitespace: $text");
63 }
64 }
65  
66 0 ▶sub end {
Subroutine end: not called CC=2 SCAR=17.9
Pod undocumented
67 0 my $self = shift;
68 0 my $l = $self->dec_level();
69 0 ▶ if ($l == 0) {
Branch: 1 branch
BranchTrueFalseTotal
if ($l == 0) 0 0 0
70 0 $self->parser()->remove($self);
71 }
72 0 return $l
73 }
74  
75 1 1;
76  
77 __END__
« Client/API.pm ↑ Summary Client/BugUserLastVisit.pm »