lib/Bio/NEXUS/CodonsBlock.pm

filter: Statementstmt 57.8% 22 / 38 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 75.0% 6 / 8 Podpod 100% 1 / 1 totaltotal 48.3% 29 / 60 CC 6 SCAR 22.4
CC
6
Cov
45%
new
20.0
AUTOLOAD
12.0
BEGIN
1.0
CRAP 9.4
« lib/Bio/NEXUS/Node.pm ↑ Summary lib/Bio/NEXUS/Tools/GraphicsParams.pm »
1 #################################################################
2 # CodonsBlock.pm
3 #################################################################
4 #
5 # thanks to Tom Hladish for the original version
6 #
7 # $Id: CodonsBlock.pm,v 1.14 2012/02/07 21:38:09 astoltzfus Exp $
8  
9 #################### START POD DOCUMENTATION ##################
10  
11 =head1 NAME
12  
13 Bio::NEXUS::CodonsBlock - Represents CODONS block in NEXUS file
14  
15 =head1 SYNOPSIS
16  
17 =head1 DESCRIPTION
18  
19 Placeholding module for the CODONS block class.
20  
21 =head1 COMMENTS
22  
23 =head1 FEEDBACK
24  
25 All feedback (bugs, feature enhancements, etc.) are greatly appreciated.
26  
27 =head1 AUTHORS
28  
29 Thomas Hladish (tjhladish at yahoo)
30  
31 =head1 VERSION
32  
33 $Revision: 1.14 $
34  
35 =head1 METHODS
36  
37 =cut
38  
39 package Bio::NEXUS::CodonsBlock;
40  
41 35 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
42 35 ▶use Bio::NEXUS::Functions;
Subroutine BEGIN: called CC=1 SCAR=0.0
43 35 ▶use Bio::NEXUS::Util::Logger;
Subroutine BEGIN: called CC=1 SCAR=0.0
44 35 ▶use Bio::NEXUS::Util::Exceptions;
Subroutine BEGIN: called CC=1 SCAR=0.0
45 35 ▶use vars qw(@ISA $VERSION $AUTOLOAD);
Subroutine BEGIN: called CC=1 SCAR=0.0
46 35 ▶use Bio::NEXUS; $VERSION = $Bio::NEXUS::VERSION;
Subroutine BEGIN: called CC=1 SCAR=0.0
47  
48 35 @ISA = qw(Bio::NEXUS::Block);
49 35 my $logger = Bio::NEXUS::Util::Logger->new();
50  
51 =head2 new
52  
53 Title : new
54 Usage : block_object = new Bio::NEXUS::CodonsBlock($block_type, $commands, $verbose);
55 Function: Creates a new Bio::NEXUS::CodonsBlock object
56 Returns : Bio::NEXUS::CodonsBlock object
57 Args : type (string), the commands/comments to parse (array ref), and a verbose flag (0 or 1; optional)
58  
59 =cut
60  
61 0 ▶sub new {
Subroutine new: not called CC=4 SCAR=30.0
Pod documented
62 0 my ( $class, $type, $commands, $verbose, $taxa ) = @_;
63 0 ▶ if ( not $type) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($type) 0 0 0
64 0 ( $type = lc $class ) =~ s/Bio::NEXUS::(.+)Block/$1/i;
65 }
66 0 my $self = {
67 'type' => $type
68 };
69 0 bless $self, $class;
70 0 ▶ if ( ( defined $commands ) and @$commands ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $commands and @$commands) 0 0 0
Condition0%0/3
defined $commands and @$commands
!ll&&!rl&&r
000
MC/DC0%0/2
defined $commands and @$commands
defined $commands @$commands
Truth table0%0/3
A and B
A= defined $commandsB= @$commands
ABresult
0X0
100
111
71 0 $self->_parse_block( $commands, $verbose )
72 }
73 0 return $self;
74 }
75  
76 0 ▶sub AUTOLOAD {
Subroutine AUTOLOAD: not called CC=3 SCAR=24.8
77 0 ▶ return if $AUTOLOAD =~ /DESTROY$/;
Branch: 1 branch
BranchTrueFalseTotal
if $Bio::NEXUS::CodonsBlock::AUTOLOAD =~ /DESTROY$/ 0 0 0
78 0 my $package_name = __PACKAGE__ . '::';
79  
80 # The following methods are deprecated and are temporarily supported
81 # via a warning and a redirection
82 0 my %synonym_for = (
83  
84 # "${package_name}parse" => "${package_name}_parse_tree", # example
85 );
86  
87 0 ▶ if ( defined $synonym_for{$AUTOLOAD} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $synonym_for{$Bio::NEXUS::CodonsBlock::AUTOLOAD}) { } 0 0 0
88 0 $logger->warn("$AUTOLOAD() is deprecated; use $synonym_for{$AUTOLOAD}() instead");
89 0 goto &{ $synonym_for{$AUTOLOAD} };
90 }
91 else {
92 0 Bio::NEXUS::Util::Exceptions::UnknownMethod->throw(
93 'UnknownMethod' => "ERROR: Unknown method $AUTOLOAD called"
94 );
95 }
96 }
97 35 1;
« lib/Bio/NEXUS/Node.pm ↑ Summary lib/Bio/NEXUS/Tools/GraphicsParams.pm »