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 typing hints everywhere #155

Closed
wants to merge 2 commits into from
Closed

Add typing hints everywhere #155

wants to merge 2 commits into from

Conversation

ashishb
Copy link
Owner

@ashishb ashishb commented Apr 13, 2021

No description provided.

return execute_adb_command2('shell %s' % adb_cmd, piped_into_cmd=piped_into_cmd,
ignore_stderr=ignore_stderr, device_serial=device_serial)


def execute_adb_command2(adb_cmd, piped_into_cmd=None, ignore_stderr=False, device_serial=None) -> [int, str, str]:
def execute_adb_command2(
Copy link

Choose a reason for hiding this comment

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

Refactor this function to reduce its Cognitive Complexity from 21 to the 15 allowed.

@@ -1406,7 +1418,7 @@ def _get_permissions_info_below_api_23(app_info_dump):


# API 23 and have runtime permissions
def _get_permissions_info_above_api_23(app_info_dump):
def _get_permissions_info_above_api_23(app_info_dump: str):
Copy link

Choose a reason for hiding this comment

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

Refactor this function to reduce its Cognitive Complexity from 22 to the 15 allowed.

@@ -1242,7 +1254,7 @@ def move_file(src_path, dest_path, force):

# Copies from remote_file_path on Android to local_file_path on the disk
# local_file_path can be None
def pull_file(remote_file_path, local_file_path, copy_ancillary=False):
def pull_file(remote_file_path: str, local_file_path: str, copy_ancillary: bool = False):
Copy link

Choose a reason for hiding this comment

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

Refactor this function to reduce its Cognitive Complexity from 17 to the 15 allowed.


# This code has to be in a separate file since it is conditionally loaded for Python 3.5 and later.

# Executes method method_to_call for each argument in params_list and returns the result_list
def execute_in_parallel(method_to_call, params_list):
def execute_in_parallel(method_to_call: typing.Callable, params_list: typing.List):
Copy link

Choose a reason for hiding this comment

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

Line too long (83 > 79 characters)

@@ -104,14 +105,16 @@ def execute_adb_command2(adb_cmd, piped_into_cmd=None, ignore_stderr=False, devi
print_error_and_exit('stdout_data is weird type: %s' % type(stdout_data))


def execute_adb_shell_command(adb_cmd, piped_into_cmd=None, ignore_stderr=False, device_serial=None):
def execute_adb_shell_command(adb_cmd: str, piped_into_cmd: str = None, ignore_stderr: bool = False,
Copy link

Choose a reason for hiding this comment

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

Line too long (100 > 79 characters)

@codeclimate
Copy link

codeclimate bot commented Apr 13, 2021

Code Climate has analyzed commit 722434a and detected 15 issues on this pull request.

Here's the issue category breakdown:

Category Count
Security 8
Style 4
Complexity 3

Note: there are 3 critical issues.

View more on Code Climate.

@ashishb
Copy link
Owner Author

ashishb commented Jul 18, 2022

Obsolete. Closing for now.

@ashishb ashishb closed this Jul 18, 2022
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.

None yet

1 participant