script/RomanDate

filter: Statementstmt 84.2% 16 / 19 Branchbran 33.3% 2 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod n/a totaltotal 72.4% 21 / 29 CC 1 SCAR 2.2
CC
1
Cov
72%
usage
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« lib/Date/Roman.pm ↑ Summary
1 #!/usr/local/bin/perl -w
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use Date::Roman;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use Getopt::Long qw(:config require_order);
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 my %args = ();
6  
7 2 ▶GetOptions ("args=s" => \%args) || die "Bad options to RomanDate";;
Branch: 1 branch
BranchTrueFalseTotal
&GetOptions("args=s", \%args) or die "Bad options to RomanDate" 2 0 2
8  
9 2 my $date;
10  
11 2 ▶if (@ARGV == 3) {
Branch: 2 branches
BranchTrueFalseTotal
if (@ARGV == 3) { } 2 0 2
elsif (@ARGV == 0) { } 0 0 0
12 2 my ($day,$month,$year) = @ARGV;
13 2 $date = Date::Roman->new(day => $day, month => $month, year => $year);
14 }
15 elsif (@ARGV == 0) {
16 0 $date = Date::Roman->new();
17 }
18 else {
19 0 die "Bad parameter number";
20 }
21 2 print $date->as_string(%args),"\n";
22  
23 0 ▶sub usage {
Subroutine usage: not called CC=1 SCAR=6.9
24  
25 0 print STDERR<<EOU;
26 usage: $0 [--args arg=value ...] [day month year]
27  
28 EOU
29  
30 }
31  
32 __END__
« lib/Date/Roman.pm ↑ Summary