ARMmbed/continuous-delivery-scripts

View on GitHub

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."""
Severity: Major
Found in continuous_delivery_scripts/utils/git_helpers.py - About 1 day to fix

    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.
    Severity: Major
    Found in continuous_delivery_scripts/utils/git_helpers.py - About 1 day to fix

      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.
      
      
      Severity: Minor
      Found in continuous_delivery_scripts/utils/versioning.py - About 4 hrs to fix

      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."""
      Severity: Minor
      Found in continuous_delivery_scripts/utils/configuration.py - About 2 hrs to fix

        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:
        Severity: Minor
        Found in continuous_delivery_scripts/utils/git_helpers.py - About 1 hr to fix

        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.
        
        
        Severity: Minor
        Found in continuous_delivery_scripts/tag_and_release.py - About 45 mins to fix

        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(
        Severity: Minor
        Found in continuous_delivery_scripts/plugins/github_actions.py - About 35 mins to fix

          Function _update_repository has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def _update_repository(
          Severity: Minor
          Found in continuous_delivery_scripts/tag_and_release.py - About 35 mins to fix

            Function _generate_description_for_one_package has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def _generate_description_for_one_package(
            Severity: Minor
            Found in continuous_delivery_scripts/spdx_report/spdx_summary.py - About 35 mins to fix
              Severity
              Category
              Status
              Source
              Language