lib/Devel/Trepan/CmdProcessor/Command/Set.pm

filter: Statementstmt 85.1% 80 / 94 Branchbran 33.3% 4 / 12 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 91.3% 21 / 23 Podpod 0.0% 0 / 2 totaltotal 74.4% 105 / 141 CC 10 SCAR 14.7
CC
10
Cov
75%
run
10.2
run
10.2
run
10.2
CRAP 4.3
« lib/Devel/Trepan/CmdProcessor/Command/Backtrace.pm ↑ Summary lib/Devel/Trepan/DB/Use.pm »
1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2011-2014 Rocky Bernstein <rocky@cpan.org>
3 12 ▶use warnings; no warnings 'redefine';
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package Devel::Trepan::CmdProcessor::Command::Set;
6  
7 12 ▶use rlib '../../../..';
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
8 12 ▶use if !@ISA, Devel::Trepan::CmdProcessor::Command::Subcmd::SubMgr;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶unless (@ISA) {
Branch: 1 branch
BranchTrueFalseTotal
unless (@ISA) 0 2 2
10 0 ▶ eval <<'EOE';
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
11 use constant CATEGORY => 'support';
12 use constant SHORT_HELP => 'Modify parts of the debugger environment';
13 use constant MIN_ARGS => 0; # Need at least this many
14 use constant MAX_ARGS => undef; # Need at most this many -
15 # undef -> unlimited.
16 use constant NEED_STACK => 0;
17 EOE
18 }
19  
20 12 ▶use if !@ISA, Devel::Trepan::CmdProcessor::Command;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
21 12 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
22 12 ▶use vars qw(@ISA);
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
23 1 @ISA = qw(Devel::Trepan::CmdProcessor::Command::SubcmdMgr);
24 12 ▶use vars @CMD_VARS;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
25  
26 1 our $NAME = set_name();
27 =pod
28  
29 =head2 Synopsis:
30  
31 =cut
32  
33 12 our $HELP = <<'HELP';
34 =pod
35  
36 B<set> [I<set sub-commmand> ...]
37  
38 Modifies parts of the debugger environment.
39  
40 You can give unique prefix of the name of a subcommand to get
41 information about just that subcommand.
42  
43 Type C<set> for a list of set subcommands and what they do.
44  
45 Type C<help set *> for the list of C<set> subcommands.
46  
47 C<set auto...> is the same as C<set auto ...>. For example, C<set
48 autolist> is the same as L<C<set auto
49 list>|Devel::Trepan::CmdProcessor::Command::Set::Auto::List>.
50  
51 =head2 See also:
52  
53 L<C<set abbrev>|Devel::Trepan::CmdProcessor::Command::Set::Abbrev>,
54 L<C<set auto>|Devel::Trepan::CmdProcessor::Command::Set::Auto>,
55 L<C<set basename>|Devel::Trepan::CmdProcessor::Command::Set::Basename>,
56 L<C<set confirm>|Devel::Trepan::CmdProcessor::Command::Set::Confirm>,
57 L<C<set debug>|Devel::Trepan::CmdProcessor::Command::Set::Debug>,
58 L<C<set different>|Devel::Trepan::CmdProcessor::Command::Set::Different>,
59 L<C<set display>|Devel::Trepan::CmdProcessor::Command::Set::Display>,
60 L<C<set highlight>|Devel::Trepan::CmdProcessor::Command::Set::Highlight>,
61 L<C<set max>|Devel::Trepan::CmdProcessor::Command::Set::Max>,
62 L<C<set return>|Devel::Trepan::CmdProcessor::Command::Set::Return>,
63 L<C<set substitute>|Devel::Trepan::CmdProcessor::Command::Set::Substitute>,
64 L<C<set timer>|Devel::Trepan::CmdProcessor::Command::Set::Timer>,
65 L<C<set trace>|Devel::Trepan::CmdProcessor::Command::Set::Trace>, and
66 L<C<set variable>|Devel::Trepan::CmdProcessor::Command::Set::Variable>
67 =cut
68 HELP
69  
70 sub run($$)
71 0 ▶{
Subroutine run: not called CC=4 SCAR=23.2
Subroutine run: not called CC=4 SCAR=23.2
Pod undocumented
Pod undocumented
72 0 my ($self, $args) = @_;
73 0 my $first;
74 0 ▶ if (scalar @$args > 1) {
Branch: 2 branches
BranchTrueFalseTotal
if (scalar @$args > 1) 0 0 0
if (scalar @$args > 1) 11 0 11
75 0 $first = lc $args->[1];
76 0 my $alen = length('auto');
77 0 ▶ splice(@$args, 1, 1, ('auto', substr($first, $alen))) if
Branch: 2 branches
BranchTrueFalseTotal
if index($first, "auto") == 0 and length $first > $alen 0 0 0
if index($first, "auto") == 0 and length $first > $alen 0 11 11
Condition0%0/6
index($first, "auto") == 0 and length $first > $alen
!ll&&!rl&&r
000
index($first, "auto") == 0 and length $first > $alen
!ll&&!rl&&r
000
MC/DC0%0/2
index($first, "auto") == 0 and length $first > $alen
index($first, "auto") == 0 length $first > $alen
MC/DC0%0/2
index($first, "auto") == 0 and length $first > $alen
index($first, "auto") == 0 length $first > $alen
Truth table0%0/3
A and B
A= index($first, "auto") == 0B= length $first > $alen
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= index($first, "auto") == 0B= length $first > $alen
ABresult
0X0
100
111
78 index($first, 'auto') == 0 && length($first) > $alen;
79 }
80 0 $self->SUPER::run($args);
81 }
82  
83 2 ▶unless (caller) {
Branch: 1 branch
BranchTrueFalseTotal
unless (caller) 0 2 2
84 0 require Devel::Trepan::CmdProcessor;
85 1 my $proc = Devel::Trepan::CmdProcessor->new(undef, 'bogus');
86 1 my $cmd = __PACKAGE__->new($proc, $NAME);
87 # require_relative '../mock'
88 1 $cmd->run([$NAME]);
89 # $cmd->run([$NAME, 'autolist']);
90 # $cmd->run([$NAME, 'autoeval', 'off']);
91 1 $cmd->run([$NAME, 'basename']);
92 }
93  
94 1 1;
« lib/Devel/Trepan/CmdProcessor/Command/Backtrace.pm ↑ Summary lib/Devel/Trepan/DB/Use.pm »