Simple/Migrate.pm

filter: Statementstmt 67.6% 23 / 34 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 87.5% 7 / 8 Podpod n/a totaltotal 68.1% 30 / 44 CC 2 SCAR 7.5
CC
2
Cov
64%
_cmd_migrate
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.1
« Simple/DumpSpec.pm ↑ Summary Simple/Constants.pm »
1 package CLI::Simple::Migrate;
2  
3 11 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 11 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 11 ▶use CLI::Simple::Constants qw(:booleans);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 11 ▶use CLI::Simple::Helpers qw(:all);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 11 ▶use CLI::Simple::Scaffold qw(_cmd_scaffold);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 11 ▶use English qw(-no_match_vars);
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 11 ▶use parent qw(Exporter);
Subroutine BEGIN: called CC=1 SCAR=0.0
13 11 our @EXPORT_OK = qw(_cmd_migrate);
14  
15 ########################################################################
16 0 ▶sub _cmd_migrate {
Subroutine _cmd_migrate: not called CC=2 SCAR=17.9
17 ########################################################################
18 0 my ( $class, $commands, $option_specs ) = @_;
19  
20 # dump spec with role class names then scaffold
21 0 my $yaml = _generate_spec_yaml( $class, $commands, $option_specs, $TRUE );
22 0 my $spec_file = _spec_filename($class);
23  
24 0 ▶ open my $fh, '>', $spec_file
Branch: 1 branch
BranchTrueFalseTotal
open my $fh, ">", $spec_file or die "ERROR: could not write ${spec_file}: $CLI::Simple::Migrate::OS_ERROR\n" 0 0 0
25 or die "ERROR: could not write $spec_file: $OS_ERROR\n";
26 0 print {$fh} $yaml;
27 0 close $fh;
28  
29 0 printf {*STDOUT} "wrote %s\n", $spec_file;
30  
31 # now scaffold from the spec we just wrote
32 0 _cmd_scaffold( $class, $commands, $option_specs );
33  
34 0 return $SUCCESS;
35 }
36  
37 11 1;
« Simple/DumpSpec.pm ↑ Summary Simple/Constants.pm »