File Coverage

bin/dbcritic
Criterion Covered Total %
statement 19 21 90.4
branch 1 2 50.0
condition n/a
subroutine 4 4 100.0
pod n/a
total 24 27 88.8


line stmt bran cond sub pod time code
1             #!perl
2              
3             package main;
4 1     1   494 use Modern::Perl '2011'; ## no critic (Modules::ProhibitUseQuotedVersion)
  1         9910  
  1         5  
5 1     1   1001 use utf8;
  1         11  
  1         5  
6              
7 1         2 our $VERSION = '0.021'; # TRIAL VERSION
8 1     1   599 use Getopt::Long::Descriptive;
  1         37239  
  1         8  
9 1     1   790 use App::DBCritic;
  1         3  
  1         89754  
10              
11 1         11 my ( $opt, $usage ) = describe_options(
12             '%c %o',
13             [ 'dsn|d=s' => 'DBI data source name' ],
14             [ 'username|user|u:s' => 'name of user to use to connect to database' ],
15             [ 'password|pass|p:s' => 'password for connecting to database' ],
16             [ 'class_name|class|c:s' =>
17             'DBIx::Class::Schema to use rather than generating one',
18             ],
19             [ 'help|h' => 'print usage message and exit' ],
20             );
21              
22 1 50       1270 if ( $opt->help ) {
23 0         0 print $usage->text;
24 0         0 exit;
25             }
26              
27 1         4 my $critic = App::DBCritic->new(
28 4         12 map { $_ => $opt->$_ }
29 1         11 grep { defined $opt->$_ } qw(dsn username password class_name),
30             );
31 1         1286 $critic->critique();
32              
33             # PODNAME: dbcritic
34             # ABSTRACT: Critique a database schema for best practices
35              
36             __END__