Tidy/VerticalAligner/Alignment.pm

filter: Statementstmt 75.8% 22 / 29 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 77.7% 7 / 9 Podpod 0.0% 0 / 5 totaltotal 64.4% 29 / 45 CC 2 SCAR 6.9
CC
2
Cov
71%
AUTOLOAD
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« Tidy/VerticalAligner/Line.pm ↑ Summary Tidy/IndentationItem.pm »
1 package Perl::Tidy::VerticalAligner::Alignment;
2  
3 #####################################################################
4 #
5 # the Perl::Tidy::VerticalAligner::Alignment class holds information
6 # on a single column being aligned
7 #
8 #####################################################################
9  
10 44 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 44 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 44 our $VERSION = '20260705';
14  
15 sub new {
16  
17 8399 ▶ my ( $class, $rhash ) = @_;
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
18  
19 # Create a new VerticalAligner::Alignment object
20 # Given:
21 # $rhash = ref to hash for an alignment column
22 # There are just two values in the hash:
23 # {column} is the alignment column
24 # {saved_column} is used to save a column
25  
26 8399 my $self = bless $rhash, $class;
27 8399 return $self;
28 } ## end sub new
29  
30 sub AUTOLOAD {
31  
32 # Catch any undefined sub calls so that we are sure to get
33 # some diagnostic information. This sub should never be called
34 # except for a programming error.
35 0 ▶ our $AUTOLOAD;
Subroutine AUTOLOAD: not called CC=2 SCAR=17.9
36 0 ▶ return if ( $AUTOLOAD =~ /\bDESTROY$/ );
Branch: 1 branch
BranchTrueFalseTotal
if $Perl::Tidy::VerticalAligner::Alignment::AUTOLOAD =~ /\bDESTROY$/ 0 0 0
37 0 my ( $pkg, $fname, $lno ) = caller();
38 0 my $my_package = __PACKAGE__;
39 0 print {*STDERR} <<EOM;
40 ======================================================================
41 Error detected in package '$my_package', version $VERSION
42 Received unexpected AUTOLOAD call for sub '$AUTOLOAD'
43 Called from package: '$pkg'
44 Called from File '$fname' at line '$lno'
45 This error is probably due to a recent programming change
46 ======================================================================
47 EOM
48 0 exit 1;
49 } ## end sub AUTOLOAD
50  
51 ▶sub DESTROY {
Subroutine DESTROY: not called CC=1 SCAR=0.0
52  
53 # required to avoid call to AUTOLOAD in some versions of perl
54 }
55  
56 sub get_column {
57 9972 ▶ my $self = shift;
Subroutine get_column: called CC=1 SCAR=0.0
Pod undocumented
58 9972 return $self->{'column'};
59 }
60  
61 sub increment_column {
62 7228 ▶ my ( $self, $pad ) = @_;
Subroutine increment_column: called CC=1 SCAR=0.0
Pod undocumented
63 7228 $self->{'column'} += $pad;
64 7228 return;
65 }
66  
67 sub save_column {
68 4062 ▶ my $self = shift;
Subroutine save_column: called CC=1 SCAR=0.0
Pod undocumented
69 4062 $self->{'saved_column'} = $self->{'column'};
70 4062 return;
71 }
72  
73 sub restore_column {
74 43 ▶ my $self = shift;
Subroutine restore_column: called CC=1 SCAR=0.0
Pod undocumented
75 43 $self->{'column'} = $self->{'saved_column'};
76 43 return;
77 }
78 44 1;
« Tidy/VerticalAligner/Line.pm ↑ Summary Tidy/IndentationItem.pm »