| 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
MC/DC0%0/2
ref $class || $class
ref $class
$class
Truth table0%0/3
A || B
A= ref $classB= $class
| |||||||||||||||||||||
| 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
| |||||||||||||||||||||
| 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
| |||||||||||||||||||||
| 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
| |||||||||||||||||||||
| 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
| |||||||||||||||||||||
| 70 | 0 | $self->parser()->remove($self); | |||||||||||||||||||
| 71 | } | ||||||||||||||||||||
| 72 | 0 | return $l | |||||||||||||||||||
| 73 | } | ||||||||||||||||||||
| 74 | |||||||||||||||||||||
| 75 | 1 | 1; | |||||||||||||||||||
| 76 | |||||||||||||||||||||
| 77 | __END__ | ||||||||||||||||||||