RST/Error.pm

filter: Statementstmt 43.7% 7 / 16 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 40.0% 2 / 5 Podpod 100% 3 / 3 totaltotal 38.7% 12 / 31 CC 5 SCAR 28.5
CC
5
Cov
33%
cases
30.0
severity
2.0
description
2.0
CRAP 17.3
↑ Summary RST/DataProvider.pm »
1 package ICANN::RST::Error;
2 # ABSTRACT: an object representing an RST error.
3 1 ▶use base qw(ICANN::RST::Base);
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 0 ▶sub severity { $_[0]->{'Severity'} }
Subroutine severity: not called CC=1 SCAR=6.9
Pod documented
7 0 ▶sub description { ICANN::RST::Text->new($_[0]->{'Description'}) }
Subroutine description: not called CC=1 SCAR=6.9
Pod documented
8  
9 sub cases {
10 0 ▶ my $self = shift;
Subroutine cases: not called CC=5 SCAR=34.0
Pod documented
11  
12 0 my %cases;
13  
14 0 foreach my $case ($self->spec->cases) {
15 0 foreach my $error ($case->errors) {
16 0 ▶ $cases{$case->id} = $case if ($error->id eq $self->id && !defined($cases{$case->id}));
Branch: 1 branch
BranchTrueFalseTotal
if $error->id eq $self->id and not defined $cases{$case->id} 0 0 0
Condition0%0/3
$error->id eq $self->id and not defined $cases{$case->id}
!ll&&!rl&&r
000
MC/DC0%0/2
$error->id eq $self->id and not defined $cases{$case->id}
$error->id eq $self->id not defined $cases{$case->id}
Truth table0%0/3
A and not(B)
A= $error->id eq $self->idB= not defined $cases{$case->id}
ABresult
0X0
100
111
17 }
18 }
19  
20 0 return sort { $a->id cmp $b->id } values(%cases);
21 }
22  
23 1 1;
24  
25 __END__
26  
27 =pod
28  
29 =encoding UTF-8
30  
31 =head1 NAME
32  
33 ICANN::RST::Error - an object representing an RST error.
34  
35 =head1 VERSION
36  
37 version 0.03
38  
39 =head1 DESCRIPTION
40  
41 This class inherits from L<ICANN::RST::Base> (so it has the C<id()> and
42 C<spec()> methods).
43  
44 =head1 METHODS
45  
46 =head2 description()
47  
48 A L<ICANN::RST::Text> object containing the long textual description of the
49 error.
50  
51 =head2 severity()
52  
53 A string containing one of C<WARNING>, C<ERROR> or C<CRITICAL>.
54  
55 =head2 cases()
56  
57 A list of all C<ICANN::RST::Case> objects that produce this error.
58  
59 =head1 AUTHOR
60  
61 Gavin Brown <gavin.brown@icann.org>
62  
63 =head1 COPYRIGHT AND LICENSE
64  
65 This software is copyright (c) 2025 by Internet Corporation for Assigned Names and Number (ICANN).
66  
67 This is free software; you can redistribute it and/or modify it under
68 the same terms as the Perl 5 programming language system itself.
69  
70 =cut
↑ Summary RST/DataProvider.pm »