lib/Badger/Data/Facet/Text/MinLength.pm

filter: Statementstmt 100% 6 / 6 Branchbran n/a Conditioncond 80.0% 4 / 5 MC/DCmcdc 33.3% 1 / 3 Subroutinesub 100% 2 / 2 Podpod 100% 1 / 1 totaltotal 82.3% 14 / 17 CC 3 SCAR 9.2
CC
3
Cov
91%
validate
3.0
BEGIN
1.0
CRAP 2.5
« lib/Badger/Data/Facet/Text/MaxLength.pm ↑ Summary lib/Badger/Data/Facet.pm »
1 package Badger::Data::Facet::Text::MinLength;
2  
3 use Badger::Data::Facet::Class
4 2 version => 0.01,
5 type => 'text',
6 2 ▶ args => 'min_length';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8  
9 sub validate {
10 6 ▶ my ($self, $text, $type) = @_;
Subroutine validate: called CC=3 SCAR=11.1
Pod documented
11  
12 return length($$text) >= $self->{ min_length }
13 || $self->invalid_msg(
14 6 ▶ too_short => $type || 'Text', $self->{ min_length }, length($$text)
Condition80%4/5
length $$text >= $self->{'min_length'} || $self->invalid_msg('too_short', $type || 'Text', $self->{'min_length'}, length $$text)
l!l
420
$type || 'Text'
l!l
11
MC/DC0%0/2
length $$text >= $self->{'min_length'} || $self->invalid_msg('too_short', $type || 'Text', $self->{'min_length'}, length $$text)
length $$text >= $self->{'min_length'} $self->invalid_msg('too_short', $type || 'Text', $self->{'min_length'}, length $$text)
MC/DC100%1/1
$type || 'Text'
$type
Truth table33%1/3
A || B
A= length $$text >= $self->{'min_length'}B= $self->invalid_msg('too_short', $type || 'Text', $self->{'min_length'}, length $$text)
ABresult
1X1
011
000
Truth table100%2/2
A
A= $type
Aresult
11
00
15 );
16 }
17  
18 2 1;
19  
20 __END__
« lib/Badger/Data/Facet/Text/MaxLength.pm ↑ Summary lib/Badger/Data/Facet.pm »