lib/SQL/Admin/Catalog/Table/Column.pm

filter: Statementstmt 62.8% 22 / 35 Branchbran 37.5% 6 / 16 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 70.0% 7 / 10 Podpod 0.0% 0 / 7 totaltotal 49.3% 35 / 71 CC 10 SCAR 20.3
CC
10
Cov
53%
autoincrement_hint
20.0
add
12.0
autoincrement
6.0
CRAP 7.6
« lib/SQL/Admin/Catalog.pm ↑ Summary lib/SQL/Admin/Catalog/Table.pm »
1  
2 package SQL::Admin::Catalog::Table::Column;
3 2 ▶use base qw( SQL::Admin::Catalog::Table::Object );
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 our $VERSION = v0.5.0;
9  
10 ######################################################################
11 ######################################################################
12 0 ▶sub add { # ;
Subroutine add: not called CC=3 SCAR=24.8
Pod undocumented
13 0 my ($self, $what, @params) = @_;
14  
15 0 my $obj = $self->catalog->add ($what, column => $self, @params);
16  
17 ##################################################################
18  
19 0 ▶ return $self->not_null ($obj) if $what eq 'not_null';
Branch: 1 branch
BranchTrueFalseTotal
if $what eq "not_null" 0 0 0
20 0 ▶ return $self->default ($obj) if $what eq 'default';
Branch: 1 branch
BranchTrueFalseTotal
if $what eq "default" 0 0 0
21 }
22  
23  
24 ######################################################################
25 ######################################################################
26 8 ▶sub type { # ;
Subroutine type: called CC=2 SCAR=6.9
Pod undocumented
27 8 my $self = shift;
28 8 ▶ $self->{type} = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 5 3 8
29 8 $self->{type};
30 }
31  
32  
33 ######################################################################
34 ######################################################################
35 13 ▶sub fullname { # ;
Subroutine fullname: called CC=1 SCAR=0.0
Pod undocumented
36 13 my $self = shift;
37  
38 13 $self->table->fullname . '.' . $self->name;
39 }
40  
41  
42 ######################################################################
43 ######################################################################
44 7 ▶sub not_null { # ;
Subroutine not_null: called CC=2 SCAR=6.9
Pod undocumented
45 7 my $self = shift;
46 7 ▶ $self->{not_null} = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 4 3 7
47 7 $self->{not_null};
48 }
49  
50  
51 ######################################################################
52 ######################################################################
53 5 ▶sub default { # ;
Subroutine default: called CC=2 SCAR=6.9
Pod undocumented
54 5 my $self = shift;
55 5 ▶ $self->{default} = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 2 3 5
56 5 $self->{default};
57 }
58  
59  
60 ######################################################################
61 ######################################################################
62 0 ▶sub autoincrement { # ;
Subroutine autoincrement: not called CC=2 SCAR=17.9
Pod undocumented
63 0 my $self = shift;
64 0 ▶ $self->{autoincrement} = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
65 0 $self->{autoincrement};
66 }
67  
68  
69 ######################################################################
70 ######################################################################
71 0 ▶sub autoincrement_hint { # ;
Subroutine autoincrement_hint: not called CC=4 SCAR=30.0
Pod undocumented
72 0 my $self = shift;
73  
74 0 ▶ my $map = $self->{autoincrement_hint} ||= {};
Condition0%0/2
$self->{"autoincrement_hint"} ||= {}
l!l
00
MC/DC0%0/1
$self->{"autoincrement_hint"} ||= {}
$self->{"autoincrement_hint"}
Truth table0%0/2
A
A= $self->{"autoincrement_hint"}
Aresult
11
00
75 0 ▶ return $map unless @_;
Branch: 1 branch
BranchTrueFalseTotal
unless @_ 0 0 0
76  
77 0 my $key = shift;
78 0 ▶ return $map->{$key} unless @_;
Branch: 1 branch
BranchTrueFalseTotal
unless @_ 0 0 0
79  
80 0 $map->{$key} = shift;
81 }
82  
83  
84 ######################################################################
85 ######################################################################
86  
87 package SQL::Admin::Catalog::Table::Column;
88  
89 2 1;
90  
« lib/SQL/Admin/Catalog.pm ↑ Summary lib/SQL/Admin/Catalog/Table.pm »