Karabiner/Manipulator/Conditions/Frontmost_application_if.pm

filter: Statementstmt 100% 36 / 36 Branchbran 50.0% 3 / 6 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 9 / 9 Podpod 0.0% 0 / 4 totaltotal 84.4% 49 / 58 CC 5 SCAR 4.8
CC
5
Cov
91%
new
2.0
add_bundle_identifiers
2.0
add_file_paths
2.0
CRAP 1.6
« Karabiner/Manipulator/Actions/To_delayed_if_canceled.pm ↑ Summary Karabiner/Manipulator/Conditions/Keyboard_type_if.pm »
1 package JSON::Karabiner::Manipulator::Conditions::Frontmost_application_if ;
2 1 $JSON::Karabiner::Manipulator::Conditions::Frontmost_application_if::VERSION = '0.018';
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use JSON;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use parent 'JSON::Karabiner::Manipulator::Conditions';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
Pod undocumented
10 2 my $class = shift;
11 2 my ($type, $value) = @_;
12 2 my $obj = $class->SUPER::new($type, $value);
13 2 ▶ $obj->{data} = $value || [],
Condition50%1/2
$value || []
l!l
02
MC/DC0%0/1
$value || []
$value
Truth table50%1/2
A
A= $value
Aresult
11
00
14 return $obj;
15 }
16  
17 2 ▶sub add_bundle_identifiers {
Subroutine add_bundle_identifiers: called CC=2 SCAR=7.0
Pod undocumented
18 2 my $s = shift;
19 2 my @identifiers = @_;
20 2 ▶ croak ('No identifier regular expressions passed.') unless @identifiers;
Branch: 1 branch
BranchTrueFalseTotal
unless @identifiers 0 2 2
21 2 push @{$s->{data}}, { bundle_identifiers => [ @identifiers ] };
22  
23 }
24  
25 1 ▶sub add_file_paths {
Subroutine add_file_paths: called CC=2 SCAR=7.0
Pod undocumented
26 1 my $s = shift;
27 1 my @files = @_;
28 1 ▶ croak ('No file path regular expressions passed.') unless @files;
Branch: 1 branch
BranchTrueFalseTotal
unless @files 0 1 1
29 1 push @{$s->{data}}, { file_paths => [ @files ] };
30  
31 }
32  
33 1 ▶sub add_description {
Subroutine add_description: called CC=2 SCAR=7.0
Pod undocumented
34 1 my $s = shift;
35 1 my $desc = shift;
36 1 ▶ croak ('No file path regular expressions passed.') unless $desc;
Branch: 1 branch
BranchTrueFalseTotal
unless $desc 0 1 1
37 1 push @{$s->{data}}, { description => $desc };
38  
39 }
40 # ABSTRACT: definition for Frontmost_application_if condition
41  
42 1 1;
43  
44 __END__
« Karabiner/Manipulator/Actions/To_delayed_if_canceled.pm ↑ Summary Karabiner/Manipulator/Conditions/Keyboard_type_if.pm »