blib/lib/Perlilog/PLerror.pm

filter: Statementstmt 34.2% 13 / 38 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 18.1% 2 / 11 Podpod 0.0% 0 / 10 totaltotal 24.5% 15 / 61 CC 2 SCAR 8.8
CC
2
Cov
32%
blow
6.0
puke
2.0
wiz
2.0
CRAP 2.4
« blib/lib/Perlilog/sysclasses/site_init.pl ↑ Summary blib/lib/Perlilog/siteclasses/silos.pl »
1 #
2 # This file is part of the Perlilog project.
3 #
4 # Copyright (C) 2003, Eli Billauer
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #
20 # A copy of the license can be found in a file named "licence.txt", at the
21 # root directory of this project.
22 #
23  
24 package Perlilog::PLerror;
25 1 ▶use strict 'vars';
Subroutine BEGIN: called CC=1 SCAR=0.0
26 1 require Exporter;
27  
28 1 @Perlilog::PLerror::ISA = ('Exporter');
29 1 @Perlilog::PLerror::EXPORT = qw(blow puke wiz wizreport fishy wrong say hint wink);
30 1 %Perlilog::PLerror::evalhash = ();
31 1 %Perlilog::PLerror::packhash = ();
32  
33 0 ▶sub blow {
Subroutine blow: not called CC=2 SCAR=17.9
Pod undocumented
34 0 { local $@; require Perlilog::PLerrsys; } # XXX fix require to not clear $@?
35 0 my $err = &Perlilog::linebreak("@_");
36 0 ▶ die $err if $err =~ /\n$/;
Branch: 1 branch
BranchTrueFalseTotal
if $err =~ /\n$/ 0 0 0
37 0 chomp $err;
38 0 die "$err ".oneplace()."\n";
39 }
40  
41 0 ▶sub puke {
Subroutine puke: not called CC=1 SCAR=6.9
Pod undocumented
42 0 { local $@; require Perlilog::PLerrsys; } # XXX fix require to not clear $@?
43 0 my ($chain, $err)=&stackdump(@_);
44 0 die(&Perlilog::linebreak($chain."\nError: $err"));
45 }
46  
47 0 ▶sub wiz {
Subroutine wiz: not called CC=1 SCAR=6.9
Pod undocumented
48 0 print &Perlilog::linebreak("@_");
49 }
50  
51 0 ▶sub wizreport {
Subroutine wizreport: not called CC=1 SCAR=6.9
Pod undocumented
52 0 { local $@; require Perlilog::PLerrsys; } # XXX fix require to not clear $@?
53 0 my ($chain, $err)=&stackdump(@_);
54 0 die(&Perlilog::linebreak($chain."\nWiz report: $err"));
55 }
56  
57 0 ▶sub fishy {
Subroutine fishy: not called CC=1 SCAR=6.9
Pod undocumented
58 0 my $warn = &Perlilog::linebreak("@_");
59 0 chomp $warn;
60 0 warn "$warn\n";
61 }
62  
63 0 ▶sub wrong {
Subroutine wrong: not called CC=1 SCAR=6.9
Pod undocumented
64 0 die(&Perlilog::linebreak("@_")."\n");
65 0 $Perlilog::wrongflag=1;
66 }
67  
68 0 ▶sub say {
Subroutine say: not called CC=1 SCAR=6.9
Pod undocumented
69 0 print "@_";
70 }
71  
72 0 ▶sub hint {
Subroutine hint: not called CC=1 SCAR=0.0
Pod undocumented
73 # print "@_";
74 }
75  
76 0 ▶sub wink {
Subroutine wink: not called CC=1 SCAR=6.9
Pod undocumented
77 0 print "@_";
78 }
79  
80 5 ▶sub register {
Subroutine register: called CC=1 SCAR=0.0
Pod undocumented
81 5 my $fname = shift;
82 5 my ($pack,$file,$line) = caller;
83 5 $Perlilog::PLerror::evalhash{$file}=[$pack,$fname,$line];
84 5 $Perlilog::PLerror::packhash{$pack}=$fname;
85 }
86  
87 1 1;
« blib/lib/Perlilog/sysclasses/site_init.pl ↑ Summary blib/lib/Perlilog/siteclasses/silos.pl »