lib/ORDB/DebianModules/Generator.pm

filter: Statementstmt 44.4% 8 / 18 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 2 / 3 Podpod 0.0% 0 / 1 totaltotal 41.6% 10 / 24 CC 3 SCAR 20.3
CC
3
Cov
40%
save
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 7.6
↑ Summary script/generate-debian-modules-database.pl »
1 package ORDB::DebianModules::Generator;
2  
3 1 ▶use Debian::ModuleList;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use DBI;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 our $VERSION = '0.02';
7  
8 0 ▶sub save {
Subroutine save: not called CC=3 SCAR=24.8
Pod undocumented
9 0 my $file = shift;
10 0 my @list = Debian::ModuleList::list_modules();
11 0 ▶ unlink($file) if(-f $file);
Branch: 1 branch
BranchTrueFalseTotal
if -f $file 0 0 0
12 0 my $dbh = DBI->connect("dbi:SQLite:dbname=" . $file,"","");
13 0 $dbh->do("CREATE TABLE debian_module ( module TEXT NOT NULL PRIMARY KEY );");
14 0 $sth = $dbh->prepare("INSERT INTO debian_module (module) VALUES (?);");
15 0 $sth->execute($_) foreach(@list);
16 0 $sth->finish();
17 0 $dbh->do("CREATE INDEX debian_module__module on debian_module ( module );");
18 0 $dbh->disconnect;
19 }
20  
21 =head1 NAME
22  
23 ORDB::DebianModules::Generator - generator for the database ORDB::DebianModules points to
24  
25 =cut
26  
27 1 1;
↑ Summary script/generate-debian-modules-database.pl »