CogBase/Node.pm

filter: Statementstmt 94.5% 35 / 37 Branchbran 50.0% 2 / 4 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 8 / 8 Podpod n/a totaltotal 85.1% 46 / 54 CC 4 SCAR 9.4
CC
4
Cov
86%
_initialize
5.3
BEGIN
1.0
BEGIN
1.0
CRAP 2.5
« CogBase/Connection/FileSystem.pm ↑ Summary CogBase/Base.pm »
1 package CogBase::Node;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use CogBase::Base -base;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Data::UUID;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Digest::MD5;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Convert::Base32;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 field '_connection';
10  
11 1 field 'Id';
12 1 field 'Type';
13 1 field 'Owner';
14 1 field 'Group';
15 1 field 'Perms';
16 1 field 'Revision';
17 1 field 'Hid';
18 1 field 'Tags' => [];
19  
20 1 ▶sub _initialize {
Subroutine _initialize: called CC=4 SCAR=16.6
21 1 my $self = shift;
22 1 ▶ if (my $type = $self->Type) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $type = $self->Type) 1 0 1
23 1 bless $self, "CogBase::$type";
24 }
25 1 my $id = $self->Id;
26 1 ▶ if ($id and $id =~ s/-0*(\d+)$//) {
Branch: 1 branch
BranchTrueFalseTotal
if ($id and $id =~ s/-0*(\d+)$//) 0 1 1
Condition33%1/3
$id and $id =~ s/-0*(\d+)$//
!ll&&!rl&&r
100
MC/DC0%0/2
$id and $id =~ s/-0*(\d+)$//
$id $id =~ s/-0*(\d+)$//
Truth table33%1/3
A and B
A= $idB= $id =~ s/-0*(\d+)$//
ABresult
0X0
100
111
27 0 $self->Id($id);
28 0 $self->Revision($1);
29 }
30 }
31  
32 1 ▶sub _fields {
Subroutine _fields: called CC=1 SCAR=0.0
33 1 my $self = shift;
34 1 return grep !/^[A-Z_]/, keys %$self;
35 }
36  
37 1 1;
« CogBase/Connection/FileSystem.pm ↑ Summary CogBase/Base.pm »