| 1 | package App::optex::textconv::Converter; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||
| 6 | 22 | ▶ | sub import { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
import: called CC=5 SCAR=16.1
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | 22 | my $pkg = $_[0]; | |||||||||||||||||||||||||||||||||||||||||
| 8 | 22 | my $caller = caller; | |||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||
| 10 | 1 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||
| 12 | 22 | ▶ | if ($pkg eq __PACKAGE__ and @_ > 1 and $_[1] eq "import") { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
$pkg eq __PACKAGE__ and @_ > 1 and $_[1] eq "import"
$pkg eq __PACKAGE__ and @_ > 1
MC/DC66%2/3
$pkg eq __PACKAGE__ and @_ > 1 and $_[1] eq "import"
$pkg eq __PACKAGE__
@_ > 1
$_[1] eq "import"
Truth table75%3/4
A and B and C
A= $pkg eq __PACKAGE__B= @_ > 1C= $_[1] eq "import"
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | 9 | *{"$caller\::import"} = \&import; | |||||||||||||||||||||||||||||||||||||||||
| 14 | 9 | return; | |||||||||||||||||||||||||||||||||||||||||
| 15 | } | ||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | 13 | ▶ | if (@_ > 1) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | 1 | ▶ | use Exporter (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 19 | 1 | goto &Exporter::import; | |||||||||||||||||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||
| 22 | unshift @App::optex::textconv::CONVERTER, | ||||||||||||||||||||||||||||||||||||||||||
| 23 | 12 | map { bless $_, __PACKAGE__ } @{"$pkg\::CONVERTER"}; | |||||||||||||||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | ▶ | sub check { $_[0]->[0] // die } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
check: not called CC=2 SCAR=17.9
Pod
undocumented
Condition0%0/2
$_[0][0] // die()
MC/DC0%0/1
$_[0][0] // die()
$_[0][0]
Truth table0%0/2
A
A= $_[0][0]
| |||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | ▶ | sub textize { $_[0]->[1] // die } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
textize: not called CC=2 SCAR=17.9
Pod
undocumented
Condition0%0/2
$_[0][1] // die()
MC/DC0%0/1
$_[0][1] // die()
$_[0][1]
Truth table0%0/2
A
A= $_[0][1]
| |||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | ▶ | sub validate { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
validate: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | my $obj = shift; | |||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | ▶ | @$obj > 2 ? $obj->[2] : sub { 1 }; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | ▶ | sub treat { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
treat: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 34 | 0 | my $obj = shift; | |||||||||||||||||||||||||||||||||||||||||
| 35 | 0 | local $_ = shift; | |||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | test($obj->check); | |||||||||||||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||
| 39 | 0 | ▶ | sub isvalid { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
isvalid: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 40 | 0 | my $obj = shift; | |||||||||||||||||||||||||||||||||||||||||
| 41 | 0 | local $_ = shift; | |||||||||||||||||||||||||||||||||||||||||
| 42 | 0 | test($obj->validate); | |||||||||||||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||
| 45 | 0 | ▶ | sub test { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
test: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 46 | 0 | my $test = shift; | |||||||||||||||||||||||||||||||||||||||||
| 47 | 0 | ▶ | if (ref $test eq 'CODE') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 48 | 0 | $test->(); | |||||||||||||||||||||||||||||||||||||||||
| 49 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 50 | 0 | /$test/; | |||||||||||||||||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||
| 54 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||