bin/mwtail

filter: Statementstmt 85.0% 17 / 20 Branchbran 62.5% 5 / 8 Conditioncond 66.6% 4 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 60.0% 3 / 5 Podpod n/a totaltotal 69.0% 29 / 42 CC 1 SCAR 2.0
CC
1
Cov
76%
help
2.0
__ANON__
1.1
BEGIN
1.0
CRAP 1.2
« blib/lib/Mojolicious/Plugin/Webtail.pm ↑ Summary builder/MyBuilder.pm »
1 #!/usr/bin/env perl
2 3 ▶use Mojolicious::Lite;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use Getopt::Long qw{ :config posix_default no_ignore_case gnu_compat pass_through };
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use File::Spec;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 my $opts = +{};
7 3 ▶GetOptions( $opts, qw{ file=s webtailrc=s tail-opts=s v|verbose } ) or help();
Branch: 1 branch
BranchTrueFalseTotal
&GetOptions($opts, ("file=s", "webtailrc=s", "tail-opts=s", "v|verbose")) or help() 3 0 3
8 3 ▶help() if ( $ENV{MOJO_HELP} );
Branch: 1 branch
BranchTrueFalseTotal
if $ENV{"MOJO_HELP"} 0 3 3
9  
10 0 ▶sub help { exec "perldoc $0" }
Subroutine help: not called CC=1 SCAR=6.9
11  
12 3 ▶if ( !$opts->{webtailrc}
Branch: 1 branch
BranchTrueFalseTotal
if (not $opts->{"webtailrc"} and $ENV{"HOME"} and -e (my $webtailrc = "File::Spec"->catfile($ENV{"HOGE"}, ".webtailrc"))) 0 3 3
Condition66%4/6
not $opts->{"webtailrc"} and $ENV{"HOME"} and -e (my $webtailrc = "File::Spec"->catfile($ENV{"HOGE"}, ".webtailrc"))
!ll&&!rl&&r
120
not $opts->{"webtailrc"} and $ENV{"HOME"}
!ll&&!rl&&r
102
MC/DC0%0/3
not $opts->{"webtailrc"} and $ENV{"HOME"} and -e (my $webtailrc = "File::Spec"->catfile($ENV{"HOGE"}, ".webtailrc"))
not $opts->{"webtailrc"} $ENV{"HOME"} -e (my $webtailrc = "File::Spec"->catfile($ENV{"HOGE"}, ".webtailrc"))
Truth table50%2/4
not(A) and B and C
A= not $opts->{"webtailrc"}B= $ENV{"HOME"}C= -e (my $webtailrc = "File::Spec"->catfile($ENV{"HOGE"}, ".webtailrc"))
ABCresult
0XX0
10X0
1100
1111
13 && $ENV{HOME}
14 && -e ( my $webtailrc = File::Spec->catfile( $ENV{HOGE}, '.webtailrc' ) )
15 )
16 {
17 0 $opts->{webtailrc} = $webtailrc;
18 }
19  
20 3 ▶app->log->level('info') unless ( $opts->{v} );
Branch: 1 branch
BranchTrueFalseTotal
unless $opts->{"v"} 2 1 3
21  
22 3 plugin 'Webtail', file => $opts->{file}, webtailrc => $opts->{webtailrc}, tail_opts => $opts->{'tail-opts'};
23  
24 0 ▶get '/' => sub { shift->redirect_to('/webtail') };
Subroutine __ANON__: not called CC=1 SCAR=1.2
25  
26 3 app->start('daemon', @ARGV);
27  
28 __END__
« blib/lib/Mojolicious/Plugin/Webtail.pm ↑ Summary builder/MyBuilder.pm »