PLS/Server/Request/Factory.pm

filter: Statementstmt 70.9% 22 / 31 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 87.5% 7 / 8 Podpod 0.0% 0 / 1 totaltotal 50.8% 29 / 57 CC 7 SCAR 33.5
CC
7
Cov
49%
new
56.0
BEGIN
1.0
BEGIN
1.0
CRAP 28.5
« PLS/Parser/PackageSymbols.pm ↑ Summary PLS/Parser/Element/Subroutine.pm »
1 package PLS::Server::Request::Factory;
2  
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  
6 1 ▶use PLS::Server::Method::CompletionItem;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use PLS::Server::Method::TextDocument;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use PLS::Server::Method::Workspace;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use PLS::Server::Method::ServerMethod;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use PLS::Server::Request;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 =head1 NAME
13  
14 PLS::Server::Request::Factory
15  
16 =head1 DESCRIPTION
17  
18 This is a factory class. Given a request from the client, this
19 will determine the appropriate subclass of L<PLS::Server::Request> for the request
20 and return it.
21  
22 =cut
23  
24 sub new
25 {
26 0 ▶ my ($class, $request) = @_;
Subroutine new: not called CC=7 SCAR=40.3
Pod undocumented
27  
28 0 my $method = $request->{method};
29 0 ($method) = split '/', $method;
30  
31 # create and return request classes here
32  
33 0 ▶ if ($method eq '' or $method eq '$' or not $PLS::Server::State::INITIALIZED)
Branch: 4 branches
BranchTrueFalseTotal
if ($method eq '' or $method eq '$' or not $PLS::Server::State::INITIALIZED) { } 0 0 0
elsif ($method eq 'textDocument') { } 0 0 0
elsif ($method eq 'workspace') { } 0 0 0
elsif ($method eq 'completionItem') { } 0 0 0
Condition0%0/6
$method eq "" or $method eq "\$" or not $PLS::Server::State::INITIALIZED
l!l&&r!l&&!r
000
$method eq "" or $method eq "\$"
l!l&&r!l&&!r
000
MC/DC0%0/3
$method eq "" or $method eq "\$" or not $PLS::Server::State::INITIALIZED
$method eq "" $method eq "\$" not $PLS::Server::State::INITIALIZED
Truth table0%0/4
A or B or not(C)
A= $method eq ""B= $method eq "\$"C= not $PLS::Server::State::INITIALIZED
ABCresult
1XX1
01X1
0011
0000
34 {
35 0 return PLS::Server::Method::ServerMethod::get_request($request);
36 }
37 elsif ($method eq 'textDocument')
38 {
39 0 return PLS::Server::Method::TextDocument::get_request($request);
40 }
41 elsif ($method eq 'workspace')
42 {
43 0 return PLS::Server::Method::Workspace::get_request($request);
44 }
45 elsif ($method eq 'completionItem')
46 {
47 0 return PLS::Server::Method::CompletionItem::get_request($request);
48 }
49  
50 0 return PLS::Server::Request->new($request);
51 } ## end sub new
52  
53 1 1;
« PLS/Parser/PackageSymbols.pm ↑ Summary PLS/Parser/Element/Subroutine.pm »