Geoffrey/Action/Function.pm

filter: Statementstmt 70.7% 29 / 41 Branchbran 50.0% 5 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 2 / 2 totaltotal 71.6% 43 / 60 CC 6 SCAR 12.2
CC
6
Cov
67%
add
6.0
list
3.9
BEGIN
1.0
CRAP 3.4
« Geoffrey/Read.pm ↑ Summary Geoffrey/Changeset.pm »
1 package Geoffrey::Action::Function;
2  
3 6 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use 5.016;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 6 $Geoffrey::Action::Function::VERSION = '0.000206';
9  
10 6 ▶use parent 'Geoffrey::Role::Action';
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 4 ▶sub add {
Subroutine add: called CC=4 SCAR=17.9
Pod documented
13 4 my ( $self, $hr_params ) = @_;
14 4 my $function = $self->converter->function;
15 2 ▶ if ( !$function ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($function) 0 2 2
16 0 require Geoffrey::Exception::NotSupportedException;
17 0 Geoffrey::Exception::NotSupportedException::throw_converter_type();
18 }
19 2 ▶ if ( !$function->add ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($function->add) 0 1 1
20 0 require Geoffrey::Exception::NotSupportedException;
21 0 Geoffrey::Exception::NotSupportedException::throw_action();
22 }
23 1 require Ref::Util;
24 1 ▶ if ( !Ref::Util::is_hashref($hr_params) ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (Ref::Util::XS::is_hashref($hr_params)) 1 0 1
25 1 require Geoffrey::Exception::General;
26 1 Geoffrey::Exception::General::throw_wrong_ref( __PACKAGE__ . '::add', 'hash' );
27 }
28 0 my $args = join q/,/, @{ $hr_params->{args} };
29 0 require Geoffrey::Utils;
30 return $self->do(
31 Geoffrey::Utils::replace_spare(
32 $function->add,
33 [
34 $hr_params->{name}, $args,
35 $hr_params->{result_data_type}, $hr_params->{prosrc},
36 $hr_params->{language}, $hr_params->{cost},
37 0 ]
38 )
39 );
40 }
41  
42 6 ▶sub list {
Subroutine list: called CC=3 SCAR=13.6
Pod documented
43 6 my ( $self, $schema ) = @_;
44 6 my $function = $self->converter->function;
45 3 ▶ if ( !$function ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($function) 0 3 3
46 0 require Geoffrey::Exception::NotSupportedException;
47 0 Geoffrey::Exception::NotSupportedException::throw_converter_type();
48 }
49 3 ▶ if ( !$function->list ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($function->list) 0 1 1
50 0 require Geoffrey::Exception::NotSupportedException;
51 0 Geoffrey::Exception::NotSupportedException::throw_action();
52 }
53 1 return $function->information( $self->do_arrayref( $function->list($schema) ) );
54 }
55  
56 6 1;
57  
58 __END__
« Geoffrey/Read.pm ↑ Summary Geoffrey/Changeset.pm »