Catmandu/Cmd/compile.pm

filter: Statementstmt 93.1% 27 / 29 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 2 / 2 totaltotal 92.5% 37 / 40 CC 2 SCAR 2.3
CC
2
Cov
90%
command
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Catmandu/Fix/Condition/less_than.pm ↑ Summary Catmandu/Flushable.pm »
1 package Catmandu::Cmd::compile;
2  
3 14 ▶use Catmandu::Sane;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 14 our $VERSION = '1.2025';
6  
7 14 ▶use parent 'Catmandu::Cmd';
Subroutine BEGIN: called CC=1 SCAR=0.0
8 14 ▶use Catmandu;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 14 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 14 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 1 ▶sub command_opt_spec {
Subroutine command_opt_spec: called CC=1 SCAR=0.0
Pod documented
13 (
14 1 ["var=s%", ""],
15 ["preprocess|pp", ""],
16 ["fix|fix=s@", "", {hidden => 1}],
17 );
18 }
19  
20 1 ▶sub command {
Subroutine command: called CC=2 SCAR=7.2
Pod documented
21 1 my ($self, $opts, $args) = @_;
22  
23 1 ▶ unless (@$args == 1) {
Branch: 1 branch
BranchTrueFalseTotal
unless (@$args == 1) 0 1 1
24 0 say STDERR "usage: $0 compile <FILE>|<FIX> [<FILE>|<FIX> [...]]\n";
25 0 exit 1;
26 }
27  
28 1 $opts->{fix} = $args;
29  
30 1 my $fixer = $self->_build_fixer($opts);
31 1 my $fixes = $fixer->emit;
32 1 my $captures = Dumper($fixer->_captures);
33  
34 1 $captures =~ s/^\$VAR1/\$_[1]/;
35  
36 1 print $captures;
37 1 print $fixes;
38 }
39  
40 14 1;
41  
42 __END__
« Catmandu/Fix/Condition/less_than.pm ↑ Summary Catmandu/Flushable.pm »