blib/script/rename

filter: Statementstmt 96.3% 26 / 27 Branchbran 56.2% 9 / 16 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 83.6% 41 / 49 CC 8 SCAR 16.3
CC
8
Cov
81%
main
8.3
mod_version
2.0
BEGIN
1.0
CRAP 5.1
« blib/lib/File/Rename.pm ↑ Summary blib/lib/File/Rename/Options.pm »
1 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 6 ▶use File::Rename; # REQUIRE_ORDER
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use Pod::Usage;
Subroutine BEGIN: called CC=1 SCAR=0.0
5
6 6 ▶main() unless caller;
Branch: 1 branch
BranchTrueFalseTotal
unless caller 0 6 6
7
8 sub main {
9 10 ▶ my $options = File::Rename::Options::GetOptions()
Subroutine main: called CC=7 SCAR=21.2
Branch: 1 branch
BranchTrueFalseTotal
my $options = File::Rename::Options::GetOptions() or pod2usage() 0 10 10
10 or pod2usage;
11
12 10 ▶ pod2usage( -verbose => 0,
Branch: 1 branch
BranchTrueFalseTotal
if File::Rename::Options::bad_encoding($options) 0 10 10
13 -exitval => 'NOEXIT',
14 -message => <<'MESSAGE',
15 -u|--unicode argument does not look like an encoding:
16 either give an encoding or put -e as next option
17 MESSAGE
18 ) if File::Rename::Options::bad_encoding($options);
19
20 10 ▶ mod_version() if $options->{show_version};
Branch: 1 branch
BranchTrueFalseTotal
if $options->{"show_version"} 1 9 10
21 9 ▶ pod2usage( -verbose => 2 ) if $options->{show_manual};
Branch: 1 branch
BranchTrueFalseTotal
if $options->{"show_manual"} 0 9 9
22 9 ▶ pod2usage( -exitval => 1 ) if $options->{show_help};
Branch: 1 branch
BranchTrueFalseTotal
if $options->{"show_help"} 0 9 9
23
24 9 ▶ @ARGV = map {glob} @ARGV if $^O =~ m{Win}msx;
Branch: 1 branch
BranchTrueFalseTotal
if $^O =~ /Win/msx 0 9 9
25
26 9 File::Rename::rename(\@ARGV, $options);
27 }
28
29 sub mod_version {
30 1 ▶ print __FILE__;
Subroutine mod_version: called CC=2 SCAR=7.0
31 1 print ' using File::Rename version '. $File::Rename::VERSION;
32 1 ▶ print ', File::Rename::Options version '. $File::Rename::Options::VERSION
Branch: 1 branch
BranchTrueFalseTotal
if eval $File::Rename::Options::VERSION < eval $File::Rename::VERSION 1 0 1
33 if (eval $File::Rename::Options::VERSION) < (eval $File::Rename::VERSION);
34 # ignore $File::Rename::Unicode::VERSION
35 1 print "\n\n";
36 1 exit 0
37 }
38
39 6 1;
40
41 __END__
« blib/lib/File/Rename.pm ↑ Summary blib/lib/File/Rename/Options.pm »