Filter/ASN1.pm

filter: Statementstmt 43.3% 13 / 30 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 57.1% 4 / 7 Podpod 0.0% 0 / 3 totaltotal 33.3% 17 / 51 CC 5 SCAR 21.9
CC
5
Cov
33%
get
20.0
new
6.0
put
2.0
CRAP 8.9
« Component/Client/LDAP.pm ↑ Summary
1 package POE::Filter::ASN1;
2
3 # Copyright 2004 Jonathan Steinert (hachi@cpan.org)
4 # This program is free software; you can redistribute it
5 # and/or modify it under the same terms as Perl itself.
6
7 1 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Convert::ASN1 qw(asn_decode_tag asn_decode_length);
Subroutine BEGIN: called CC=1 SCAR=0.0
11
12 1 our $VERSION = '0.01';
13
14 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
15 0 my $class = shift;
16
17 0 ▶ my $self = bless {
Condition0%0/3
ref $class || $class
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table0%0/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
18 buffer => '',
19 }, (ref $class || $class);
20
21 0 return $self;
22 }
23
24 0 ▶sub get {
Subroutine get: not called CC=4 SCAR=30.0
Pod undocumented
25 0 my $self = shift;
26 0 my $blocks = shift;
27
28 0 $self->{buffer} .= join( '', @$blocks );
29
30 0 my $return_blocks = [];
31
32 0 while (1) {
33 0 ▶ my ($tb, $tag) = asn_decode_tag( $self->{buffer} ) or last;
Branch: 1 branch
BranchTrueFalseTotal
() = asn_decode_tag($self->{"buffer"}) or last 0 0 0
34 0 ▶ my ($lb, $len) = asn_decode_length( substr( $self->{buffer},$tb,8 ) ) or last;
Branch: 1 branch
BranchTrueFalseTotal
() = asn_decode_length(substr($self->{"buffer"}, $tb, 8)) or last 0 0 0
35 0 my $length = $tb + $lb + $len;
36
37 0 ▶ if ($length <= length $self->{buffer}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($length <= length $self->{'buffer'}) { } 0 0 0
38 0 push @$return_blocks, substr( $self->{buffer},0,$length );
39 0 substr( $self->{buffer}, 0, $length ) = '';
40 }
41 else {
42 0 last;
43 }
44 }
45 0 return $return_blocks;
46 }
47
48
49 0 ▶sub put {
Subroutine put: not called CC=1 SCAR=6.9
Pod undocumented
50 0 die( "Unimplemented call to put()\n" );
51 }
52
53 1 1;
« Component/Client/LDAP.pm ↑ Summary