lib/SOAP/Transport/IO.pm

filter: Statementstmt 97.9% 47 / 48 Branchbran 77.7% 14 / 18 Conditioncond 58.3% 7 / 12 MC/DCmcdc 33.3% 2 / 6 Subroutinesub 100% 11 / 11 Podpod n/a totaltotal 85.2% 81 / 95 CC 14 SCAR 14.3
CC
14
Cov
87%
out
7.3
in
6.0
handle
3.1
CRAP 4.2
« lib/SOAP/Transport/MAILTO.pm ↑ Summary lib/SOAP/Transport/LOCAL.pm »
1 # ======================================================================
2 #
3 # Copyright (C) 2000-2001 Paul Kulchenko (paulclinger@yahoo.com)
4 # SOAP::Lite is free software; you can redistribute it
5 # and/or modify it under the same terms as Perl itself.
6 #
7 # ======================================================================
8  
9 package SOAP::Transport::IO;
10  
11 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 2 our $VERSION = '1.27'; # VERSION
14  
15 2 ▶use IO::File;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 2 ▶use SOAP::Lite;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 # ======================================================================
18  
19 package SOAP::Transport::IO::Server;
20  
21 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 2 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
23 2 ▶use vars qw(@ISA);
Subroutine BEGIN: called CC=1 SCAR=0.0
24 2 @ISA = qw(SOAP::Server);
25  
26 27 ▶sub new {
Subroutine new: called CC=2 SCAR=6.9
27 27 my $class = shift;
28  
29 27 ▶ return $class if ref $class;
Branch: 1 branch
BranchTrueFalseTotal
if ref $class 25 2 27
30 2 my $self = $class->SUPER::new(@_);
31  
32 2 return $self;
33 }
34  
35 7 ▶sub in {
Subroutine in: called CC=6 SCAR=17.9
36 7 my $self = shift;
37 7 ▶ $self = $self->new() if not ref $self;
Branch: 1 branch
BranchTrueFalseTotal
unless ref $self 1 6 7
38  
39 7 ▶ return $self->{ _in } if not @_;
Branch: 1 branch
BranchTrueFalseTotal
unless @_ 4 3 7
40  
41 3 my $file = shift;
42 3 ▶ $self->{_in} = (defined $file && !ref $file && !defined fileno($file))
Branch: 1 branch
BranchTrueFalseTotal
defined $file && !ref($file) && !defined(fileno $file) ? : 1 2 3
Condition83%5/6
defined $file and not ref $file and not defined fileno $file
!ll&&!rl&&r
201
defined $file and not ref $file
!ll&&!rl&&r
111
MC/DC66%2/3
defined $file and not ref $file and not defined fileno $file
defined $file not ref $file not defined fileno $file
Truth table75%3/4
A and not(B) and not(C)
A= defined $fileB= not ref $fileC= not defined fileno $file
ABCresult
0XX0
10X0
1100
1111
43 ? IO::File->new($file, 'r')
44 : $file;
45 3 return $self;
46 }
47  
48 3 ▶sub out {
Subroutine out: called CC=6 SCAR=19.9
49 3 my $self = shift;
50 3 ▶ $self = $self->new() if not ref $self;
Branch: 1 branch
BranchTrueFalseTotal
unless ref $self 0 3 3
51  
52 3 ▶ return $self->{ _out } if not @_;
Branch: 1 branch
BranchTrueFalseTotal
unless @_ 2 1 3
53  
54 1 my $file = shift;
55 1 ▶ $self->{_out} = (defined $file && !ref $file && !defined fileno($file))
Branch: 1 branch
BranchTrueFalseTotal
defined $file && !ref($file) && !defined(fileno $file) ? : 0 1 1
Condition33%2/6
defined $file and not ref $file and not defined fileno $file
!ll&&!rl&&r
100
defined $file and not ref $file
!ll&&!rl&&r
100
MC/DC0%0/3
defined $file and not ref $file and not defined fileno $file
defined $file not ref $file not defined fileno $file
Truth table25%1/4
A and not(B) and not(C)
A= defined $fileB= not ref $fileC= not defined fileno $file
ABCresult
0XX0
10X0
1100
1111
56 ? IO::File->new($file, 'w')
57 : $file;
58 1 return $self;
59 }
60  
61 2 ▶sub handle {
Subroutine handle: called CC=3 SCAR=11.2
62 2 my $self = shift->new;
63  
64 2 ▶ $self->in(*STDIN)->out(*STDOUT) unless defined $self->in;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->in 0 2 2
65 2 my $in = $self->in;
66 2 my $out = $self->out;
67  
68 2 my $result = $self->SUPER::handle(join '', <$in>);
69 2 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
70 0 ▶ print {$out} $result
Branch: 1 branch
BranchTrueFalseTotal
if defined $out 0 2 2
71 if defined $out;
72 2 return;
73 }
74  
75 # ======================================================================
76  
77 2 1;
78  
79 __END__
« lib/SOAP/Transport/MAILTO.pm ↑ Summary lib/SOAP/Transport/LOCAL.pm »