Enbld/Target/AttributeExtension/RegEx.pm

filter: Statementstmt 100% 23 / 23 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 96.7% 30 / 31 SCAR 6.9
CC
2
Cov
100%
validate
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« Enbld/Target/AttributeExtension/Word.pm ↑ Summary Enbld/Target/Attribute/DarwinArgument.pm »
1 package Enbld::Target::AttributeExtension::RegEx;
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 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 7 ▶use parent qw/Enbld::Target::Attribute/;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 sub validate {
11 273 ▶ my ( $self, $string ) = @_;
Subroutine validate: called CC=2 SCAR=6.9
Pod undocumented
12  
13 273 $self->SUPER::validate( $string );
14  
15 269 eval { "" =~ /$string/ };
16  
17 269 ▶ if ( $@ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) 2 267 269
18 2 my $type = ref( $self );
19 2 $type =~ s/.*:://;
20  
21 2 require Enbld::Exception;
22 2 croak( Enbld::Exception->new(
23 "Attribute '$type' is NOT valid regular expression string",
24 $string
25 ) );
26 }
27  
28 267 return $string;
29 }
30  
31 7 1;
« Enbld/Target/AttributeExtension/Word.pm ↑ Summary Enbld/Target/Attribute/DarwinArgument.pm »