Showing 9 of 9 total issues
File git_helpers.py
has 628 lines of code (exceeds 250 allowed). Consider refactoring. Open
#
# Copyright (C) 2020-2022 Arm Limited or its affiliates and Contributors. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
"""Utility script to abstract git operations for our CI scripts."""
GitWrapper
has 62 functions (exceeds 20 allowed). Consider refactoring. Open
class GitWrapper:
"""Wrapper class to provide convenient methods for performing git actions."""
def __init__(self, path: Path, repo: Repo) -> None:
"""Creates an instance of GitWrapper.
Function determine_version_shortcuts
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def determine_version_shortcuts(
commit_type: CommitType, tag_latest: bool, tag_shortcut: bool, version_elements: Dict[str, str]
) -> Dict[str, bool]:
"""Determine the different version shortcuts i.e. major, major.minor, pre depending on the release type.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File configuration.py
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Open
#
# Copyright (C) 2020-2022 Arm Limited or its affiliates and Contributors. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
"""Utilities in charge of fetching configuration values for the ci scripts."""
Function _get_specific_changes
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _get_specific_changes(self, change_type: Optional[str], commit1: Any, commit2: Any) -> List[str]:
diff = None
if commit1:
diff = commit1.diff(commit2) if commit2 else commit1.diff()
elif commit2:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function tag_and_release
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def tag_and_release(mode: CommitType, current_branch: Optional[str] = None) -> None:
"""Tags and releases.
Updates repository with changes and releases package to PyPI for general availability.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _generate_github_cli_release_command_list
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _generate_github_cli_release_command_list(
Function _update_repository
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _update_repository(
Function _generate_description_for_one_package
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _generate_description_for_one_package(