| 1 | package Claude::Agent::Code::Review::Issue; | ||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||
| 3 | 7 | ▶ | use 5.020; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 4 | 7 | ▶ | use strict; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 5 | 7 | ▶ | use warnings; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||
| 7 | 7 | ▶ | use Object::Proto (); | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 8 | 7 | ▶ | use Claude::Agent::Code::Review::Types; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||
| 10 | 7 | ▶ | BEGIN { | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 11 | 7 | Object::Proto::define('Claude::Agent::Code::Review::Issue', | |||||||||||||||||||||||||||||
| 12 | 'severity:ReviewSeverity:required', | ||||||||||||||||||||||||||||||
| 13 | 'category:ReviewCategory:required', | ||||||||||||||||||||||||||||||
| 14 | 'file:Str:required', | ||||||||||||||||||||||||||||||
| 15 | 'line:Int:required', | ||||||||||||||||||||||||||||||
| 16 | 'description:Str:required', | ||||||||||||||||||||||||||||||
| 17 | 'end_line', | ||||||||||||||||||||||||||||||
| 18 | 'column', | ||||||||||||||||||||||||||||||
| 19 | 'explanation', | ||||||||||||||||||||||||||||||
| 20 | 'suggestion', | ||||||||||||||||||||||||||||||
| 21 | 'code_before', | ||||||||||||||||||||||||||||||
| 22 | 'code_after', | ||||||||||||||||||||||||||||||
| 23 | ); | ||||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||
| 26 | 23 | ▶ | sub has_end_line { | ||||||||||||||||||||||||||||
|
Subroutine
has_end_line: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 27 | 23 | my ($self) = @_; | |||||||||||||||||||||||||||||
| 28 | 23 | return defined $self->end_line; | |||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||
| 31 | 9 | ▶ | sub has_column { | ||||||||||||||||||||||||||||
|
Subroutine
has_column: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 32 | 9 | my ($self) = @_; | |||||||||||||||||||||||||||||
| 33 | 9 | return defined $self->column; | |||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||
| 36 | 23 | ▶ | sub has_explanation { | ||||||||||||||||||||||||||||
|
Subroutine
has_explanation: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 37 | 23 | my ($self) = @_; | |||||||||||||||||||||||||||||
| 38 | 23 | ▶ | return defined $self->explanation && length $self->explanation; | ||||||||||||||||||||||||||||
|
Condition100%3/3
defined $self->explanation && length $self->explanation
MC/DC100%2/2
defined $self->explanation && length $self->explanation
defined $self->explanation
length $self->explanation
Truth table100%3/3
A && B
A= defined $self->explanationB= length $self->explanation
| |||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||
| 41 | 24 | ▶ | sub has_suggestion { | ||||||||||||||||||||||||||||
|
Subroutine
has_suggestion: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||
| 42 | 24 | my ($self) = @_; | |||||||||||||||||||||||||||||
| 43 | 24 | ▶ | return defined $self->suggestion && length $self->suggestion; | ||||||||||||||||||||||||||||
|
Condition100%3/3
defined $self->suggestion && length $self->suggestion
MC/DC100%2/2
defined $self->suggestion && length $self->suggestion
defined $self->suggestion
length $self->suggestion
Truth table100%3/3
A && B
A= defined $self->suggestionB= length $self->suggestion
| |||||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||
| 46 | 22 | ▶ | sub has_code_before { | ||||||||||||||||||||||||||||
|
Subroutine
has_code_before: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||||||||||||||||||||||
| 47 | 22 | my ($self) = @_; | |||||||||||||||||||||||||||||
| 48 | 22 | ▶ | return defined $self->code_before && length $self->code_before; | ||||||||||||||||||||||||||||
|
Condition66%2/3
defined $self->code_before && length $self->code_before
MC/DC50%1/2
defined $self->code_before && length $self->code_before
defined $self->code_before
length $self->code_before
Truth table66%2/3
A && B
A= defined $self->code_beforeB= length $self->code_before
| |||||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||
| 51 | 18 | ▶ | sub has_code_after { | ||||||||||||||||||||||||||||
|
Subroutine
has_code_after: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||||||||||||||||||||||
| 52 | 18 | my ($self) = @_; | |||||||||||||||||||||||||||||
| 53 | 18 | ▶ | return defined $self->code_after && length $self->code_after; | ||||||||||||||||||||||||||||
|
Condition66%2/3
defined $self->code_after && length $self->code_after
MC/DC50%1/2
defined $self->code_after && length $self->code_after
defined $self->code_after
length $self->code_after
Truth table66%2/3
A && B
A= defined $self->code_afterB= length $self->code_after
| |||||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||
| 56 | 2 | ▶ | sub is_critical { | ||||||||||||||||||||||||||||
|
Subroutine
is_critical: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 57 | 2 | my ($self) = @_; | |||||||||||||||||||||||||||||
| 58 | 2 | return $self->severity eq 'critical'; | |||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||
| 61 | 3 | ▶ | sub is_high { | ||||||||||||||||||||||||||||
|
Subroutine
is_high: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 62 | 3 | my ($self) = @_; | |||||||||||||||||||||||||||||
| 63 | 3 | return $self->severity eq 'high'; | |||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||
| 66 | 3 | ▶ | sub is_security { | ||||||||||||||||||||||||||||
|
Subroutine
is_security: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 67 | 3 | my ($self) = @_; | |||||||||||||||||||||||||||||
| 68 | 3 | return $self->category eq 'security'; | |||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||
| 71 | 8 | ▶ | sub location { | ||||||||||||||||||||||||||||
|
Subroutine
location: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 72 | 8 | my ($self) = @_; | |||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||
| 74 | 8 | ▶ | if ($self->has_end_line && $self->end_line != $self->line) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$self->has_end_line and $self->end_line != $self->line
MC/DC100%2/2
$self->has_end_line and $self->end_line != $self->line
$self->has_end_line
$self->end_line != $self->line
Truth table100%3/3
A and B
A= $self->has_end_lineB= $self->end_line != $self->line
| |||||||||||||||||||||||||||||||
| 75 | 2 | return sprintf "%s:%d-%d", $self->file, $self->line, $self->end_line; | |||||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||
| 78 | 6 | return sprintf "%s:%d", $self->file, $self->line; | |||||||||||||||||||||||||||||
| 79 | } | ||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||
| 81 | 7 | ▶ | sub to_hash { | ||||||||||||||||||||||||||||
|
Subroutine
to_hash: called CC=7 SCAR=19.5
Pod
documented
| |||||||||||||||||||||||||||||||
| 82 | 7 | my ($self) = @_; | |||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||
| 84 | return { | ||||||||||||||||||||||||||||||
| 85 | 7 | ▶ | severity => $self->severity, | ||||||||||||||||||||||||||||
|
Branch: 6 branches
| |||||||||||||||||||||||||||||||
| 86 | category => $self->category, | ||||||||||||||||||||||||||||||
| 87 | file => $self->file, | ||||||||||||||||||||||||||||||
| 88 | line => $self->line, | ||||||||||||||||||||||||||||||
| 89 | ($self->has_end_line ? (end_line => $self->end_line) : ()), | ||||||||||||||||||||||||||||||
| 90 | ($self->has_column ? (column => $self->column) : ()), | ||||||||||||||||||||||||||||||
| 91 | description => $self->description, | ||||||||||||||||||||||||||||||
| 92 | ($self->has_explanation ? (explanation => $self->explanation) : ()), | ||||||||||||||||||||||||||||||
| 93 | ($self->has_suggestion ? (suggestion => $self->suggestion) : ()), | ||||||||||||||||||||||||||||||
| 94 | ($self->has_code_before ? (code_before => $self->code_before) : ()), | ||||||||||||||||||||||||||||||
| 95 | ($self->has_code_after ? (code_after => $self->code_after) : ()), | ||||||||||||||||||||||||||||||
| 96 | }; | ||||||||||||||||||||||||||||||
| 97 | } | ||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||
| 99 | 3 | ▶ | sub as_text { | ||||||||||||||||||||||||||||
|
Subroutine
as_text: called CC=5 SCAR=16.1
Pod
documented
| |||||||||||||||||||||||||||||||
| 100 | 3 | my ($self) = @_; | |||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||
| 102 | 3 | my @lines; | |||||||||||||||||||||||||||||
| 103 | 3 | push @lines, sprintf "[%s] %s - %s", uc($self->severity), $self->category, $self->location; | |||||||||||||||||||||||||||||
| 104 | 3 | push @lines, " " . $self->description; | |||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||
| 106 | 3 | ▶ | if ($self->has_explanation) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 107 | 1 | push @lines, " Explanation: " . $self->explanation; | |||||||||||||||||||||||||||||
| 108 | } | ||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||
| 110 | 3 | ▶ | if ($self->has_suggestion) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 111 | 2 | push @lines, " Suggestion: " . $self->suggestion; | |||||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||||
| 114 | 3 | ▶ | if ($self->has_code_before) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 115 | 1 | push @lines, " Before: " . $self->code_before; | |||||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||
| 118 | 3 | ▶ | if ($self->has_code_after) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 119 | 1 | push @lines, " After: " . $self->code_after; | |||||||||||||||||||||||||||||
| 120 | } | ||||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||||
| 122 | 3 | return join("\n", @lines); | |||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||
| 126 | 7 | 1; | |||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||||
| 128 | __END__ | ||||||||||||||||||||||||||||||