| 1 | package Devel::ebug::Plugin::Codelines; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 31 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 31 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 31 | ▶ | use base qw(Exporter); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 31 | our @EXPORT = qw(codelines); | |||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 31 | our $VERSION = '0.69'; # VERSION | |||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | # return some lines of code | ||||||||||||||||||||||||||||
| 11 | 1 | ▶ | sub codelines { | ||||||||||||||||||||||||||
|
Subroutine
codelines: called CC=3 SCAR=13.6
Pod
undocumented
| |||||||||||||||||||||||||||||
| 12 | 1 | my($self) = shift; | |||||||||||||||||||||||||||
| 13 | 1 | my($filename, @lines); | |||||||||||||||||||||||||||
| 14 | 1 | ▶ | if (!defined($_[0]) || $_[0] =~ /^\d+$/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
not defined $_[0] or $_[0] =~ /^\d+$/
MC/DC0%0/2
not defined $_[0] or $_[0] =~ /^\d+$/
not defined $_[0]
$_[0] =~ /^\d+$/
Truth table33%1/3
not(A) or B
A= not defined $_[0]B= $_[0] =~ /^\d+$/
| |||||||||||||||||||||||||||||
| 15 | 1 | $filename = $self->filename; | |||||||||||||||||||||||||||
| 16 | } else { | ||||||||||||||||||||||||||||
| 17 | 0 | $filename = shift; | |||||||||||||||||||||||||||
| 18 | } | ||||||||||||||||||||||||||||
| 19 | 0 | @lines = map { $_ -1 } @_; | |||||||||||||||||||||||||||
| 20 | 1 | my $response = $self->talk({ | |||||||||||||||||||||||||||
| 21 | command => "codelines", | ||||||||||||||||||||||||||||
| 22 | filename => $filename, | ||||||||||||||||||||||||||||
| 23 | lines => \@lines, | ||||||||||||||||||||||||||||
| 24 | }); | ||||||||||||||||||||||||||||
| 25 | 0 | return @{$response->{codelines}}; | |||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 31 | 1; | |||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | __END__ | ||||||||||||||||||||||||||||