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             #!/usr/bin/env perl
2              
3             package main;
4 1     1   557 use Modern::Perl '2011'; ## no critic (Modules::ProhibitUseQuotedVersion)
  1         13336  
  1         7  
5 1     1   1020 use utf8;
  1         15  
  1         5  
6              
7 1         112 our $VERSION = '0.023'; # VERSION
8 1     1   713 use Getopt::Long::Descriptive;
  1         45687  
  1         7  
9 1     1   893 use App::DBCritic;
  1         5  
  1         127340  
10              
11 1         10 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       1784 if ( $opt->help ) {
23 0         0 print $usage->text;
24 0         0 exit;
25             }
26              
27             my $critic = App::DBCritic->new(
28 1         6 map { $_ => $opt->$_ }
29 1         9 grep { defined $opt->$_ } qw(dsn username password class_name),
  4         17  
30             );
31 1         1974 $critic->critique();
32              
33             # PODNAME: dbcritic
34             # ABSTRACT: Critique a database schema for best practices
35              
36             __END__