Branch Coverage

blib/lib/Authen/TOTP.pm
Criterion Covered Total %
branch 30 66 45.4


line true false branch
42 5 0 if (@$args != 0)
43 0 5 if (ref $args->[0] eq 'HASH') { }
5 0 elsif (not scalar(@$args) % 2) { }
62 5 1 if ($digits and $digits =~ /^[68]$/) { }
1 0 elsif (not defined $self->{'digits'} && $self->{'digits'} =~ /^[68]$/) { }
74 0 6 if ($period and $period =~ /^[36]0$/) { }
1 5 elsif (not defined $self->{'period'} && $self->{'period'} =~ /^[36]0$/) { }
86 0 6 if ($algorithm and $algorithm =~ /^SHA\d+$/) { }
1 5 elsif (not defined $self->{'algorithm'} && $self->{'algorithm'} =~ /^SHA\d+$/) { }
98 5 1 if ($when and $when =~ /^\-?\d+$/) { }
1 0 elsif (not defined $self->{'when'} && $self->{'when'} =~ /^\-?\d+$/) { }
110 5 1 if ($tolerance and $tolerance =~ /^\d+$/ and $tolerance > 0) { }
1 0 elsif (not defined $self->{'tolerance'} && $self->{'tolerance'} =~ /^\d+$/) { }
122 5 1 if ($secret) { }
0 1 elsif ($base32secret) { }
129 0 1 if (defined $self->{'base32secret'}) { }
148 0 6 if ((eval { do { require MIME::Base32::XS; 1 } } || 0) ne 1) { }
151 0 0 if $self->{'DEBUG'}
156 0 6 if $self->{'DEBUG'}
164 0 0 if ((eval { do { require MIME::Base32::XS; 1 } } || 0) ne 1) { }
167 0 0 if $self->{'DEBUG'}
172 0 0 if $self->{'DEBUG'}
184 0 1 if (length $secret > 13)
185 0 0 if $self->{'DEBUG'}
196 0 0 unless ($user)
205 0 0 if ($issuer) { }
225 0 5 unless ($otp and $otp =~ /^\d{6,8}$/)
244 0 5 if $self->{'DEBUG'}
256 0 5 if $self->{'DEBUG'}
258 5 0 if ($code eq sprintf('%0' . $self->{'digits'} . 'd', $otp))
272 0 1 if (@_ != 0)
273 0 0 if (ref $_[0] eq 'HASH') { }
0 0 elsif (not scalar(@_) % 2) { }