ISBN/Record.pm

filter: Statementstmt 100% 28 / 28 Branchbran 100% 2 / 2 Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 9 / 9 Podpod 100% 6 / 6 totaltotal 94.0% 47 / 50 CC 3 SCAR 3.1
CC
3
Cov
97%
new
2.0
_accessor
2.0
BEGIN
1.0
CRAP 1.4
« ISBN/Driver.pm ↑ Summary
1 package WWW::Scraper::ISBN::Record;
2  
3 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 7 our $VERSION = '1.05';
7  
8 #----------------------------------------------------------------------------
9 # Public API
10  
11 5 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
Pod documented
12 5 my $proto = shift;
13 5 ▶ my $class = ref($proto) || $proto;
Condition66%2/3
ref $proto || $proto
l!l&&r!l&&!r
140
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table66%2/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
14 5 my $self = {
15 ISBN => undef,
16 FOUND => 0,
17 FOUND_IN => undef,
18 BOOK => undef,
19 ERROR => '',
20 };
21  
22 5 bless ($self, $class);
23 5 return $self;
24 }
25  
26 8 ▶sub isbn { my $self = shift; return $self->_accessor('ISBN',@_) }
Subroutine isbn: called CC=1 SCAR=0.0
Pod documented
27 6 ▶sub found { my $self = shift; return $self->_accessor('FOUND',@_) }
Subroutine found: called CC=1 SCAR=0.0
Pod documented
28 3 ▶sub found_in { my $self = shift; return $self->_accessor('FOUND_IN',@_) }
Subroutine found_in: called CC=1 SCAR=0.0
Pod documented
29 6 ▶sub book { my $self = shift; return $self->_accessor('BOOK',@_) }
Subroutine book: called CC=1 SCAR=0.0
Pod documented
30 6 ▶sub error { my $self = shift; return $self->_accessor('ERROR',@_) }
Subroutine error: called CC=1 SCAR=0.0
Pod documented
31  
32 29 ▶sub _accessor {
Subroutine _accessor: called CC=2 SCAR=6.9
33 29 my $self = shift;
34 29 my $accessor = shift;
35 29 ▶ if (@_) { $self->{$accessor} = shift };
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 12 17 29
36 29 return $self->{$accessor};
37 }
38  
39 7 1;
40  
41 __END__
« ISBN/Driver.pm ↑ Summary