lib/Perl/Tidy/Komodo.pm

filter: Statementstmt 100% 22 / 22 Branchbran 83.3% 5 / 6 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 97.4% 38 / 39 CC 5 SCAR 11.7
CC
5
Cov
97%
_try_set_perltidy_env
5.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.2
↑ Summary bin/perltidy_ko »
1 4 ▶use strictures;
Subroutine BEGIN: called CC=1 SCAR=0.0
2  
3 package Perl::Tidy::Komodo;
4  
5 4 our $VERSION = '1.151340'; # VERSION
6  
7 # ABSTRACT: tidy perl files in Komodo with a project rc
8  
9 #
10 # This file is part of Perl-Tidy-Komodo
11 #
12 #
13 # Christian Walde has dedicated the work to the Commons by waiving all of his
14 # or her rights to the work worldwide under copyright law and all related or
15 # neighboring legal rights he or she had in the work, to the extent allowable by
16 # law.
17 #
18 # Works under CC0 do not require attribution. When citing the work, you should
19 # not imply endorsement by the author.
20 #
21  
22 4 ▶use Perl::Tidy;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 4 ▶use File::chdir;
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25  
26 2 ▶sub run {
Subroutine run: called CC=1 SCAR=0.0
Pod documented
27 2 _try_set_perltidy_env();
28 2 Perl::Tidy::perltidy();
29 }
30  
31 2 ▶sub _try_set_perltidy_env {
Subroutine _try_set_perltidy_env: called CC=5 SCAR=16.1
32 2 ▶ return if exists $ENV{PERLTIDY};
Branch: 1 branch
BranchTrueFalseTotal
if exists $ENV{"PERLTIDY"} 0 2 2
33 2 my @cwd_store = @CWD;
34 2 ▶ while ( $CWD[0] ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($Perl::Tidy::Komodo::CWD[0]) 11 1 12
35 11 ▶ if ( -d 'lib' and -f '.perltidyrc' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (-d "lib" and -f ".perltidyrc") 1 10 11
Condition100%3/3
-d "lib" and -f ".perltidyrc"
!ll&&!rl&&r
821
MC/DC100%2/2
-d "lib" and -f ".perltidyrc"
-d "lib" -f ".perltidyrc"
Truth table100%3/3
A and B
A= -d "lib"B= -f ".perltidyrc"
ABresult
0X0
100
111
36 1 $ENV{PERLTIDY} = $CWD;
37 1 last;
38 }
39 10 pop @CWD;
40 }
41 2 @CWD = @cwd_store;
42 2 return;
43 }
44  
45 4 1;
46  
47 __END__
↑ Summary bin/perltidy_ko »