| 1 | 2 | ▶ | use 5.20.0; | ||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||
| 5 | package DBIx::Class::Smooth::Schema; | ||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||
| 7 | # ABSTRACT: Short intro | ||||||||||||||||||||||||||||||||||||
| 8 | 2 | our $AUTHORITY = 'cpan:CSSON'; # AUTHORITY | |||||||||||||||||||||||||||||||||||
| 9 | 2 | our $VERSION = '0.0108'; | |||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||
| 11 | 2 | ▶ | use parent 'DBIx::Class::Schema'; | ||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||
| 12 | 2 | ▶ | use Carp qw/croak/; | ||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||
| 14 | 2 | ▶ | use experimental qw/postderef signatures/; | ||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||
| 16 | 2 | our $dbix_class_smooth_methods_created = 0; | |||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||
| 18 | 0 | ▶ | sub connection($self, @rest) { | ||||||||||||||||||||||||||||||||||
|
Subroutine
connection: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||
| 19 | 0 | $self = $self->next::method(@rest); | |||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||
| 21 | 0 | ▶ | if(!$dbix_class_smooth_methods_created) { | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 22 | 0 | $self->_dbix_class_smooth_create_methods(); | |||||||||||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||||||||||
| 24 | 0 | return $self; | |||||||||||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||
| 27 | 0 | ▶ | sub _dbix_class_smooth_create_methods($self) { | ||||||||||||||||||||||||||||||||||
|
Subroutine
_dbix_class_smooth_create_methods: not called CC=3 SCAR=21.9
| |||||||||||||||||||||||||||||||||||||
| 28 | 2 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||
| 29 | 0 | for my $source (sort $self->sources) { | |||||||||||||||||||||||||||||||||||
| 30 | 0 | (my $method = $source) =~ s{::}{_}g; | |||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||
| 32 | 0 | ▶ | if($self->can($method)) { | ||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||
| 33 | 0 | croak(caller(1) . " already has a method named <$method>."); | |||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||
| 36 | 0 | ▶ | *{ caller(1) . "::$method" } = sub { | ||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=5 SCAR=34.0
| |||||||||||||||||||||||||||||||||||||
| 37 | 0 | my $rs = shift->resultset($source); | |||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||
| 39 | 0 | ▶ | return !scalar @_ ? $rs | ||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
Condition0%0/3
defined $_[0] and not ref $_[0]
MC/DC0%0/2
defined $_[0] and not ref $_[0]
defined $_[0]
not ref $_[0]
Truth table0%0/3
A and not(B)
A= defined $_[0]B= not ref $_[0]
| |||||||||||||||||||||||||||||||||||||
| 40 | : defined $_[0] && !ref $_[0] ? $rs->find(@_) | ||||||||||||||||||||||||||||||||||||
| 41 | : ref $_[0] eq 'ARRAY' ? $rs->find(@$_[1..$#_], { key => $_->[0] }) | ||||||||||||||||||||||||||||||||||||
| 42 | : $rs->search(@_) | ||||||||||||||||||||||||||||||||||||
| 43 | ; | ||||||||||||||||||||||||||||||||||||
| 44 | 0 | }; | |||||||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||||||
| 46 | 0 | $dbix_class_smooth_methods_created = 1; | |||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||
| 50 | 2 | 1; | |||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||
| 52 | __END__ | ||||||||||||||||||||||||||||||||||||