Digital/Role.pm

filter: Statementstmt 100% 13 / 13 Branchbran 50.0% 1 / 2 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 76.0% 19 / 25 CC 3 SCAR 9.4
CC
3
Cov
83%
__ANON__
4.1
BEGIN
1.0
BEGIN
1.0
CRAP 2.6
« Digital/Driver.pm ↑ Summary Digital.pm »
1 package Digital::Role;
2 3 our $AUTHORITY = 'cpan:GETTY';
3 # ABSTRACT: Base role for Digital driver (positive integer input)
4 3 $Digital::Role::VERSION = '0.003';
5 3 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use Carp qw( croak );
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶sub input {
Subroutine input: called CC=1 SCAR=0.0
Pod undocumented
9 2 my ( $class, $input, %args ) = @_;
10 2 return $class->new( in => $input, %args );
11 }
12  
13 has in => (
14 is => 'ro',
15 2 ▶ isa => sub {
Subroutine __ANON__: called CC=3 SCAR=14.2
16 2 ▶ croak "Digital input must be positive integer!"
Branch: 1 branch
BranchTrueFalseTotal
unless $_[0] =~ /^\d+$/ and $_[0] >= 0 0 2 2
Condition33%1/3
$_[0] =~ /^\d+$/ and $_[0] >= 0
!ll&&!rl&&r
002
MC/DC0%0/2
$_[0] =~ /^\d+$/ and $_[0] >= 0
$_[0] =~ /^\d+$/ $_[0] >= 0
Truth table33%1/3
A and B
A= $_[0] =~ /^\d+$/B= $_[0] >= 0
ABresult
0X0
100
111
17 unless $_[0] =~ /^\d+$/ and $_[0] >= 0;
18 },
19 3 required => 1,
20 );
21  
22 3 1;
23  
24 __END__
« Digital/Driver.pm ↑ Summary Digital.pm »