puzzl/run.pm

filter: Statementstmt 53.3% 16 / 30 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 1 totaltotal 51.2% 21 / 41 CC 4 SCAR 19.2
CC
4
Cov
47%
run_day
14.1
BEGIN
1.0
BEGIN
1.0
CRAP 6.8
↑ Summary puzzl.pm »
1 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use v5.28;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 package App::puzzl::run;
4  
5 1 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Module::Load;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 0 ▶sub run_day {
Subroutine run_day: not called CC=4 SCAR=26.4
Pod undocumented
9 0 my ($day) = @_;
10  
11 0 ▶ if($day eq 'all') {
Branch: 1 branch
BranchTrueFalseTotal
if ($day eq "all") 0 0 0
12 0 ▶ my @days = glob("days/day*.pl");
Subroutine BEGIN: called CC=1 SCAR=0.2
13 0 foreach my $day_found (@days) {
14 0 run($day_found);
15 }
16 0 return;
17 }
18  
19 0 ▶ open(my $input_fh, "<", "input/day$day.txt") or die "failed to open input file input/day$day.txt";
Branch: 1 branch
BranchTrueFalseTotal
open my $input_fh, "<", "input/day$day.txt" or die "failed to open input file input/day$day.txt" 0 0 0
20 0 do "./days/day$day.pl";
21 0 say '=== PART 1 ===';
22 0 part1($input_fh);
23  
24 0 seek($input_fh, 0, 0);
25 0 say '=== PART 2 ===';
26 0 part2($input_fh);
27  
28 0 close($input_fh);
29 }
30  
31 1 our @EXPORT_OK = qw(run_day);
32  
33 1 1;
↑ Summary puzzl.pm »