Skip to content

TMA-732: fix edge cases for user input sanitized MUFs#1092

Merged
1 commit merged intogooddata:developfrom
kubamahnert:TMA-732
Feb 6, 2018
Merged

TMA-732: fix edge cases for user input sanitized MUFs#1092
1 commit merged intogooddata:developfrom
kubamahnert:TMA-732

Conversation

@kubamahnert
Copy link
Copy Markdown
Contributor

No description provided.

@kubamahnert kubamahnert requested a review from panjan January 18, 2018 15:58
end

context 'when using sync_multiple_projects_based_on_custom_id mode' do
let(:params) do
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar code found in synchronize_user_filters_spec.rb:79, synchronize_user_filters_spec.rb:148 (mass = 52)

end
let(:CSV) { double('CSV') }

before do
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical code found in synchronize_user_filters_spec.rb:93, synchronize_user_filters_spec.rb:162 (mass = 152)

CSV.foreach(File.open(data_source.realize(params), 'r:UTF-8'), headers: csv_with_headers, return_headers: false, encoding: 'utf-8') do |row|
filters << row.to_hash
end
fail 'The filter set can not be empty when using sync_multiple_projects_based_on_custom_id mode' if filters.empty?
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calls 'filters.empty?' 2 times (DuplicateMethodCall)

it 'fails if the MUF set is empty' do
expect(File).to receive(:open)
expect(CSV).to receive(:foreach)
expect { subject.class.call(params) }.to raise_error /The filter set can not be empty/
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint/AmbiguousRegexpLiteral: Ambiguous regexp literal. Parenthesize the method arguments if it's surely a regexp literal, or add a whitespace to the right of the / if it should be a division.

@ghost
Copy link
Copy Markdown

ghost commented Jan 18, 2018

Copy link
Copy Markdown
Contributor

@panjan panjan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done! Please fix the Pronto violations and we're good to go.


context 'when using sync_multiple_projects_based_on_custom_id mode' do
include_context 'using mode with custom_id'
let(:params) do
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar code found in synchronize_user_filters_spec.rb:94, synchronize_user_filters_spec.rb:153 (mass = 52)

@ghost
Copy link
Copy Markdown

ghost commented Jan 19, 2018

@ghost
Copy link
Copy Markdown

ghost commented Jan 19, 2018

@panjan
Copy link
Copy Markdown
Contributor

panjan commented Jan 19, 2018

ok to merge

def self.sanitize_filters_to_delete(to_delete, users_brick_input, project_users)
return to_delete unless users_brick_input && users_brick_input.any?
user_profiles = users_brick_input.map do |user|
result = project_users.find { |u| u.login == user['login'] }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calls 'filter[:label]' 4 times (DuplicateMethodCall)

def self.sanitize_filters_to_delete(to_delete, users_brick_input, project_users)
return to_delete unless users_brick_input && users_brick_input.any?
user_profiles = users_brick_input.map do |user|
result = project_users.find { |u| u.login == user['login'] }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Contains iterators nested 3 deep (NestedIterators)

def self.sanitize_filters_to_delete(to_delete, users_brick_input, project_users)
return to_delete unless users_brick_input && users_brick_input.any?
user_profiles = users_brick_input.map do |user|
result = project_users.find { |u| u.login == user['login'] }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has the variable name 'l' (UncommunicativeVariableName)

@ghost
Copy link
Copy Markdown

ghost commented Jan 22, 2018

@ghost ghost removed the merge label Jan 22, 2018
@ghost
Copy link
Copy Markdown

ghost commented Feb 6, 2018

@ghost ghost merged commit 857b730 into gooddata:develop Feb 6, 2018
@ghost ghost removed the merge label Feb 6, 2018
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants