Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
eaf2607e
Commit
eaf2607e
authored
Feb 24, 2020
by
Giorgenes Gelatti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve Vulnerability Findinds code quality
parent
57aa6197
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
ee/lib/api/vulnerability_findings.rb
ee/lib/api/vulnerability_findings.rb
+11
-6
No files found.
ee/lib/api/vulnerability_findings.rb
View file @
eaf2607e
...
...
@@ -3,15 +3,20 @@
module
API
class
VulnerabilityFindings
<
Grape
::
API
include
PaginationParams
include
::
Gitlab
::
Utils
::
StrongMemoize
helpers
do
def
vulnerability_occurrences_by
(
params
)
pipeline
=
if
params
[
:pipeline_id
]
user_project
.
all_pipelines
.
find_by
(
id:
params
[
:pipeline_id
])
# rubocop:disable CodeReuse/ActiveRecord
else
user_project
.
latest_pipeline_with_security_reports
end
def
pipeline
strong_memoize
(
:pipeline
)
do
if
params
[
:pipeline_id
]
user_project
.
all_pipelines
.
for_id
(
params
[
:pipeline_id
]).
first
else
user_project
.
latest_pipeline_with_security_reports
end
end
end
def
vulnerability_occurrences_by
(
params
)
return
[]
unless
pipeline
aggregated_report
=
Security
::
PipelineVulnerabilitiesFinder
.
new
(
pipeline:
pipeline
,
params:
params
).
execute
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment