Quiq/Html/Util.pm

filter: Statementstmt 59.2% 16 / 27 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 100% 1 / 1 totaltotal 55.0% 22 / 40 CC 4 SCAR 22.5
CC
4
Cov
48%
insertDurationBytes
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 9.4
« Quiq/Html/Widget.pm ↑ Summary Quiq/SqlPlus.pm »
1 # -----------------------------------------------------------------------------
2  
3 =encoding utf8
4  
5 =head1 NAME
6  
7 Quiq::Html::Util - Hilfsmethoden für die HTML-Generierung
8  
9 =head1 BASE CLASS
10  
11 L<Quiq::Object>
12  
13 =cut
14  
15 # -----------------------------------------------------------------------------
16  
17 package Quiq::Html::Util;
18 1 ▶use base qw/Quiq::Object/;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 1 ▶use v5.10;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
23  
24 1 our $VERSION = '1.240';
25  
26 1 ▶use Time::HiRes ();
Subroutine BEGIN: called CC=1 SCAR=0.0
27  
28 # -----------------------------------------------------------------------------
29  
30 =head1 METHODS
31  
32 =head2 Klassenmethoden
33  
34 =head3 insertDurationBytes() - Füge Ausführungszeit und Byteanzahl ein
35  
36 =head4 Synopsis
37  
38 $class->insertDurationBytes(\$html,$t0);
39 $html2 = $class->insertDurationBytes($html1,$t0);
40  
41 =cut
42  
43 # -----------------------------------------------------------------------------
44  
45 0 ▶sub insertDurationBytes {
Subroutine insertDurationBytes: not called CC=4 SCAR=30.0
Pod documented
46 0 my ($class,$arg,$t0) = @_;
47  
48 0 ▶ my $ref = ref $arg? $arg: \$arg;
Branch: 1 branch
BranchTrueFalseTotal
ref $arg ? : 0 0 0
49  
50 0 my $duration = sprintf '%.3f',Time::HiRes::gettimeofday-$t0;
51 0 ▶ if ($duration < 0.001) {
Branch: 1 branch
BranchTrueFalseTotal
if ($duration < "0.001") 0 0 0
52 0 $duration = 0.001;
53 }
54 0 $$ref =~ s/__DURATION__/$duration/g;
55  
56 0 require bytes;
57 0 my $bytes = bytes::length($$ref);
58 0 $bytes += length($bytes)-length('__BYTES__');
59 0 $$ref =~ s/__BYTES__/$bytes/g;
60  
61 0 ▶ return ref $arg? (): $$ref;
Branch: 1 branch
BranchTrueFalseTotal
ref $arg ? : 0 0 0
62 }
63
64  
65 # -----------------------------------------------------------------------------
66  
67 =head1 VERSION
68  
69 1.240
70  
71 =head1 AUTHOR
72  
73 Frank Seitz, L<http://fseitz.de/>
74  
75 =head1 COPYRIGHT
76  
77 Copyright (C) 2026 Frank Seitz
78  
79 =head1 LICENSE
80  
81 This code is free software; you can redistribute it and/or modify
82 it under the same terms as Perl itself.
83  
84 =cut
85  
86 # -----------------------------------------------------------------------------
87  
88 1 1;
89  
90 # eof
« Quiq/Html/Widget.pm ↑ Summary Quiq/SqlPlus.pm »