blib/lib/SPVM/ExchangeAPI/CallerInfo.pm

filter: Statementstmt 38.6% 17 / 44 Branchbran 0.0% 0 / 12 Conditioncond 33.3% 2 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 50.0% 5 / 10 Podpod 100% 8 / 8 totaltotal 38.1% 32 / 84 CC 9 SCAR 13.4
CC
9
Cov
31%
method_abs_name
6.0
method_abs_name
6.0
file
5.2
CRAP 3.8
« blib/lib/SPVM/Builder/Config/Base.pm ↑ Summary blib/lib/SPVM/ExchangeAPI/Class.pm »
1 package SPVM::ExchangeAPI::CallerInfo;
2 759 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 760 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 # Fields
6 0 ▶sub line {
Subroutine line: not called CC=2 SCAR=10.1
Pod documented
7 5 ▶ my $self = shift;
Subroutine line: called CC=2 SCAR=10.1
Pod documented
8 0 ▶ if (@_) {
Branch: 2 branches
BranchTrueFalseTotal
if (@_) { } 0 0 0
if (@_) { } 0 0 0
9 0 $self->{line} = $_[0];
10 0 return $self;
11 }
12 else {
13 0 return $self->{line};
14 }
15 }
16  
17 0 ▶sub file {
Subroutine file: not called CC=2 SCAR=16.5
Pod documented
18 0 ▶ my $self = shift;
Subroutine file: called CC=2 SCAR=16.5
Pod documented
19 0 ▶ if (@_) {
Branch: 2 branches
BranchTrueFalseTotal
if (@_) { } 0 0 0
if (@_) { } 0 0 0
20 0 $self->{file} = $_[0];
21 0 return $self;
22 }
23 else {
24 0 return $self->{file};
25 }
26 }
27  
28 0 ▶sub method_abs_name {
Subroutine method_abs_name: not called CC=2 SCAR=17.9
Pod documented
29 0 ▶ my $self = shift;
Subroutine method_abs_name: not called CC=2 SCAR=17.9
Pod documented
30 0 ▶ if (@_) {
Branch: 2 branches
BranchTrueFalseTotal
if (@_) { } 0 0 0
if (@_) { } 0 0 0
31 0 $self->{method_abs_name} = $_[0];
32 0 return $self;
33 }
34 else {
35 0 return $self->{method_abs_name};
36 }
37 }
38  
39 # Class Methods
40 5736 ▶sub new {
Subroutine new: called CC=2 SCAR=10.1
Pod documented
41 0 ▶ my $error = shift;
Subroutine new: not called CC=2 SCAR=10.1
Pod documented
42
43 0 my $self = {
44 line => 0,
45 file => undef,
46 method_abs_name => undef,
47 @_
48 };
49
50 0 ▶ bless $self, ref $error || $error;
Condition33%2/6
ref $error || $error
l!l&&r!l&&!r
010
ref $error || $error
l!l&&r!l&&!r
057360
MC/DC0%0/2
ref $error || $error
ref $error $error
MC/DC0%0/2
ref $error || $error
ref $error $error
Truth table33%1/3
A || B
A= ref $errorB= $error
ABresult
1X1
011
000
Truth table33%1/3
A || B
A= ref $errorB= $error
ABresult
1X1
011
000
51
52 0 return $self;
53 }
54  
55 1;
56  
57 =head1 Name
58  
59 SPVM::ExchangeAPI::Options - Options Code
60  
61 =head1 Description
62  
63 The SPVM::ExchangeAPI::Options class has methods to get and set options.
64  
65 =head1 Usage
66
67 my $error = SPVM::ExchangeAPI::Options->new;
68  
69 =head1 Fields
70  
71 =head2 line
72  
73 my $line = $error->line;
74 $error->line($line);
75  
76 Gets and sets a line number.
77  
78 Examples:
79  
80 $error->line(10);
81 my $line = $error->line;
82  
83 =head2 file
84  
85 my $file = $error->file;
86 $error->file($file);
87  
88 Gets and sets a file path.
89  
90 Examples:
91  
92 $error->file("TestCase.spvm");
93 my $file = $error->file;
94  
95 =head2 method_abs_name
96  
97 my $method_abs_name = $error->method_abs_name;
98 $error->method_abs_name($method_abs_name);
99  
100 Gets and sets a method absolute name.
101  
102 Examples:
103  
104 $error->method_abs_name("TestCase#foo");
105 my $method_abs_name = $error->method_abs_name;
106  
107 =head1 Class Methods
108  
109 =head2 new
110  
111 my $error = SPVM::ExchangeAPI::Options->new(%options);
112  
113 Creates a new C<SPVM::ExchangeAPI::Options> object.
114  
115 Options:
116  
117 =over 2
118  
119 =item * C<line>
120  
121 A line number.
122  
123 =item * C<file>
124  
125 A file path.
126  
127 =item * C<method_abs_name>
128  
129 A method absolute name.
130  
131 =back
132  
133 =head1 Copyright & License
134  
135 Copyright (c) 2023 Yuki Kimoto
136  
137 MIT License
« blib/lib/SPVM/Builder/Config/Base.pm ↑ Summary blib/lib/SPVM/ExchangeAPI/Class.pm »