blib/lib/DBIO/DuckDB/Extension.pm

filter: Statementstmt 100% 30 / 30 Branchbran 100% 8 / 8 Conditioncond 80.0% 4 / 5 MC/DCmcdc 66.6% 2 / 3 Subroutinesub 100% 10 / 10 Podpod 100% 5 / 5 totaltotal 96.7% 59 / 61 CC 8 SCAR 14.6
CC
8
Cov
98%
resolve_list
8.0
BEGIN
1.0
BEGIN
1.0
CRAP 4.3
« blib/lib/DBIO/DuckDB/Diff/Index.pm ↑ Summary blib/lib/DBIO/DuckDB/DDL/Emit.pm »
1 package DBIO::DuckDB::Extension;
2 # ABSTRACT: The extension class of a DuckDB extension without rules
3  
4 36 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 36 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 36 our $VERSION = '0.900007';
8  
9 36 ▶use base 'DBIO::Extension';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 36 ▶use DBIO::Extension::List ();
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13  
14 5 ▶sub extension_interface { 1 }
Subroutine extension_interface: called CC=1 SCAR=0.0
Pod documented
15  
16  
17 4 ▶sub driver { 'DBIO::DuckDB' }
Subroutine driver: called CC=1 SCAR=0.0
Pod documented
18  
19  
20 1 ▶sub activation {
Subroutine activation: called CC=1 SCAR=0.0
Pod documented
21 1 my ($class, $ctx) = @_;
22 1 return { load => $ctx->{self}{name} };
23 }
24  
25  
26 4 ▶sub family_class { return }
Subroutine family_class: called CC=1 SCAR=0.0
Pod documented
27  
28  
29 11 ▶sub resolve_list {
Subroutine resolve_list: called CC=8 SCAR=20.8
Pod documented
30 11 my ($class, $schema, %opt) = @_;
31 11 ▶ return undef unless $schema && $schema->can('duckdb_extensions');
Branch: 1 branch
BranchTrueFalseTotal
unless $schema and $schema->can("duckdb_extensions") 1 10 11
Condition66%2/3
$schema and $schema->can("duckdb_extensions")
!ll&&!rl&&r
0110
MC/DC50%1/2
$schema and $schema->can("duckdb_extensions")
$schema $schema->can("duckdb_extensions")
Truth table66%2/3
A and B
A= $schemaB= $schema->can("duckdb_extensions")
ABresult
0X0
100
111
32  
33 10 my $classes = $schema->duckdb_extension_classes;
34  
35 10 my @declaration;
36 10 for my $name ($schema->duckdb_extensions) {
37 9 ▶ push @declaration, $name, (defined $classes->{$name} ? { class => $classes->{$name} } : ());
Branch: 1 branch
BranchTrueFalseTotal
defined $classes->{$name} ? : 6 3 9
38 }
39 10 ▶ return undef unless @declaration;
Branch: 1 branch
BranchTrueFalseTotal
unless @declaration 3 7 10
40  
41 my $list = DBIO::Extension::List->new(
42 declaration => \@declaration,
43 3 ▶ class_table => sub { $class->family_class($_[0]) },
Subroutine __ANON__: called CC=1 SCAR=0.0
44 7 plain_class => __PACKAGE__,
45 );
46 5 ▶ $list->check_driver('DBIO::DuckDB') if $opt{check_driver} // 1;
Branch: 1 branch
BranchTrueFalseTotal
if $opt{"check_driver"} // 1 3 2 5
Condition100%2/2
$opt{"check_driver"} // 1
l!l
23
MC/DC100%1/1
$opt{"check_driver"} // 1
$opt{"check_driver"}
Truth table100%2/2
A
A= $opt{"check_driver"}
Aresult
11
00
47 4 return $list;
48 }
49  
50 36 1;
51  
52 __END__
« blib/lib/DBIO/DuckDB/Diff/Index.pm ↑ Summary blib/lib/DBIO/DuckDB/DDL/Emit.pm »