| 1 | package Database::Async::ORM::Table; | ||||||||||||
| 2 | |||||||||||||
| 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 | |||||||||||||
| 6 | 2 | our $VERSION = '0.019'; # VERSION | |||||||||||
| 7 | |||||||||||||
| 8 | 0 | ▶ | sub new { | ||||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 9 | 0 | my ($class, %args) = @_; | |||||||||||
| 10 | 0 | bless \%args, $class | |||||||||||
| 11 | } | ||||||||||||
| 12 | |||||||||||||
| 13 | 0 | ▶ | sub schema { shift->{schema} } | ||||||||||
|
Subroutine
schema: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 14 | 0 | ▶ | sub name { shift->{name} } | ||||||||||
|
Subroutine
name: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 15 | 0 | ▶ | sub defined_in { shift->{defined_in} } | ||||||||||
|
Subroutine
defined_in: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 16 | 0 | ▶ | sub description { shift->{description} } | ||||||||||
|
Subroutine
description: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 17 | 0 | ▶ | sub tablespace { shift->{tablespace} } | ||||||||||
|
Subroutine
tablespace: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 18 | 0 | ▶ | sub parents { (shift->{parents} //= [])->@* } | ||||||||||
|
Subroutine
parents: not called CC=2 SCAR=17.9
Pod
undocumented
Condition0%0/2
+(shift())->{"parents"} //= []
MC/DC0%0/1
+(shift())->{"parents"} //= []
+(shift())->{"parents"}
Truth table0%0/2
A
A= +(shift())->{"parents"}
| |||||||||||||
| 19 | 0 | ▶ | sub fields { (shift->{fields} //= [])->@* } | ||||||||||
|
Subroutine
fields: not called CC=2 SCAR=17.9
Pod
undocumented
Condition0%0/2
+(shift())->{"fields"} //= []
MC/DC0%0/1
+(shift())->{"fields"} //= []
+(shift())->{"fields"}
Truth table0%0/2
A
A= +(shift())->{"fields"}
| |||||||||||||
| 20 | 0 | ▶ | sub constraints { (shift->{constraints} //= [])->@* } | ||||||||||
|
Subroutine
constraints: not called CC=2 SCAR=17.9
Pod
undocumented
Condition0%0/2
+(shift())->{"constraints"} //= []
MC/DC0%0/1
+(shift())->{"constraints"} //= []
+(shift())->{"constraints"}
Truth table0%0/2
A
A= +(shift())->{"constraints"}
| |||||||||||||
| 21 | 0 | ▶ | sub foreign_keys { grep { $_->type eq 'foreign_key' } shift->constraints } | ||||||||||
|
Subroutine
foreign_keys: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 22 | 0 | ▶ | sub primary_keys { | ||||||||||
|
Subroutine
primary_keys: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||
| 23 | 0 | my ($self) = @_; | |||||||||||
| 24 | 0 | ▶ | map { $self->field_by_name($_) } ($self->{primary_keys} // [])->@* | ||||||||||
|
Condition0%0/2
$self->{"primary_keys"} // []
MC/DC0%0/1
$self->{"primary_keys"} // []
$self->{"primary_keys"}
Truth table0%0/2
A
A= $self->{"primary_keys"}
| |||||||||||||
| 25 | } | ||||||||||||
| 26 | |||||||||||||
| 27 | 0 | ▶ | sub field_by_name { | ||||||||||
|
Subroutine
field_by_name: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 28 | 0 | my ($self, $name) = @_; | |||||||||||
| 29 | 0 | my ($field) = grep { $_->name eq $name } $self->fields; | |||||||||||
| 30 | 0 | return $field; | |||||||||||
| 31 | } | ||||||||||||
| 32 | |||||||||||||
| 33 | 2 | 1; | |||||||||||
| 34 | |||||||||||||