Local/Distribution/Role/MD5.pm

filter: Statementstmt 80.0% 16 / 20 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod n/a totaltotal 74.0% 20 / 27 CC 2 SCAR 9.8
CC
2
Cov
73%
_build_md5
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.7
« Local/App/Command/init.pm ↑ Summary Local/Distribution.pm »
1 package CPAN::Local::Distribution::Role::MD5;
2 {
3 1 $CPAN::Local::Distribution::Role::MD5::VERSION = '0.010';
4 }
5  
6 # ABSTRACT: Calculate checksums for a distribution
7  
8 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Digest::MD5;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 has md5 => ( is => 'ro', isa => 'Str', lazy_build => 1 );
14  
15 sub _build_md5
16 0 ▶{
Subroutine _build_md5: not called CC=2 SCAR=17.9
17 0 my $self = shift;
18 0 ▶ my $fh = file($self->filename)->open or die $!;
Branch: 1 branch
BranchTrueFalseTotal
my $fh = file($self->filename)->open or die $! 0 0 0
19 0 binmode $fh;
20 0 return Digest::MD5->new->addfile($fh)->hexdigest;
21 }
22  
23 1 1;
24  
25  
26 __END__
« Local/App/Command/init.pm ↑ Summary Local/Distribution.pm »