bin/dbcritic

filter: Statementstmt 91.6% 22 / 24 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 90.3% 28 / 31 CC 1 SCAR 0.0
CC
1
Cov
88%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/App/DBCritic/Policy/DuplicateRelationships.pm ↑ Summary blib/lib/App/DBCritic/Loader.pm »
1 #!/usr/bin/env perl
2  
3 package main;
4 1 ▶use Modern::Perl '2011'; ## no critic (Modules::ProhibitUseQuotedVersion)
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 our $VERSION = '0.023'; # VERSION
8 1 ▶use Getopt::Long::Descriptive;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use App::DBCritic;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 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 ▶if ( $opt->help ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($opt->help) 0 1 1
23 0 print $usage->text;
24 0 exit;
25 }
26  
27 my $critic = App::DBCritic->new(
28 1 map { $_ => $opt->$_ }
29 1 grep { defined $opt->$_ } qw(dsn username password class_name),
30 );
31 1 $critic->critique();
32  
33 # PODNAME: dbcritic
34 # ABSTRACT: Critique a database schema for best practices
35  
36 __END__
« blib/lib/App/DBCritic/Policy/DuplicateRelationships.pm ↑ Summary blib/lib/App/DBCritic/Loader.pm »