Karabiner/Manipulator/Conditions/Event_changed_if.pm

filter: Statementstmt 100% 26 / 26 Branchbran 50.0% 2 / 4 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 2 totaltotal 85.7% 36 / 42 CC 4 SCAR 6.1
CC
4
Cov
91%
add_value
3.1
new
2.0
BEGIN
1.0
CRAP 1.8
« Karabiner/Manipulator/Conditions/Variable_unless.pm ↑ Summary Karabiner/Manipulator/Actions/To_delayed_if_invoked.pm »
1 package JSON::Karabiner::Manipulator::Conditions::Event_changed_if ;
2 1 $JSON::Karabiner::Manipulator::Conditions::Event_changed_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::Variable_if';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
Pod undocumented
10 1 my $class = shift;
11 1 my ($type, $value) = @_;
12 1 my $obj = $class->SUPER::new($type, $value);
13 1 ▶ $obj->{data} = $value || {},
Condition50%1/2
$value || {}
l!l
01
MC/DC0%0/1
$value || {}
$value
Truth table50%1/2
A
A= $value
Aresult
11
00
14 return $obj;
15 }
16  
17 1 ▶sub add_value {
Subroutine add_value: called CC=3 SCAR=11.3
Pod undocumented
18 1 my $s = shift;
19 1 my $value = shift;
20 1 ▶ $value = $value eq 'true' ? JSON::true : JSON::false;
Branch: 1 branch
BranchTrueFalseTotal
$value eq 'true' ? : 1 0 1
21 1 ▶ croak 'A value for the varaible name is required' unless $value;
Branch: 1 branch
BranchTrueFalseTotal
unless $value 0 1 1
22 #TODO: Validates args
23 1 $s->{data}{value} = $value;
24  
25 }
26  
27 # ABSTRACT: definition for event_changed_if condition
28  
29 1 1;
30  
31 __END__
« Karabiner/Manipulator/Conditions/Variable_unless.pm ↑ Summary Karabiner/Manipulator/Actions/To_delayed_if_invoked.pm »