WSDL/Param.pm

filter: Statementstmt 100% 22 / 22 Branchbran 100% 8 / 8 Conditioncond 71.4% 5 / 7 MC/DCmcdc 50.0% 2 / 4 Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 91.3% 42 / 46 CC 8 SCAR 18.1
CC
8
Cov
95%
new
8.0
BEGIN
1.0
BEGIN
1.0
CRAP 6.1
« WSDL/AUTOLOAD.pm ↑ Summary WSDL/Attr.pm »
1 package Pod::WSDL::Param;
2 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 8 ▶use Pod::WSDL::AUTOLOAD;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 8 our $VERSION = "0.05";
7 8 our @ISA = qw/Pod::WSDL::AUTOLOAD/;
8  
9 8 our %FORBIDDEN_METHODS = (
10 name => {get => 1, set => 0},
11 type => {get => 1, set => 0},
12 paramType => {get => 1, set => 0},
13 descr => {get => 1, set => 0},
14 array => {get => 1, set => 0},
15 );
16  
17 11 ▶sub new {
Subroutine new: called CC=8 SCAR=20.8
Pod documented
18 11 my ($pkg, $str) = @_;
19  
20 11 ▶ defined $str or $str = ''; # avoids warnings, dies soon
Branch: 1 branch
BranchTrueFalseTotal
defined $str or $str = "" 10 1 11
21 11 ▶ $str =~ s/\s*_(INOUT|IN|OUT)\s*//i or die "Input string '$str' does not begin with '_IN', '_OUT' or '_INOUT'";
Branch: 1 branch
BranchTrueFalseTotal
$str =~ s/\s*_(INOUT|IN|OUT)\s*//i or die "Input string '${str}' does not begin with '_IN', '_OUT' or '_INOUT'" 9 2 11
22
23 9 my $paramType = $1;
24
25 9 my ($name, $type, $descr) = split /\s+/, $str, 3;
26  
27 9 ▶ $type ||= ''; # avoids warnings, dies soon
Condition50%1/2
$type ||= ""
l!l
90
MC/DC0%0/1
$type ||= ""
$type
Truth table50%1/2
A
A= $type
Aresult
11
00
28
29 9 $type =~ /([\$\@])(.+)/;
30 9 ▶ die "Type '$type' must have structure (\$|@)<typename>, e.g. '\$boolean' or '\@string', not '$type' died" unless $1 and $2;
Branch: 1 branch
BranchTrueFalseTotal
unless $1 and $2 1 8 9
Condition66%2/3
$1 and $2
!ll&&!rl&&r
018
MC/DC50%1/2
$1 and $2
$1 $2
Truth table66%2/3
A and B
A= $1B= $2
ABresult
0X0
100
111
31
32 8 ▶ bless {
Branch: 1 branch
BranchTrueFalseTotal
$1 eq '@' ? : 4 4 8
Condition100%2/2
$descr || ''
l!l
53
MC/DC100%1/1
$descr || ''
$descr
Truth table100%2/2
A
A= $descr
Aresult
11
00
33 _name => $name,
34 _type => $2,
35 _paramType => $paramType,
36 _descr => $descr || '',
37 _array => $1 eq '@' ? 1 : 0,
38 }, $pkg;
39 }
40  
41 8 1;
42 __END__
« WSDL/AUTOLOAD.pm ↑ Summary WSDL/Attr.pm »