-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add device refactoring #20
Conversation
e476893
to
64c9359
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nix grosses aber auf jeden fall noch mal wegen den devices_descriptiption im schema gucken
8c14ced
to
44d7822
Compare
44d7822
to
1019b91
Compare
@@ -9,8 +9,8 @@ class Filecollector < Fcollector | |||
# rubocop:disable Metrics/AbcSize | |||
|
|||
def inspect_folder(device) | |||
directory = device.profile.data['method_params']['dir'] | |||
user_level_selected = device.profile.data['method_params']['user_level_selected'] | |||
directory = device.datacollector_dir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/MethodLength: Method has too many lines. [35/30]
@@ -9,8 +9,8 @@ class Filecollector < Fcollector | |||
# rubocop:disable Metrics/AbcSize | |||
|
|||
def inspect_folder(device) | |||
directory = device.profile.data['method_params']['dir'] | |||
user_level_selected = device.profile.data['method_params']['user_level_selected'] | |||
directory = device.datacollector_dir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/PerceivedComplexity: Perceived complexity for inspect_folder is too high. [9/8]
lib/datacollector/foldercollector.rb
Outdated
new_folders(params['dir']).each do |new_folder_p| # rubocop:disable Metrics/BlockLength | ||
if (params['number_of_files'].blank? || (params['number_of_files']).to_i.zero?) && | ||
new_folders(device.datacollector_dir).each do |new_folder_p| # rubocop:disable Metrics/BlockLength | ||
if (device.datacollector_number_of_files.blank? || (device.datacollector_number_of_files).to_i.zero?) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/RedundantParentheses: Don't use parentheses around a method call.
@@ -103,15 +102,15 @@ def list_files | |||
all_files | |||
end | |||
|
|||
def inspect_user_folders(device, params) | |||
def inspect_user_folders(device) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/AbcSize: Assignment Branch Condition size for inspect_user_folders is too high. [<11, 51, 16> 54.57/25]
@@ -103,15 +102,15 @@ def list_files | |||
all_files | |||
end | |||
|
|||
def inspect_user_folders(device, params) | |||
def inspect_user_folders(device) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/CyclomaticComplexity: Cyclomatic complexity for inspect_user_folders is too high. [13/7]
@@ -103,15 +102,15 @@ def list_files | |||
all_files | |||
end | |||
|
|||
def inspect_user_folders(device, params) | |||
def inspect_user_folders(device) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/MethodLength: Method has too many lines. [43/30]
@@ -103,15 +102,15 @@ def list_files | |||
all_files | |||
end | |||
|
|||
def inspect_user_folders(device, params) | |||
def inspect_user_folders(device) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/PerceivedComplexity: Perceived complexity for inspect_user_folders is too high. [14/8]
sleep_time = sleep_seconds(device).to_i | ||
new_folders(params['dir']).each do |new_folder_p| | ||
new_folders(device.datacollector_dir).each do |new_folder_p| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/BlockLength: Block has too many lines. [40/25]
lib/datacollector/foldercollector.rb
Outdated
recipient_abbr = new_folder_p.split('/').last.split('-').first | ||
recipient = User.try_find_by_name_abbreviation recipient_abbr | ||
|
||
if recipient | ||
new_folders(new_folder_p).each do |new_folder| | ||
if (params['number_of_files'].blank? || (params['number_of_files']).to_i.zero?) && | ||
if (device.datacollector_number_of_files.blank? || (device.datacollector_number_of_files).to_i.zero?) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/BlockLength: Block has too many lines. [32/25]
lib/datacollector/foldercollector.rb
Outdated
recipient_abbr = new_folder_p.split('/').last.split('-').first | ||
recipient = User.try_find_by_name_abbreviation recipient_abbr | ||
|
||
if recipient | ||
new_folders(new_folder_p).each do |new_folder| | ||
if (params['number_of_files'].blank? || (params['number_of_files']).to_i.zero?) && | ||
if (device.datacollector_number_of_files.blank? || (device.datacollector_number_of_files).to_i.zero?) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/RedundantParentheses: Don't use parentheses around a method call.
LCOV of commit
|
732893e
to
4b961f7
Compare
4b961f7
to
eb052be
Compare
LCOV of commit
|
3a3397b
to
8a8fba6
Compare
8a8fba6
to
ced2513
Compare
Change device to own model