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 45 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 45 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 45 our $VERSION = '20260826';
14  
15 8450 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
16  
17 8450 my ( $class, $rhash ) = @_;
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 8450 my $self = bless $rhash, $class;
27 8450 return $self;
28 } ## end sub new
29  
30 0 ▶sub AUTOLOAD {
Subroutine AUTOLOAD: not called CC=2 SCAR=17.9
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;
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 0 ▶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 9960 ▶sub get_column {
Subroutine get_column: called CC=1 SCAR=0.0
Pod undocumented
57 9960 my $self = shift;
58 9960 return $self->{'column'};
59 }
60  
61 7222 ▶sub increment_column {
Subroutine increment_column: called CC=1 SCAR=0.0
Pod undocumented
62 7222 my ( $self, $pad ) = @_;
63 7222 $self->{'column'} += $pad;
64 7222 return;
65 }
66  
67 4056 ▶sub save_column {
Subroutine save_column: called CC=1 SCAR=0.0
Pod undocumented
68 4056 my $self = shift;
69 4056 $self->{'saved_column'} = $self->{'column'};
70 4056 return;
71 }
72  
73 43 ▶sub restore_column {
Subroutine restore_column: called CC=1 SCAR=0.0
Pod undocumented
74 43 my $self = shift;
75 43 $self->{'column'} = $self->{'saved_column'};
76 43 return;
77 }
78 45 1;
« Tidy/VerticalAligner/Line.pm ↑ Summary Tidy/IndentationItem.pm »