GraphQL/Debug.pm

filter: Statementstmt 100% 16 / 16 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 95.6% 22 / 23 CC 2 SCAR 3.0
CC
2
Cov
94%
_debug
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« GraphQL/Type/Library.pm ↑ Summary GraphQL/MaybeTypeCheck.pm »
1 package GraphQL::Debug;
2  
3 22 ▶use 5.014;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 22 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 22 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 22 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 22 our @EXPORT_OK = qw(_debug);
9  
10 =head1 NAME
11  
12 GraphQL::Debug - debug GraphQL
13  
14 =cut
15  
16 =head1 SYNOPSIS
17  
18 use GraphQL::Debug qw(_debug);
19 use constant DEBUG => $ENV{GRAPHQL_DEBUG};
20 DEBUG and _debug('current_function', $value1, $value2);
21  
22 =head1 DESCRIPTION
23  
24 Creates debugging output when called. Intended to have its calls optimised
25 out when debugging not sought, using the construct shown above. The
26 values given will be passed through L<Data::Dumper/Dumper>.
27  
28 =cut
29  
30 # TODO make log instead of diag
31 1 ▶sub _debug {
Subroutine _debug: called CC=2 SCAR=7.1
32 1 my $func = shift;
33 1 require Test::More;
34 1 ▶ Test::More::diag("$func: ", Test::More::explain(@_ == 1 ? @_ : [ @_ ]));
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 ? : 1 0 1
35 }
36  
37 22 1;
« GraphQL/Type/Library.pm ↑ Summary GraphQL/MaybeTypeCheck.pm »