Provide a single line of vulnerable code
What does this MR do and why?
When an end_line
is not provided with a vulnerability finding the Finding#vulnerable_code
method was including the start up to the last line of the file. This can cause the error This model's maximum context length is 4097 tokens. However, you requested 5504 tokens (2504 in the messages, 3000 in the completion). Please reduce the length of the messages or completion.
if the file has a lot of code.
The change in this MR limits the chunk of code to just the single line of code instead.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by mo khan