Async/ORM/Table.pm

filter: Statementstmt 29.6% 8 / 27 Branchbran n/a Conditioncond 0.0% 0 / 8 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 14.2% 2 / 14 Podpod 0.0% 0 / 12 totaltotal 15.3% 10 / 65 CC 5 SCAR 13.0
CC
5
Cov
23%
parents
6.0
fields
6.0
constraints
6.0
CRAP 3.7
« Async/ORM/Schema.pm ↑ Summary Async/ORM/Type.pm »
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"} //= []
l!l
00
MC/DC0%0/1
+(shift())->{"parents"} //= []
+(shift())->{"parents"}
Truth table0%0/2
A
A= +(shift())->{"parents"}
Aresult
11
00
19 0 ▶sub fields { (shift->{fields} //= [])->@* }
Subroutine fields: not called CC=2 SCAR=17.9
Pod undocumented
Condition0%0/2
+(shift())->{"fields"} //= []
l!l
00
MC/DC0%0/1
+(shift())->{"fields"} //= []
+(shift())->{"fields"}
Truth table0%0/2
A
A= +(shift())->{"fields"}
Aresult
11
00
20 0 ▶sub constraints { (shift->{constraints} //= [])->@* }
Subroutine constraints: not called CC=2 SCAR=17.9
Pod undocumented
Condition0%0/2
+(shift())->{"constraints"} //= []
l!l
00
MC/DC0%0/1
+(shift())->{"constraints"} //= []
+(shift())->{"constraints"}
Truth table0%0/2
A
A= +(shift())->{"constraints"}
Aresult
11
00
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"} // []
l!l
00
MC/DC0%0/1
$self->{"primary_keys"} // []
$self->{"primary_keys"}
Truth table0%0/2
A
A= $self->{"primary_keys"}
Aresult
11
00
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  
« Async/ORM/Schema.pm ↑ Summary Async/ORM/Type.pm »