| 1 | package Crypt::RNCryptor; | ||||||||||||||||||||
| 2 | 2 | ▶ | use 5.008001; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 2 | ▶ | use Carp; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 2 | our $VERSION = '0.01'; | |||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | 2 | our $DefaultRNCryptorVersion = '3'; | |||||||||||||||||||
| 10 | 2 | our @SupportedRNCryptorVersions = qw(3); | |||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | 0 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||
| 13 | 0 | my ($class, %opts) = @_; | |||||||||||||||||||
| 14 | 0 | ▶ | $opts{version} ||= $DefaultRNCryptorVersion; | ||||||||||||||||||
|
Condition0%0/3
$opts{"version"} ||= $Crypt::RNCryptor::DefaultRNCryptorVersion
MC/DC0%0/2
$opts{"version"} ||= $Crypt::RNCryptor::DefaultRNCryptorVersion
$opts{"version"}
$Crypt::RNCryptor::DefaultRNCryptorVersion
Truth table0%0/3
A ||= B
A= $opts{"version"}B= $Crypt::RNCryptor::DefaultRNCryptorVersion
| |||||||||||||||||||||
| 15 | 0 | foreach my $v (@SupportedRNCryptorVersions) { | |||||||||||||||||||
| 16 | 0 | ▶ | if ($opts{version} eq $v) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 17 | 0 | my $Class = "Crypt::RNCryptor::V${v}"; | |||||||||||||||||||
| 18 | 0 | eval "require $Class"; | |||||||||||||||||||
| 19 | 0 | return $Class->new(%opts); | |||||||||||||||||||
| 20 | } | ||||||||||||||||||||
| 21 | } | ||||||||||||||||||||
| 22 | 0 | my $v = $opts{version}; | |||||||||||||||||||
| 23 | 0 | confess "RNCryptor v$v is not supported."; | |||||||||||||||||||
| 24 | } | ||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | 0 | ▶ | sub encrypt { | ||||||||||||||||||
|
Subroutine
encrypt: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 27 | 0 | confess 'This is an abstract method.'; | |||||||||||||||||||
| 28 | } | ||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | 0 | ▶ | sub decrypt { | ||||||||||||||||||
|
Subroutine
decrypt: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 31 | 0 | confess 'This is an abstract method.'; | |||||||||||||||||||
| 32 | } | ||||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | 2 | 1; | |||||||||||||||||||
| 35 | __END__ | ||||||||||||||||||||