| 1 | |||||||||||||||||||||||||||||
| 2 | package SQL::Admin::Catalog::Object; | ||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 2 | our $VERSION = v0.5.0; | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | ###################################################################### | ||||||||||||||||||||||||||||
| 10 | ###################################################################### | ||||||||||||||||||||||||||||
| 11 | 31 | ▶ | sub new { # ; | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=3 SCAR=11.2
Pod
undocumented
| |||||||||||||||||||||||||||||
| 12 | 31 | my ($class, %param) = @_; | |||||||||||||||||||||||||||
| 13 | 31 | ▶ | my $self = bless {}, ref $class || $class; | ||||||||||||||||||||||||||
|
Condition33%1/3
ref $class || $class
MC/DC0%0/2
ref $class || $class
ref $class
$class
Truth table33%1/3
A || B
A= ref $classB= $class
| |||||||||||||||||||||||||||||
| 14 | 31 | ▶ | while (my ($k, $v) = each %param) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 15 | 82 | $self->$k ($v); | |||||||||||||||||||||||||||
| 16 | } | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | ################################################################## | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 31 | $self; | |||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | ###################################################################### | ||||||||||||||||||||||||||||
| 25 | ###################################################################### | ||||||||||||||||||||||||||||
| 26 | 0 | ▶ | sub oid { # ; | ||||||||||||||||||||||||||
|
Subroutine
oid: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 27 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 28 | 0 | ▶ | $self->{oid} = shift if @_ and ! $self->{oid}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@_ and not $self->{"oid"}
MC/DC0%0/2
@_ and not $self->{"oid"}
@_
not $self->{"oid"}
Truth table0%0/3
A and not(B)
A= @_B= not $self->{"oid"}
| |||||||||||||||||||||||||||||
| 29 | 0 | $self->{oid}; | |||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | ###################################################################### | ||||||||||||||||||||||||||||
| 34 | ###################################################################### | ||||||||||||||||||||||||||||
| 35 | 39 | ▶ | sub catalog { # ; | ||||||||||||||||||||||||||
|
Subroutine
catalog: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 36 | 39 | my $self = shift; | |||||||||||||||||||||||||||
| 37 | 39 | ▶ | $self->{catalog} = shift if @_ and ! $self->{catalog}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
@_ and not $self->{"catalog"}
MC/DC50%1/2
@_ and not $self->{"catalog"}
@_
not $self->{"catalog"}
Truth table66%2/3
A and not(B)
A= @_B= not $self->{"catalog"}
| |||||||||||||||||||||||||||||
| 38 | 39 | $self->{catalog}; | |||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | ###################################################################### | ||||||||||||||||||||||||||||
| 43 | ###################################################################### | ||||||||||||||||||||||||||||
| 44 | 57 | ▶ | sub name { # ; | ||||||||||||||||||||||||||
|
Subroutine
name: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 45 | 57 | my $self = shift; | |||||||||||||||||||||||||||
| 46 | 57 | ▶ | if (@_) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 47 | 31 | $self->{name} = shift; | |||||||||||||||||||||||||||
| 48 | 31 | delete $self->{fullname}; | |||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||
| 50 | 57 | $self->{name}; | |||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | ###################################################################### | ||||||||||||||||||||||||||||
| 55 | ###################################################################### | ||||||||||||||||||||||||||||
| 56 | 37 | ▶ | sub schema { # ; | ||||||||||||||||||||||||||
|
Subroutine
schema: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 57 | 37 | my $self = shift; | |||||||||||||||||||||||||||
| 58 | 37 | ▶ | if (@_) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 59 | 14 | $self->{schema} = shift; | |||||||||||||||||||||||||||
| 60 | 14 | delete $self->{fullname}; | |||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||
| 62 | 37 | $self->{schema}; | |||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | ###################################################################### | ||||||||||||||||||||||||||||
| 67 | ###################################################################### | ||||||||||||||||||||||||||||
| 68 | 58 | ▶ | sub fullname { # ; | ||||||||||||||||||||||||||
|
Subroutine
fullname: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||||||||||||||||||||
| 69 | 58 | my $self = shift; | |||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||
| 71 | 58 | ▶ | $self->{fullname} ||= join '.', grep defined, @$self{qw{ schema name }}; | ||||||||||||||||||||||||||
|
Condition66%2/3
$self->{"fullname"} ||= join(".", grep(defined($_), @$self{"schema", "name"}))
MC/DC0%0/2
$self->{"fullname"} ||= join(".", grep(defined($_), @$self{"schema", "name"}))
$self->{"fullname"}
join(".", grep(defined($_), @$self{"schema", "name"}))
Truth table66%2/3
A ||= B
A= $self->{"fullname"}B= join(".", grep(defined($_), @$self{"schema", "name"}))
| |||||||||||||||||||||||||||||
| 72 | #map 'ARRAY' eq ref $_ ? @$_ : $_, | ||||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||
| 76 | ###################################################################### | ||||||||||||||||||||||||||||
| 77 | ###################################################################### | ||||||||||||||||||||||||||||
| 78 | 12 | ▶ | sub hint { # ; | ||||||||||||||||||||||||||
|
Subroutine
hint: called CC=4 SCAR=14.6
Pod
undocumented
| |||||||||||||||||||||||||||||
| 79 | 12 | my $self = shift; | |||||||||||||||||||||||||||
| 80 | 12 | ▶ | return $self->{hint} ||= {} unless @_; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$self->{"hint"} ||= {}
MC/DC0%0/1
$self->{"hint"} ||= {}
$self->{"hint"}
Truth table0%0/2
A
A= $self->{"hint"}
| |||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||
| 82 | 12 | my $key = shift; | |||||||||||||||||||||||||||
| 83 | 12 | ▶ | return $self->{hint}{ $key } unless @_; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||
| 85 | 6 | $self->{hint}{$key} = shift; | |||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||
| 89 | ###################################################################### | ||||||||||||||||||||||||||||
| 90 | ###################################################################### | ||||||||||||||||||||||||||||
| 91 | 0 | ▶ | sub info { # ; | ||||||||||||||||||||||||||
|
Subroutine
info: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 92 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||
| 94 | 0 | ▶ | return unless @_; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 95 | 0 | my $key = shift; | |||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||
| 97 | 0 | ▶ | return $self->{info}{ $key } unless @_; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||
| 99 | 0 | $self->{info}{ $key } = shift; | |||||||||||||||||||||||||||
| 100 | } | ||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||
| 103 | ###################################################################### | ||||||||||||||||||||||||||||
| 104 | ###################################################################### | ||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||
| 106 | package SQL::Admin::Catalog::Object; | ||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||
| 108 | 2 | 1; | |||||||||||||||||||||||||||