Authentication/Driver/Filter/crypt.pm

filter: Statementstmt 100% 18 / 18 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 2 / 2 totaltotal 100% 28 / 28 SCAR 11.0
CC
3
Cov
100%
check
2.0
filter
2.0
BEGIN
1.0
CRAP 3.0
« Authentication/Store/Session.pm ↑ Summary Authentication/Driver/Filter/lc.pm »
1 package CGI::Application::Plugin::Authentication::Driver::Filter::crypt;
2 3 $CGI::Application::Plugin::Authentication::Driver::Filter::crypt::VERSION = '0.21';
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 sub check {
7 2 ▶ my $class = shift;
Subroutine check: called CC=2 SCAR=6.9
Pod documented
8 2 my $param = shift;
9 2 my $plain = shift;
10 2 my $filtered = shift;
11  
12 2 ▶ return ( $class->filter( $param, $plain, $filtered ) eq $filtered ) ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$class->filter($param, $plain, $filtered) eq $filtered ? : 1 1 2
13 }
14  
15 sub filter {
16 20 ▶ my ($class, undef, $plain, $salt) = @_;
Subroutine filter: called CC=2 SCAR=6.9
Pod documented
17 20 ▶ if (!$salt) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($salt) 13 7 20
18 13 my @alphabet = ( '.', '/', 0 .. 9, 'A' .. 'Z', 'a' .. 'z' );
19 13 $salt = join '', @alphabet[ rand 64, rand 64 ];
20 }
21 20 return crypt( $plain, $salt );
22 }
23  
24 3 1;
25 __END__
« Authentication/Store/Session.pm ↑ Summary Authentication/Driver/Filter/lc.pm »