blib/lib/BZ/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
« blib/lib/BZ/Client/API.pm ↑ Summary blib/lib/BZ/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.4001';
9 sub new {
10 0 ▶ my $class = shift;
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
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 sub init {
18 0 ▶ my($self,$parser) = @_;
Subroutine init: not called CC=1 SCAR=6.9
Pod undocumented
19 0 $self->parser($parser);
20 }
21  
22 sub parser {
23 0 ▶ my $self = shift;
Subroutine parser: not called CC=2 SCAR=17.9
Pod undocumented
24 0 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) { } 0 0 0
25 0 $self->{'parser'} = shift;
26 } else {
27 0 return $self->{'parser'};
28 }
29 }
30  
31 sub level {
32 0 ▶ my $self = shift;
Subroutine level: not called CC=2 SCAR=17.9
Pod undocumented
33 0 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) { } 0 0 0
34 0 $self->{'level'} = shift;
35 } else {
36 0 return $self->{'level'};
37 }
38 }
39  
40 sub inc_level {
41 0 ▶ my $self = shift;
Subroutine inc_level: not called CC=1 SCAR=6.9
Pod undocumented
42 0 my $res = $self->{'level'}++;
43 0 return $res
44 }
45  
46 sub dec_level {
47 0 ▶ my $self = shift;
Subroutine dec_level: not called CC=1 SCAR=6.9
Pod undocumented
48 0 my $res = --$self->{'level'};
49 0 return $res
50 }
51  
52 sub error {
53 0 ▶ my($self, $msg) = @_;
Subroutine error: not called CC=1 SCAR=6.9
Pod undocumented
54 0 $self->parser()->error($msg);
55 }
56  
57 sub characters {
58 0 ▶ my($self, $text) = @_;
Subroutine characters: not called CC=2 SCAR=17.9
Pod undocumented
59 0 ▶ if ($text !~ /^\s*$/s) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $text =~ /^\s*$/s) 0 0 0
60 0 $self->error("Unexpected non-whitespace: $text");
61 }
62 }
63  
64 sub end {
65 # my($self,$name) = @_;
66 0 ▶ my $self = shift;
Subroutine end: not called CC=2 SCAR=17.9
Pod undocumented
67 0 my $l = $self->dec_level();
68 0 ▶ if ($l == 0) {
Branch: 1 branch
BranchTrueFalseTotal
if ($l == 0) 0 0 0
69 0 $self->parser()->remove($self);
70 }
71 0 return $l
72 }
73  
74 1 1;
75  
76 __END__
77  
78 =pod
79  
80 =encoding UTF-8
81  
82 =head1 NAME
83  
84 BZ::Client::XMLRPC::Handler - Abstract event handler for parsing an XML-RPC response.
85  
86 =head1 VERSION
87  
88 version 4.4001
89  
90 =head1 AUTHORS
91  
92 =over 4
93  
94 =item *
95  
96 Dean Hamstead <dean@bytefoundry.com.au>
97  
98 =item *
99  
100 Jochen Wiedmann <jochen.wiedmann@gmail.com>
101  
102 =back
103  
104 =head1 COPYRIGHT AND LICENSE
105  
106 This software is copyright (c) 2017 by Dean Hamstad.
107  
108 This is free software; you can redistribute it and/or modify it under
109 the same terms as the Perl 5 programming language system itself.
110  
111 =cut
« blib/lib/BZ/Client/API.pm ↑ Summary blib/lib/BZ/Client/BugUserLastVisit.pm »