PropertyDefinitions/EntryType.pm

filter: Statementstmt 47.8% 11 / 23 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 33.3% 3 / 9 Podpod 0.0% 0 / 6 totaltotal 35.0% 14 / 40 CC 2 SCAR 9.2
CC
2
Cov
44%
property
6.0
new
2.0
properties
2.0
CRAP 2.5
« PropertyDefinitions/Property/Nested.pm ↑ Summary PropertyDefinitions.pm »
1 package OPTIMADE::PropertyDefinitions::EntryType;
2  
3 # ABSTRACT: OPTIMADE Entry Type
4 2 our $VERSION = '0.1.0'; # VERSION
5  
6 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 ▶use OPTIMADE::PropertyDefinitions::Property;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 sub new
12 0 ▶{
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
13 0 my( $class, $parent, $name ) = @_;
14 0 return bless { parent => $parent, name => $name }, $class;
15 }
16  
17 sub property($)
18 0 ▶{
Subroutine property: not called CC=2 SCAR=17.9
Pod undocumented
19 0 my( $self, $property ) = @_;
20 0 ▶ die "no such property '$property'\n" unless $self->raw->{properties}{$property};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->raw->{"properties"}{$property} 0 0 0
21 0 return OPTIMADE::PropertyDefinitions::Property->new( $self, $property );
22 }
23  
24 sub properties()
25 0 ▶{
Subroutine properties: not called CC=1 SCAR=6.9
Pod undocumented
26 0 my( $self ) = @_;
27 0 return map { OPTIMADE::PropertyDefinitions::Property->new( $self, $_ ) }
28 0 sort keys %{$self->raw->{properties}};
29 }
30  
31 0 ▶sub name() { $_[0]->{name} }
Subroutine name: not called CC=1 SCAR=6.9
Pod undocumented
32 0 ▶sub parent() { $_[0]->{parent} }
Subroutine parent: not called CC=1 SCAR=6.9
Pod undocumented
33  
34 0 ▶sub raw() { $_[0]->parent->raw->{entrytypes}{$_[0]->name} }
Subroutine raw: not called CC=1 SCAR=6.9
Pod undocumented
35  
36 2 1;
« PropertyDefinitions/Property/Nested.pm ↑ Summary PropertyDefinitions.pm »