Commit 2ed1d541 authored by Tomasz Maczukin's avatar Tomasz Maczukin

Fix static analysis offences

parent 1dde609c
module Ci module Ci
class BuildMetadataPresenter < Gitlab::View::Presenter::Delegated class BuildMetadataPresenter < Gitlab::View::Presenter::Delegated
TIMEOUT_SOURCES = { TIMEOUT_SOURCES = {
unknown_timeout_source: nil, unknown_timeout_source: nil,
project_timeout_source: 'project', project_timeout_source: 'project',
...@@ -13,8 +12,7 @@ module Ci ...@@ -13,8 +12,7 @@ module Ci
return unless metadata.timeout_source? return unless metadata.timeout_source?
TIMEOUT_SOURCES[metadata.timeout_source.to_sym] || TIMEOUT_SOURCES[metadata.timeout_source.to_sym] ||
metadata.timeout_source metadata.timeout_source
end end
end end
end end
module Ci module Ci
class BuildPresenter < Gitlab::View::Presenter::Delegated class BuildPresenter < Gitlab::View::Presenter::Delegated
presents :build presents :build
def erased_by_user? def erased_by_user?
......
class BuildMetadataEntity < Grape::Entity class BuildMetadataEntity < Grape::Entity
expose :used_timeout_human_readable do |metadata| expose :used_timeout_human_readable do |metadata|
metadata.used_timeout_human_readable unless metadata.used_timeout.nil? metadata.used_timeout_human_readable unless metadata.used_timeout.nil?
end end
......
...@@ -53,5 +53,4 @@ describe('Sidebar detail row', () => { ...@@ -53,5 +53,4 @@ describe('Sidebar detail row', () => {
it('should render help when helpUrl is provided', () => { it('should render help when helpUrl is provided', () => {
expect(vm.$el.querySelector('.help-button a').getAttribute('href')).toEqual('help url'); expect(vm.$el.querySelector('.help-button a').getAttribute('href')).toEqual('help url');
}); });
}); });
...@@ -39,7 +39,8 @@ end ...@@ -39,7 +39,8 @@ end
describe 'ChronicDurationAttribute' do describe 'ChronicDurationAttribute' do
let(:source_field) {:maximum_job_timeout} let(:source_field) {:maximum_job_timeout}
let(:virtual_field) {:maximum_job_timeout_human_readable} let(:virtual_field) {:maximum_job_timeout_human_readable}
subject {Ci::Runner.new}
subject { Ci::Runner.new }
it_behaves_like 'ChronicDurationAttribute reader' it_behaves_like 'ChronicDurationAttribute reader'
it_behaves_like 'ChronicDurationAttribute writer' it_behaves_like 'ChronicDurationAttribute writer'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment