WSDL/Attr.pm

filter: Statementstmt 100% 25 / 25 Branchbran 100% 12 / 12 Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 100% 45 / 45 CC 8 SCAR 18.1
CC
8
Cov
100%
new
8.0
BEGIN
1.0
BEGIN
1.0
CRAP 6.1
« WSDL/Param.pm ↑ Summary WSDL/Return.pm »
1 package Pod::WSDL::Attr;
2 9 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 9 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 9 ▶use Pod::WSDL::AUTOLOAD;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 9 our $VERSION = "0.05";
7 9 our @ISA = qw/Pod::WSDL::AUTOLOAD/;
8  
9 9 our %FORBIDDEN_METHODS = (
10 name => {get => 1, set => 0},
11 type => {get => 1, set => 0},
12 nillable => {get => 1, set => 0},
13 descr => {get => 1, set => 0},
14 array => {get => 1, set => 0},
15 );
16  
17 14 ▶sub new {
Subroutine new: called CC=8 SCAR=20.8
Pod documented
18 14 my ($pkg, $str) = @_;
19  
20 14 ▶ defined $str or $str = ''; # avoids warnings
Branch: 1 branch
BranchTrueFalseTotal
defined $str or $str = "" 13 1 14
21 14 ▶ $str =~ s/\s*_ATTR\s*//i or die "Input string '$str' does not begin with '_ATTR'";
Branch: 1 branch
BranchTrueFalseTotal
$str =~ s/\s*_ATTR\s*//i or die "Input string '${str}' does not begin with '_ATTR'" 12 2 14
22 12 my ($name, $type, $needed, $descr) = split /\s+/, $str, 4;
23  
24 12 ▶ $descr ||= '';
Condition100%2/2
$descr ||= ""
l!l
111
MC/DC100%1/1
$descr ||= ""
$descr
Truth table100%2/2
A
A= $descr
Aresult
11
00
25
26 12 ▶ if ((uc $needed) ne '_NEEDED') {
Branch: 1 branch
BranchTrueFalseTotal
if (uc $needed ne '_NEEDED') { } 4 8 12
27 4 $descr = "$needed $descr";
28 4 $needed = 0;
29 } else {
30 8 $needed = 1;
31 }
32
33 12 $type =~ /([\$\@])(.*)/;
34 12 ▶ die "Type '$type' must be prefixed with either '\$' or '\@', died" unless $1;
Branch: 1 branch
BranchTrueFalseTotal
unless $1 1 11 12
35
36 11 ▶ bless {
Branch: 2 branches
BranchTrueFalseTotal
$needed ? : 7 4 11
$1 eq '@' ? : 3 8 11
37 _name => $name,
38 _type => $2,
39 _nillable => $needed ? undef : 'true',
40 _descr => $descr,
41 _array => $1 eq '@' ? 1 : 0,
42 }, $pkg;
43 }
44  
45 9 1;
46 __END__
« WSDL/Param.pm ↑ Summary WSDL/Return.pm »