blib/lib/App/File/IsSorted/Command/check.pm

filter: Statementstmt 65.5% 19 / 29 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 54.5% 6 / 11 Podpod 100% 5 / 5 totaltotal 63.8% 30 / 47 CC 3 SCAR 10.2
CC
3
Cov
61%
validate_args
6.0
execute
6.0
abstract
2.0
CRAP 2.8
« Build ↑ Summary blib/lib/File/IsSorted.pm »
1 package App::File::IsSorted::Command::check;
2 1 $App::File::IsSorted::Command::check::VERSION = '0.0.5';
3 1 ▶use App::File::IsSorted -command;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use autodie;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use 5.016;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶use File::IsSorted ();
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 0 ▶sub abstract { "check for files having sorted lines" }
Subroutine abstract: not called CC=1 SCAR=6.9
Pod documented
13  
14 0 ▶sub description { return abstract(); }
Subroutine description: not called CC=1 SCAR=6.9
Pod documented
15  
16 sub opt_spec
17 {
18 0 ▶ return ();
Subroutine opt_spec: not called CC=1 SCAR=6.9
Pod documented
19 }
20  
21 sub validate_args
22 {
23 0 ▶ my ( $self, $opt, $args ) = @_;
Subroutine validate_args: not called CC=2 SCAR=17.9
Pod documented
24  
25 # no args allowed but options!
26 0 ▶ $self->usage_error("args required") if not @$args;
Branch: 1 branch
BranchTrueFalseTotal
if not @$args 0 0 0
27 }
28  
29 sub execute
30 {
31 0 ▶ my ( $self, $opt, $args ) = @_;
Subroutine execute: not called CC=2 SCAR=17.9
Pod documented
32  
33 0 my $checker = File::IsSorted->new;
34  
35 0 foreach my $path (@$args)
36 {
37 0 $checker->is_file_sorted( { path => $path } );
38 }
39  
40 0 return;
41 }
42  
43 1 1;
44  
45 __END__
« Build ↑ Summary blib/lib/File/IsSorted.pm »