BSON/Bool.pm

filter: Statementstmt 87.5% 21 / 24 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 8 / 10 Podpod 40.0% 2 / 5 totaltotal 76.7% 33 / 43 CC 3 SCAR 7.3
CC
3
Cov
82%
value
6.0
new
2.0
op_eq
2.0
CRAP 2.1
« BSON/ObjectId.pm ↑ Summary BSON/Types.pm »
1 71 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 71 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 71 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package BSON::Bool;
6 # ABSTRACT: Legacy BSON type wrapper for Booleans (DEPRECATED)
7  
8 71 ▶use version;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 71 our $VERSION = 'v1.12.2';
10  
11 71 ▶use boolean 0.45 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
12 71 our @ISA = qw/boolean/;
13  
14 8830 ▶sub new {
Subroutine new: called CC=2 SCAR=6.9
Pod undocumented
15 8830 my ( $class, $bool ) = @_;
16 8830 ▶ return bless \(my $dummy = $bool ? 1 : 0), $class;
Branch: 1 branch
BranchTrueFalseTotal
$bool ? : 4450 4380 8830
17 }
18  
19 0 ▶sub value {
Subroutine value: not called CC=2 SCAR=17.9
Pod undocumented
20 0 ▶ ${$_[0]} ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
${$_[0];} ? : 0 0 0
21 }
22  
23 4 ▶sub true {
Subroutine true: called CC=1 SCAR=0.0
Pod documented
24 4 return $_[0]->new(1);
25 }
26  
27 4 ▶sub false {
Subroutine false: called CC=1 SCAR=0.0
Pod documented
28 4 return $_[0]->new(0);
29 }
30  
31 0 ▶sub op_eq {
Subroutine op_eq: not called CC=1 SCAR=6.9
Pod undocumented
32 0 return !! $_[0] == !! $_[1];
33 }
34  
35 71 1;
36  
37 =pod
38  
39 =encoding UTF-8
40  
41 =head1 NAME
42  
43 BSON::Bool - Legacy BSON type wrapper for Booleans (DEPRECATED)
44  
45 =head1 VERSION
46  
47 version v1.12.2
48  
49 =head1 DESCRIPTION
50  
51 This module has been deprecated as it was not compatible with
52 other common boolean implementations on CPAN.
53  
54 You are strongly encouraged to use L<boolean> directly instead.
55  
56 =for Pod::Coverage new value true false op_eq
57  
58 =head1 AUTHORS
59  
60 =over 4
61  
62 =item *
63  
64 David Golden <david@mongodb.com>
65  
66 =item *
67  
68 Stefan G. <minimalist@lavabit.com>
69  
70 =back
71  
72 =head1 COPYRIGHT AND LICENSE
73  
74 This software is Copyright (c) 2020 by Stefan G. and MongoDB, Inc.
75  
76 This is free software, licensed under:
77  
78 The Apache License, Version 2.0, January 2004
79  
80 =cut
81  
82 __END__
« BSON/ObjectId.pm ↑ Summary BSON/Types.pm »