| 1 | |||||||||||||||||||||||||||||
| 2 | package SQL::Admin; | ||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 1 | our $VERSION = v0.5.0; | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | ###################################################################### | ||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 1 | ▶ | use Module::Load qw(); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | 1 | ▶ | use SQL::Admin::Utils qw( refarray ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | ###################################################################### | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 1 | our %CATALOG_MAP; | |||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | ###################################################################### | ||||||||||||||||||||||||||||
| 19 | ###################################################################### | ||||||||||||||||||||||||||||
| 20 | 0 | ▶ | sub new { # ; | ||||||||||||||||||||||||||
|
Subroutine
new: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 21 | 0 | my $class = shift; | |||||||||||||||||||||||||||
| 22 | 0 | ▶ | $class = ref $class if ref $class; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 0 | ▶ | bless { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 25 | -sql_admin_search => [ $class, $class ne __PACKAGE__ ? __PACKAGE__ : () ], | ||||||||||||||||||||||||||||
| 26 | }, $class; | ||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | ###################################################################### | ||||||||||||||||||||||||||||
| 31 | ###################################################################### | ||||||||||||||||||||||||||||
| 32 | 0 | ▶ | sub _load_and_new { # ; | ||||||||||||||||||||||||||
|
Subroutine
_load_and_new: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 33 | 0 | my ($self, $class, @args) = @_; | |||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 0 | Module::Load::load ($class); | |||||||||||||||||||||||||||
| 36 | 0 | $class->new (@args); | |||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | ###################################################################### | ||||||||||||||||||||||||||||
| 41 | ###################################################################### | ||||||||||||||||||||||||||||
| 42 | 0 | ▶ | sub get_driver { # ; | ||||||||||||||||||||||||||
|
Subroutine
get_driver: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 43 | 0 | my ($self, $name, @args) = @_; | |||||||||||||||||||||||||||
| 44 | 0 | my $retval; | |||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | 0 | $retval ||= eval { $self->_load_and_new ($_ . '::Driver::' . $name, @args) } | |||||||||||||||||||||||||||
| 47 | 0 | ▶ | for @{ $self->{-sql_admin_search} }; | ||||||||||||||||||||||||||
|
Condition0%0/3
$retval ||= eval {
do {
$self->_load_and_new($_ . '::Driver::' . $name, @args)
}
}
MC/DC0%0/2
$retval ||= eval {
do {
$self->_load_and_new($_ . '::Driver::' . $name, @args)
}
}
$retval
eval {
do {
$self->_load_and_new($_ . '::Driver::' . $name, @args)
}
}
Truth table0%0/3
A ||= B
A= $retvalB= eval {
do {
$self->_load_and_new($_ . '::Driver::' . $name, @args)
}
}
| |||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | ################################################################## | ||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | 0 | $retval; | |||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | ###################################################################### | ||||||||||||||||||||||||||||
| 56 | ###################################################################### | ||||||||||||||||||||||||||||
| 57 | 0 | ▶ | sub get_catalog { # ; | ||||||||||||||||||||||||||
|
Subroutine
get_catalog: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 58 | 0 | my ($self, $name, @args) = @_; | |||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | 0 | my $cat; | |||||||||||||||||||||||||||
| 61 | $cat = $CATALOG_MAP{$name} | ||||||||||||||||||||||||||||
| 62 | 0 | ▶ | if ( (defined $name) and ($CATALOG_MAP{$name})); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $name and $SQL::Admin::CATALOG_MAP{$name}
MC/DC0%0/2
defined $name and $SQL::Admin::CATALOG_MAP{$name}
defined $name
$SQL::Admin::CATALOG_MAP{$name}
Truth table0%0/3
A and B
A= defined $nameB= $SQL::Admin::CATALOG_MAP{$name}
| |||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | 0 | ▶ | $cat ||= $self->_load_and_new ('SQL::Admin::Catalog', @args); | ||||||||||||||||||||||||||
|
Condition0%0/3
$cat ||= $self->_load_and_new("SQL::Admin::Catalog", @args)
MC/DC0%0/2
$cat ||= $self->_load_and_new("SQL::Admin::Catalog", @args)
$cat
$self->_load_and_new("SQL::Admin::Catalog", @args)
Truth table0%0/3
A ||= B
A= $catB= $self->_load_and_new("SQL::Admin::Catalog", @args)
| |||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | 0 | ▶ | $CATALOG_MAP{$name} = $cat if defined $name; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | ################################################################## | ||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||
| 70 | 0 | $cat; | |||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | ###################################################################### | ||||||||||||||||||||||||||||
| 75 | ###################################################################### | ||||||||||||||||||||||||||||
| 76 | 0 | ▶ | sub compare { # ; | ||||||||||||||||||||||||||
|
Subroutine
compare: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 77 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 78 | 0 | ▶ | my $args = shift if @_ > 2; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||
| 80 | 0 | ▶ | my ($src, $dst) = map refarray ($_) ? $self->get_catalog->load (@$_) : $_, @_; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||
| 82 | 0 | $self | |||||||||||||||||||||||||||
| 83 | ->_load_and_new ('SQL::Admin::Catalog::Compare', %$args) | ||||||||||||||||||||||||||||
| 84 | ->compare ($src, $dst) | ||||||||||||||||||||||||||||
| 85 | ; | ||||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||
| 89 | ###################################################################### | ||||||||||||||||||||||||||||
| 90 | ###################################################################### | ||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||
| 92 | package SQL::Admin; | ||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||
| 94 | 1 | 1; | |||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||
| 96 | __END__ | ||||||||||||||||||||||||||||