lib/SQL/Admin/Catalog/Object.pm

filter: Statementstmt 80.4% 33 / 41 Branchbran 61.1% 11 / 18 Conditioncond 35.7% 5 / 14 MC/DCmcdc 11.1% 1 / 9 Subroutinesub 80.0% 8 / 10 Podpod 0.0% 0 / 8 totaltotal 58.0% 58 / 100 CC 15 SCAR 16.2
CC
15
Cov
67%
oid
12.0
info
12.0
hint
4.3
CRAP 5.1
« lib/SQL/Admin/Driver/Base.pm ↑ Summary lib/SQL/Admin/Driver/Base/Producer.pm »
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
l!l&&r!l&&!r
0310
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table33%1/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
14 31 ▶ while (my ($k, $v) = each %param) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %param) 82 31 113
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
BranchTrueFalseTotal
if @_ and not $self->{"oid"} 0 0 0
Condition0%0/3
@_ and not $self->{"oid"}
!ll&&!rl&&r
000
MC/DC0%0/2
@_ and not $self->{"oid"}
@_ not $self->{"oid"}
Truth table0%0/3
A and not(B)
A= @_B= not $self->{"oid"}
ABresult
0X0
100
111
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
BranchTrueFalseTotal
if @_ and not $self->{"catalog"} 20 19 39
Condition66%2/3
@_ and not $self->{"catalog"}
!ll&&!rl&&r
19020
MC/DC50%1/2
@_ and not $self->{"catalog"}
@_ not $self->{"catalog"}
Truth table66%2/3
A and not(B)
A= @_B= not $self->{"catalog"}
ABresult
0X0
100
111
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
BranchTrueFalseTotal
if (@_) 31 26 57
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
BranchTrueFalseTotal
if (@_) 14 23 37
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"}))
l!l&&r!l&&!r
44140
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"}))
ABresult
1X1
011
000
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
BranchTrueFalseTotal
unless @_ 0 12 12
Condition0%0/2
$self->{"hint"} ||= {}
l!l
00
MC/DC0%0/1
$self->{"hint"} ||= {}
$self->{"hint"}
Truth table0%0/2
A
A= $self->{"hint"}
Aresult
11
00
81  
82 12 my $key = shift;
83 12 ▶ return $self->{hint}{ $key } unless @_;
Branch: 1 branch
BranchTrueFalseTotal
unless @_ 6 6 12
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
BranchTrueFalseTotal
unless @_ 0 0 0
95 0 my $key = shift;
96  
97 0 ▶ return $self->{info}{ $key } unless @_;
Branch: 1 branch
BranchTrueFalseTotal
unless @_ 0 0 0
98  
99 0 $self->{info}{ $key } = shift;
100 }
101  
102  
103 ######################################################################
104 ######################################################################
105  
106 package SQL::Admin::Catalog::Object;
107  
108 2 1;
« lib/SQL/Admin/Driver/Base.pm ↑ Summary lib/SQL/Admin/Driver/Base/Producer.pm »