bin/pmkpasswd

filter: Statementstmt 90.0% 27 / 30 Branchbran 50.0% 6 / 12 Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 76.9% 40 / 52 CC 1 SCAR 0.0
CC
1
Cov
78%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/POE/Component/Server/IRC/Help.pm ↑ Summary blib/lib/POE/Component/Server/IRC/Plugin.pm »
1 #!perl
2  
3 200 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 200 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 200 ▶use Getopt::Long;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 200 ▶use POE::Component::Server::IRC::Common qw(mkpasswd);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 200 my $version;
9 my $md5;
10 200 my $apache;
11 200 my $bcrypt;
12 200 my $password;
13  
14 200 GetOptions( 'version', \$version, 'md5', \$md5, 'apache', \$apache,
15 'bcrypt', \$bcrypt, 'password=s', \$password );
16  
17 200 ▶if ( $version ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($version) 0 200 200
18 200 ▶ no strict 'vars';
Subroutine BEGIN: called CC=1 SCAR=0.0
19 0 ▶ my $v = defined $VERSION ? $VERSION : 'dev-git';
Branch: 1 branch
BranchTrueFalseTotal
defined $VERSION ? : 0 0 0
20 0 print "$0 - version ", $v, "\n";
21 0 exit 0;
22 }
23  
24 200 ▶die "No --password option specified\n" unless $password;
Branch: 1 branch
BranchTrueFalseTotal
unless $password 0 200 200
25  
26 200 ▶$md5 = 0 if $md5 and $apache;
Branch: 1 branch
BranchTrueFalseTotal
if $md5 and $apache 0 200 200
Condition66%2/3
$md5 and $apache
!ll&&!rl&&r
150500
MC/DC0%0/2
$md5 and $apache
$md5 $apache
Truth table66%2/3
A and B
A= $md5B= $apache
ABresult
0X0
100
111
27 200 ▶$apache = $md5 = 0 if $bcrypt;
Branch: 1 branch
BranchTrueFalseTotal
if $bcrypt 50 150 200
28  
29 200 my $crypt = mkpasswd( $password, md5 => $md5, apache => $apache, bcrypt => $bcrypt );
30 200 ▶print "$crypt\n" if $crypt;
Branch: 1 branch
BranchTrueFalseTotal
if $crypt 200 0 200
31 200 exit 0;
32  
33 __END__
« blib/lib/POE/Component/Server/IRC/Help.pm ↑ Summary blib/lib/POE/Component/Server/IRC/Plugin.pm »