lib/Ftree/StringUtils.pm

filter: Statementstmt 100% 22 / 22 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 3 totaltotal 88.2% 30 / 34 CC 2 SCAR 2.4
CC
2
Cov
96%
trim
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« lib/Ftree/SettingsFactory.pm ↑ Summary lib/Ftree/PerlSettingsImporter.pm »
1 #!/usr/bin/perl -w
2
3 package Ftree::StringUtils;
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Params::Validate qw(:all);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use version; our $VERSION = qv('2.3.41');
Subroutine BEGIN: called CC=1 SCAR=0.0
8
9 # Perl trim function to remove whitespace from the start and end of the string
10 sub trim
11 13 ▶{
Subroutine trim: called CC=2 SCAR=7.2
Pod undocumented
12 13 my ($string) = validate_pos(@_, {type => SCALAR|UNDEF});
13 13 ▶ return rtrim(ltrim($string)) if (defined $string);
Branch: 1 branch
BranchTrueFalseTotal
if defined $string 13 0 13
14 }
15 # Left trim function to remove leading whitespace
16 sub ltrim
17 13 ▶{
Subroutine ltrim: called CC=1 SCAR=0.0
Pod undocumented
18 13 my ($string) = validate_pos(@_, {type => SCALAR|UNDEF});
19 13 $string =~ s/^\s+//;
20 13 return $string;
21 }
22 # Right trim function to remove trailing whitespace
23 sub rtrim
24 13 ▶{
Subroutine rtrim: called CC=1 SCAR=0.0
Pod undocumented
25 13 my ($string) = validate_pos(@_, {type => SCALAR|UNDEF});;
26 13 $string =~ s/\s+$//;
27 13 return $string;
28 }
29
30 2 1;
« lib/Ftree/SettingsFactory.pm ↑ Summary lib/Ftree/PerlSettingsImporter.pm »