| 1 | 2 | ▶ | use v5.10; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | package Neo4j::Error::Server; | ||||||||||||||||||||
| 6 | # ABSTRACT: Neo4j exception thrown by the Neo4j server | ||||||||||||||||||||
| 7 | 2 | $Neo4j::Error::Server::VERSION = '0.01'; | |||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | 2 | ▶ | use parent 'Neo4j::Error'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | 2 | ▶ | use List::Util 1.33 qw(all); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | 4 | ▶ | sub source { 'Server' } | ||||||||||||||||||
|
Subroutine
source: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | sub message { | ||||||||||||||||||||
| 18 | 28 | ▶ | my ($self) = @_; | ||||||||||||||||||
|
Subroutine
message: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | # Decode "strict" Jolt format if necessary | ||||||||||||||||||||
| 21 | 28 | ▶ | $self->{message} = $self->{message}{U} if ref $self->{message} eq 'HASH'; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 28 | ▶ | return $self->{message} // ''; | ||||||||||||||||||
|
Condition100%2/2
$self->{"message"} // ""
MC/DC100%1/1
$self->{"message"} // ""
$self->{"message"}
Truth table100%2/2
A
A= $self->{"message"}
| |||||||||||||||||||||
| 24 | } | ||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | sub code { | ||||||||||||||||||||
| 28 | 28 | ▶ | my ($self) = @_; | ||||||||||||||||||
|
Subroutine
code: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | # Decode "strict" Jolt format if necessary | ||||||||||||||||||||
| 31 | 28 | ▶ | $self->{code} = $self->{code}{U} if ref $self->{code} eq 'HASH'; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | 28 | ▶ | return $self->{code} if defined $self->{code}; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | my @parts = ( | ||||||||||||||||||||
| 36 | 'Neo', | ||||||||||||||||||||
| 37 | $self->{classification}, | ||||||||||||||||||||
| 38 | $self->{category}, | ||||||||||||||||||||
| 39 | $self->{title}, | ||||||||||||||||||||
| 40 | 7 | ); | |||||||||||||||||||
| 41 | 7 | ▶ | return '' unless all { defined } @parts; | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
Branch: 1 branch
| |||||||||||||||||||||
| 42 | 1 | return $self->{code} = join '.', @parts; | |||||||||||||||||||
| 43 | } | ||||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | |||||||||||||||||||||
| 46 | sub _parse_code { | ||||||||||||||||||||
| 47 | 12 | ▶ | my ($self, $part) = @_; | ||||||||||||||||||
|
Subroutine
_parse_code: called CC=3 SCAR=11.0
| |||||||||||||||||||||
| 48 | |||||||||||||||||||||
| 49 | 12 | ▶ | return '' unless defined $self->{code}; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 50 | 11 | my @parts = $self->{code} =~ m/^Neo\.([^\.]+)\.([^\.]+)\.(.+)$/i; | |||||||||||||||||||
| 51 | 11 | ▶ | return '' unless @parts; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 52 | |||||||||||||||||||||
| 53 | 8 | $self->{classification} = $parts[0]; | |||||||||||||||||||
| 54 | 8 | $self->{category} = $parts[1]; | |||||||||||||||||||
| 55 | 8 | $self->{title} = $parts[2]; | |||||||||||||||||||
| 56 | 8 | return $self->{$part}; | |||||||||||||||||||
| 57 | } | ||||||||||||||||||||
| 58 | |||||||||||||||||||||
| 59 | |||||||||||||||||||||
| 60 | sub classification { | ||||||||||||||||||||
| 61 | 11 | ▶ | my ($self) = @_; | ||||||||||||||||||
|
Subroutine
classification: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 62 | |||||||||||||||||||||
| 63 | 11 | ▶ | return $self->{classification} // $self->_parse_code('classification'); | ||||||||||||||||||
|
Condition100%3/3
$self->{"classification"} // $self->_parse_code("classification")
MC/DC100%2/2
$self->{"classification"} // $self->_parse_code("classification")
$self->{"classification"}
$self->_parse_code("classification")
Truth table100%3/3
A // B
A= $self->{"classification"}B= $self->_parse_code("classification")
| |||||||||||||||||||||
| 64 | } | ||||||||||||||||||||
| 65 | |||||||||||||||||||||
| 66 | |||||||||||||||||||||
| 67 | sub category { | ||||||||||||||||||||
| 68 | 7 | ▶ | my ($self) = @_; | ||||||||||||||||||
|
Subroutine
category: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 69 | |||||||||||||||||||||
| 70 | 7 | ▶ | return $self->{category} // $self->_parse_code('category'); | ||||||||||||||||||
|
Condition100%3/3
$self->{"category"} // $self->_parse_code("category")
MC/DC100%2/2
$self->{"category"} // $self->_parse_code("category")
$self->{"category"}
$self->_parse_code("category")
Truth table100%3/3
A // B
A= $self->{"category"}B= $self->_parse_code("category")
| |||||||||||||||||||||
| 71 | } | ||||||||||||||||||||
| 72 | |||||||||||||||||||||
| 73 | |||||||||||||||||||||
| 74 | sub title { | ||||||||||||||||||||
| 75 | 7 | ▶ | my ($self) = @_; | ||||||||||||||||||
|
Subroutine
title: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 76 | |||||||||||||||||||||
| 77 | 7 | ▶ | return $self->{title} // $self->_parse_code('title'); | ||||||||||||||||||
|
Condition100%3/3
$self->{"title"} // $self->_parse_code("title")
MC/DC100%2/2
$self->{"title"} // $self->_parse_code("title")
$self->{"title"}
$self->_parse_code("title")
Truth table100%3/3
A // B
A= $self->{"title"}B= $self->_parse_code("title")
| |||||||||||||||||||||
| 78 | } | ||||||||||||||||||||
| 79 | |||||||||||||||||||||
| 80 | |||||||||||||||||||||
| 81 | sub is_retryable { | ||||||||||||||||||||
| 82 | 4 | ▶ | my ($self) = @_; | ||||||||||||||||||
|
Subroutine
is_retryable: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 83 | |||||||||||||||||||||
| 84 | 4 | return $self->classification eq 'TransientError'; | |||||||||||||||||||
| 85 | } | ||||||||||||||||||||
| 86 | |||||||||||||||||||||
| 87 | |||||||||||||||||||||
| 88 | 2 | 1; | |||||||||||||||||||