blib/lib/File/ShouldUpdate.pm

filter: Statementstmt 96.4% 27 / 28 Branchbran 66.6% 4 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 1 / 1 totaltotal 92.6% 38 / 41 CC 5 SCAR 11.3
CC
5
Cov
91%
should_update
5.2
BEGIN
1.0
BEGIN
1.0
CRAP 3.1
« Build ↑ Summary
1 package File::ShouldUpdate;
2 2 $File::ShouldUpdate::VERSION = '0.0.1';
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use Time::HiRes qw/ stat /;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 ▶use parent 'Exporter';
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use vars qw/ @EXPORT_OK /;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 @EXPORT_OK = qw/ should_update /;
10  
11 sub should_update
12 {
13 2 ▶ my ( $filename2, $syntax_sugar, @deps ) = @_;
Subroutine should_update: called CC=5 SCAR=16.4
Pod documented
14 2 ▶ if ( $syntax_sugar ne ":" )
Branch: 1 branch
BranchTrueFalseTotal
if ($syntax_sugar ne ":") 0 2 2
15 {
16 0 die qq#wrong syntax_sugar - not ":"!#;
17 }
18 2 my @stat2 = stat($filename2);
19 2 ▶ if ( !@stat2 )
Branch: 1 branch
BranchTrueFalseTotal
unless (@stat2) 1 1 2
20 {
21 1 return 1;
22 }
23 1 foreach my $d (@deps)
24 {
25 2 my @stat1 = stat($d);
26 2 ▶ return 1 if ( $stat1[9] > $stat2[9] );
Branch: 1 branch
BranchTrueFalseTotal
if $stat1[9] > $stat2[9] 0 2 2
27 }
28 1 return 0;
29 }
30  
31 2 1;
32  
33 __END__
« Build ↑ Summary