Librarian/Book.pm

filter: Statementstmt 100% 21 / 21 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 50.0% 1 / 2 totaltotal 91.1% 31 / 34 CC 3 SCAR 5.3
CC
3
Cov
92%
new
3.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.7
« Librarian/Library.pm ↑ Summary
1 package JSAN::Librarian::Book;
2  
3 # Implements a JavaScript::Librarian::Book. In our case, the id IS the path
4  
5 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Params::Util '_HASH0';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use JavaScript::Librarian::Book;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 ▶use vars qw{$VERSION @ISA};
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 $VERSION = '0.03';
12 2 @ISA = 'JavaScript::Librarian::Book';
13 }
14  
15  
16  
17  
18  
19 #####################################################################
20 # Constructor
21  
22 3 ▶sub new {
Subroutine new: called CC=3 SCAR=11.3
Pod documented
23 3 my $class = shift;
24 3 ▶ my $path = shift or return undef;
Branch: 1 branch
BranchTrueFalseTotal
my $path = shift() or return undef 3 0 3
25 3 ▶ my $deps = _HASH0(shift) or return undef;
Branch: 1 branch
BranchTrueFalseTotal
my $deps = &_HASH0(shift()) or return undef 3 0 3
26  
27 # Create the object
28 3 my $self = bless {
29 id => $path,
30 depends => [ keys %$deps ],
31 }, $class;
32  
33 3 $self;
34 }
35  
36 3 ▶sub path { $_[0]->{id} }
Subroutine path: called CC=1 SCAR=0.0
Pod undocumented
37  
38 2 1;
« Librarian/Library.pm ↑ Summary