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
e2110bee
Commit
e2110bee
authored
Apr 17, 2019
by
syasonik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce congnitive complexity
parent
f133f144
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
app/controllers/projects/environments_controller.rb
app/controllers/projects/environments_controller.rb
+7
-8
No files found.
app/controllers/projects/environments_controller.rb
View file @
e2110bee
...
...
@@ -165,16 +165,15 @@ class Projects::EnvironmentsController < Projects::ApplicationController
result
=
Gitlab
::
MetricsDashboard
::
Service
.
new
(
@project
,
@current_user
,
environment:
environment
).
get_dashboard
if
result
[
:status
]
==
:success
render
status: :ok
,
json:
{
status: :success
,
dashboard:
result
[
:dashboard
]
}
status_code
=
:ok
details
=
{
dashboard:
result
[
:dashboard
]
}
else
render
status:
result
[
:http_status
]
||
:bad_request
,
json:
{
message:
result
[
:message
],
status:
result
[
:status
]
}
status_code
=
result
[
:http_status
]
||
:bad_request
details
=
{
message:
result
[
:message
]
}
end
render
status:
status_code
,
json:
{
status:
result
[
:status
]
}.
merge
(
details
)
end
end
end
...
...
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