| 1 | package XML::MyXML::Util; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 6 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 6 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 6 | require Exporter; | |||||||||||||||||||||||||||
| 7 | 6 | our @ISA = ('Exporter'); | |||||||||||||||||||||||||||
| 8 | 6 | our @EXPORT_OK = qw/ trim strip_ns debug /; | |||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 6 | our $VERSION = "1.11"; | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 2 | ▶ | sub trim { | ||||||||||||||||||||||||||
|
Subroutine
trim: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 13 | 2 | my $string = shift; | |||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 2 | ▶ | if (defined $string) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 16 | 2 | $string =~ s/^\s+//; | |||||||||||||||||||||||||||
| 17 | 2 | $string =~ s/\s+$//; | |||||||||||||||||||||||||||
| 18 | } | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 2 | return $string; | |||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 3 | ▶ | sub strip_ns { | ||||||||||||||||||||||||||
|
Subroutine
strip_ns: called CC=4 SCAR=14.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 24 | 3 | my $string = shift; | |||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 3 | ▶ | defined $string or return undef; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 3 | my $num_colons = () = $string =~ /\:/g; | |||||||||||||||||||||||||||
| 29 | 3 | ▶ | if ($num_colons == 1 and $string =~ /.\:./) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$num_colons == 1 and $string =~ /.\:./
MC/DC50%1/2
$num_colons == 1 and $string =~ /.\:./
$num_colons == 1
$string =~ /.\:./
Truth table66%2/3
A and B
A= $num_colons == 1B= $string =~ /.\:./
| |||||||||||||||||||||||||||||
| 30 | 2 | $string =~ s/^.+\://; | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 3 | return $string; | |||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 0 | ▶ | sub debug { | ||||||||||||||||||||||||||
|
Subroutine
debug: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 37 | 0 | my $thing = shift; | |||||||||||||||||||||||||||
| 38 | 0 | require Data::Dumper; | |||||||||||||||||||||||||||
| 39 | 0 | ▶ | warn Data::Dumper::Dumper($thing) if $ENV{DEBUG}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | 6 | 1; | |||||||||||||||||||||||||||