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.9';
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 }
27 else {
28 0 return $self->{'parser'};
29 }
30 }
31  
32 sub level {
33 0 ▶ my $self = shift;
Subroutine level: not called CC=2 SCAR=17.9
Pod undocumented
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 sub inc_level {
43 0 ▶ my $self = shift;
Subroutine inc_level: not called CC=1 SCAR=6.9
Pod undocumented
44 0 my $res = $self->{'level'}++;
45 0 return $res
46 }
47  
48 sub dec_level {
49 0 ▶ my $self = shift;
Subroutine dec_level: not called CC=1 SCAR=6.9
Pod undocumented
50 0 my $res = --$self->{'level'};
51 0 return $res
52 }
53  
54 sub error {
55 0 ▶ my($self, $msg) = @_;
Subroutine error: not called CC=1 SCAR=6.9
Pod undocumented
56 0 $self->parser()->error($msg);
57 }
58  
59 sub characters {
60 0 ▶ my($self, $text) = @_;
Subroutine characters: not called CC=2 SCAR=17.9
Pod undocumented
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 sub end {
67 0 ▶ my $self = shift;
Subroutine end: not called CC=2 SCAR=17.9
Pod undocumented
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__
78  
79 =pod
80  
81 =encoding UTF-8
82  
83 =head1 NAME
84  
85 BZ::Client::XMLRPC::Handler - Abstract event handler for parsing an XML-RPC response.
86  
87 =head1 VERSION
88  
89 version 4.9
90  
91 =head1 AUTHORS
92  
93 =over 4
94  
95 =item *
96  
97 Dean Hamstead <dean@bytefoundry.com.au>
98  
99 =item *
100  
101 Jochen Wiedmann <jochen.wiedmann@gmail.com>
102  
103 =back
104  
105 =head1 COPYRIGHT AND LICENSE
106  
107 This software is copyright (c) 2026 by Dean Hamstad.
108  
109 This is free software; you can redistribute it and/or modify it under
110 the same terms as the Perl 5 programming language system itself.
111  
112 =cut
« blib/lib/BZ/Client/API.pm ↑ Summary blib/lib/BZ/Client/BugUserLastVisit.pm »