Simple/Migrate.pm

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