DB/Table.pm

filter: Statementstmt 50.0% 12 / 24 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 3 / 6 Podpod 100% 1 / 1 totaltotal 39.0% 16 / 41 CC 6 SCAR 27.1
CC
6
Cov
35%
get
30.0
AUTOLOAD
6.0
BEGIN
1.0
CRAP 15.1
« DB.pm ↑ Summary DB/Record.pm »
1 package Config::DB::Table;
2  
3 3 $Config::DB::Table::VERSION = '0.2';
4  
5 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 3 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 3 our $AUTOLOAD;
11  
12 0 ▶sub AUTOLOAD {
Subroutine AUTOLOAD: not called CC=2 SCAR=17.9
13 0 my ( $self, @pars ) = @_;
14 0 my $name = $AUTOLOAD;
15  
16 0 $name =~ s/.*://;
17  
18 0 ▶ croak "Can't locate object method \"$name\" via package \""
Branch: 1 branch
BranchTrueFalseTotal
unless $name =~ /^_/ 0 0 0
19 . __PACKAGE__ . '"'
20 unless $name =~ /^_/;
21  
22 0 $name =~ s/^_//;
23  
24 0 return $self->get( $name, @pars );
25 }
26  
27 0 ▶sub DESTROY {
Subroutine DESTROY: not called CC=1 SCAR=0.0
28 }
29  
30 0 ▶sub get {
Subroutine get: not called CC=5 SCAR=34.0
Pod documented
31 0 my ( $self, $key, $field ) = @_;
32  
33 0 ▶ croak __PACKAGE__ . "::get: missing key parameter" unless defined $key;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $key 0 0 0
34 croak __PACKAGE__ . "::get: missing key '$key' in configuration table"
35 0 ▶ unless exists $self->{$key};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{$key} 0 0 0
36  
37 0 ▶ return $self->{$key} unless defined $field;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $field 0 0 0
38  
39 croak __PACKAGE__ . "::get: unknown field '$field' for configuration table"
40 0 ▶ unless exists $self->{$key}->{$field};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{$key}{$field} 0 0 0
41  
42 0 return $self->{$key}->{$field};
43 }
44  
45 3 1;
46  
47 __END__
« DB.pm ↑ Summary DB/Record.pm »