blib/lib/Mojo/Response/JSON/Path.pm

filter: Statementstmt 100% 17 / 17 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 100% 24 / 24 CC 2 SCAR 2.9
CC
2
Cov
100%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
↑ Summary
1 package Mojo::Response::JSON::Path;
2  
3 # ABSTRACT: use JSON::Path for searching JSON responses
4  
5 2 ▶use Class::Method::Modifiers qw/install_modifier/;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Mojo::Message;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use JSON::Path;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 ▶sub import {
Subroutine import: called CC=1 SCAR=0.0
10 2 my $class = shift;
11  
12 install_modifier "Mojo::Message", 'around', 'json',
13 2 ▶ sub {
Subroutine __ANON__: called CC=2 SCAR=6.9
14 2 my $orig = shift;
15 2 my $self = shift;
16  
17 2 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) { } 1 1 2
18 1 return JSON::Path->new($_[0])->value($orig->($self));
19 } else {
20 1 return $orig->($self);
21 }
22 2 };
23 }
24  
25 2 1
26  
↑ Summary