Skip to content
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

Closed
wants to merge 23 commits into from
Closed

Add device refactoring #20

wants to merge 23 commits into from

Conversation

beque
Copy link

@beque beque commented Feb 1, 2024

Change device to own model

@beque beque force-pushed the device_refactoring branch from e476893 to 64c9359 Compare February 1, 2024 14:18
Copy link
Member

@dinge dinge left a 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

@beque beque force-pushed the device_refactoring branch 2 times, most recently from 8c14ced to 44d7822 Compare February 7, 2024 15:59
@beque beque force-pushed the device_refactoring branch from 44d7822 to 1019b91 Compare February 21, 2024 16:41
@@ -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

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

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]

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?) &&

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)

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)

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)

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)

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|

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]

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?) &&

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]

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?) &&

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.

Copy link

LCOV of commit 1019b91 during Continuous Integration #187

Summary coverage rate:
  lines......: 64.1% (13519 of 21091 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate: n/a

@beque beque force-pushed the device_refactoring branch from 732893e to 4b961f7 Compare March 14, 2024 14:16
@beque beque force-pushed the device_refactoring branch from 4b961f7 to eb052be Compare April 5, 2024 16:10
Copy link

github-actions bot commented Apr 5, 2024

LCOV of commit 3a3397b during Continuous Integration #192

Summary coverage rate:
  lines......: 63.9% (13535 of 21173 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate: n/a

@beque beque force-pushed the device_refactoring branch from 3a3397b to 8a8fba6 Compare April 16, 2024 12:48
@beque beque force-pushed the device_refactoring branch from 8a8fba6 to ced2513 Compare April 26, 2024 18:13
@beque beque force-pushed the device_refactoring branch from ced2513 to 199f2c7 Compare May 13, 2024 10:32
@beque beque closed this Sep 20, 2024
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.

2 participants