BCSSH/Handler/browse.pm

filter: Statementstmt 45.4% 10 / 22 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 40.0% 2 / 5 Podpod 0.0% 0 / 1 totaltotal 37.5% 12 / 32 CC 4 SCAR 18.7
CC
4
Cov
38%
_build_browse
12.0
handle
6.0
__ANON__
2.0
CRAP 6.5
« BCSSH.pm ↑ Summary BCSSH/Command/vi.pm »
1 package App::BCSSH::Handler::browse;
2 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use Browser::Open qw(open_browser);
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 with 'App::BCSSH::Handler';
6  
7 1 has browser => (is => 'ro');
8 1 has browse => (is => 'lazy', init_arg => undef);
9 0 ▶sub _build_browse {
Subroutine _build_browse: not called CC=3 SCAR=24.8
10 0 my $self = shift;
11 0 my $browser = $self->browser;
12 0 ▶ if ($browser) {
Branch: 1 branch
BranchTrueFalseTotal
if ($browser) { } 0 0 0
13 0 ▶ my @browser = ref $browser ? @$browser : $browser;
Branch: 1 branch
BranchTrueFalseTotal
ref $browser ? : 0 0 0
14 0 ▶ return sub { system @browser, @_ };
Subroutine __ANON__: not called CC=1 SCAR=6.9
15 }
16 else {
17 0 return \&open_browser;
18 }
19 }
20  
21 0 ▶sub handle {
Subroutine handle: not called CC=2 SCAR=17.9
Pod undocumented
22 0 my ($self, $send, $args) = @_;
23 0 my $urls = $args->{urls};
24  
25 0 for my $url (@$urls) {
26 0 $self->browse->($url);
27 }
28 0 $send->();
29 }
30  
31 1 1;
« BCSSH.pm ↑ Summary BCSSH/Command/vi.pm »