lib/Badger/Data/Facet/Class.pm

filter: Statementstmt 80.9% 17 / 21 Branchbran 25.0% 1 / 4 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 83.3% 5 / 6 Podpod 100% 3 / 3 totaltotal 69.2% 27 / 39 CC 4 SCAR 9.5
CC
4
Cov
68%
opts
6.0
type
2.1
args
2.0
CRAP 2.6
« lib/Badger/Data/Facet/Text/Length.pm ↑ Summary lib/Badger/Data/Facet/Number.pm »
1 package Badger::Data::Facet::Class;
2  
3 3 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use Badger::Data::Facets;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 use Badger::Class
6 3 version => 0.01,
7 debug => 0,
8 uber => 'Badger::Class',
9 utils => 'camel_case',
10 constants => 'DELIMITER ARRAY',
11 constant => {
12 FACETS => 'Badger::Data::Facets',
13 FACET => 'Badger::Data::Facet',
14 },
15 hooks => {
16 type => \&type,
17 args => \&args,
18 opts => \&opts,
19 3 ▶ };
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21  
22 sub type {
23 10 ▶ my ($self, $type) = @_;
Subroutine type: called CC=2 SCAR=7.6
Pod documented
24 10 ▶ my $facet = $self->FACETS->prototype->find($type)
Condition33%1/3
$self->FACETS->prototype->find($type) || croak("Invalid facet type: $type\n")
l!l&&r!l&&!r
1000
MC/DC0%0/2
$self->FACETS->prototype->find($type) || croak("Invalid facet type: $type\n")
$self->FACETS->prototype->find($type) croak("Invalid facet type: $type\n")
Truth table33%1/3
A || B
A= $self->FACETS->prototype->find($type)B= croak("Invalid facet type: $type\n")
ABresult
1X1
011
000
25 || croak "Invalid facet type: $type\n";
26 10 $self->base($facet);
27 }
28  
29  
30 sub args {
31 10 ▶ my ($self, $args) = @_;
Subroutine args: called CC=2 SCAR=7.0
Pod documented
32
33 10 ▶ $args = [ split(DELIMITER, $args) ]
Branch: 1 branch
BranchTrueFalseTotal
unless ref $args eq "ARRAY" 10 0 10
34 unless ref $args eq ARRAY;
35
36 10 $self->var( ARGS => $args );
37 10 $self->mutators($args);
38 }
39  
40  
41 sub opts {
42 0 ▶ my ($self, $opts) = @_;
Subroutine opts: not called CC=2 SCAR=17.9
Pod documented
43  
44 0 ▶ $opts = [ split(DELIMITER, $opts) ]
Branch: 1 branch
BranchTrueFalseTotal
unless ref $opts eq "ARRAY" 0 0 0
45 unless ref $opts eq ARRAY;
46  
47 0 $self->var( OPTS => $opts );
48 0 $self->mutators($opts);
49 }
50  
51  
52 3 1;
53 __END__
« lib/Badger/Data/Facet/Text/Length.pm ↑ Summary lib/Badger/Data/Facet/Number.pm »