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
26d099cb
Commit
26d099cb
authored
Jul 30, 2020
by
Mehmet Emin INAC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused `counts_by_severity` scope
parent
238356ad
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
19 deletions
+0
-19
ee/app/models/vulnerability.rb
ee/app/models/vulnerability.rb
+0
-1
ee/spec/models/vulnerability_spec.rb
ee/spec/models/vulnerability_spec.rb
+0
-18
No files found.
ee/app/models/vulnerability.rb
View file @
26d099cb
...
...
@@ -68,7 +68,6 @@ class Vulnerability < ApplicationRecord
scope
:with_severities
,
->
(
severities
)
{
where
(
severity:
severities
)
}
scope
:with_states
,
->
(
states
)
{
where
(
state:
states
)
}
scope
:with_scanners
,
->
(
scanners
)
{
joins
(
findings: :scanner
).
merge
(
Vulnerabilities
::
Scanner
.
with_external_id
(
scanners
))
}
scope
:counts_by_severity
,
->
{
group
(
:severity
).
count
}
class
<<
self
def
parent_class
...
...
ee/spec/models/vulnerability_spec.rb
View file @
26d099cb
...
...
@@ -166,24 +166,6 @@ RSpec.describe Vulnerability do
end
end
describe
'.counts_by_severity'
do
before
do
create_list
(
:vulnerability
,
2
,
severity: :critical
)
create_list
(
:vulnerability
,
3
,
severity: :high
)
create
(
:vulnerability
,
severity: :low
)
end
subject
{
described_class
.
counts_by_severity
}
it
'returns the count for each severity'
do
is_expected
.
to
eq
({
'critical'
=>
2
,
'high'
=>
3
,
'low'
=>
1
})
end
end
describe
'.counts_by_day_and_severity'
do
context
'when the vulnerability_history feature flag is disabled'
do
before
do
...
...
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