File Coverage

blib/lib/Data/Password/zxcvbn/French.pm
Criterion Covered Total %
statement 22 22 100.0
branch n/a
condition 3 8 37.5
subroutine 5 5 100.0
pod 0 1 0.0
total 30 36 83.3


line stmt bran cond sub pod time code
1             package Data::Password::zxcvbn::French;
2 1     1   227027 use strict;
  1         7  
  1         29  
3 1     1   6 use warnings;
  1         2  
  1         24  
4 1     1   463 use Data::Password::zxcvbn;
  1         72343  
  1         48  
5 1     1   11 use Exporter 'import';
  1         3  
  1         163  
6             our @EXPORT_OK=qw(password_strength);
7             our $VERSION = '1.0.0'; # VERSION
8             # ABSTRACT: Dropbox's password estimation logic, with French defaults
9              
10              
11             sub password_strength {
12 5     5 0 94024 my ($password, $opts) = @_;
13              
14 5   50     11 my %actual_opts = %{$opts // {}};
  5         39  
15 5   33     28 $actual_opts{ranked_dictionaries} //= do {
16 5         509 require Data::Password::zxcvbn::French::RankedDictionaries;
17 5         24 \%Data::Password::zxcvbn::French::RankedDictionaries::ranked_dictionaries;
18             };
19 5   33     22 $actual_opts{graphs} //= do {
20 5         565 require Data::Password::zxcvbn::French::AdjacencyGraph;
21 5         21 \%Data::Password::zxcvbn::French::AdjacencyGraph::graphs;
22             };
23              
24 5         21 return Data::Password::zxcvbn::password_strength(
25             $password,
26             \%actual_opts,
27             );
28             }
29              
30             1;
31              
32             __END__
33              
34             =pod
35              
36             =encoding UTF-8
37              
38             =head1 NAME
39              
40             Data::Password::zxcvbn::French - Dropbox's password estimation logic, with French defaults
41              
42             =head1 VERSION
43              
44             version 1.0.0
45              
46             =head1 SYNOPSIS
47              
48             use Data::Password::zxcvbn::French qw(password_strength);
49              
50             my $strength = password_strength($my_password);
51             warn $strength->{warning} if $strength->{score} < 3;
52              
53             =head1 DESCRIPTION
54              
55             This is a variant of L<< C<Data::Password::zxcvbn> >> with French
56             data. See that distribution for all the documentation.
57              
58             =for Pod::Coverage password_strength
59              
60             =head1 AUTHOR
61              
62             Gianni Ceccarelli <gianni.ceccarelli@broadbean.com>
63              
64             =head1 COPYRIGHT AND LICENSE
65              
66             This software is copyright (c) 2023 by BroadBean UK, a CareerBuilder Company.
67              
68             This is free software; you can redistribute it and/or modify it under
69             the same terms as the Perl 5 programming language system itself.
70              
71             =cut