JrGoodle/clowder

View on GitHub
src/clowder/git/project_repo.py

Summary

Maintainability
C
7 hrs
Test Coverage

Function start has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def start(self, remote: str, branch: str, depth: int, tracking: bool) -> None:
        """Start new branch in repository and checkout

        :param str remote: Remote name
        :param str branch: Local branch name to create
Severity: Minor
Found in src/clowder/git/project_repo.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 herd_branch has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def herd_branch(self, url: str, branch: str, depth: int = 0, rebase: bool = False,
                    fork_remote: Optional[str] = None, config: Optional[GitConfig] = None) -> None:
        """Herd branch

        :param str url: URL of repo
Severity: Minor
Found in src/clowder/git/project_repo.py - About 55 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 configure_remotes has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def configure_remotes(self, upstream_remote_name: str, upstream_remote_url: str,
                          fork_remote_name: str, fork_remote_url: str) -> None:
        """Configure remotes names for fork and upstream

        :param str upstream_remote_name: Upstream remote name
Severity: Minor
Found in src/clowder/git/project_repo.py - About 55 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 herd_branch has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def herd_branch(self, url: str, branch: str, depth: int = 0, rebase: bool = False,
Severity: Minor
Found in src/clowder/git/project_repo.py - About 45 mins to fix

    Function herd_tag has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def herd_tag(self, url: str, tag: str, depth: int = 0,
                     rebase: bool = False, config: Optional[GitConfig] = None) -> None:
            """Herd tag
    
            :param str url: URL of repo
    Severity: Minor
    Found in src/clowder/git/project_repo.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 create_clowder_repo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def create_clowder_repo(self, url: str, branch: str, depth: int = 0) -> None:
            """Clone clowder git repo from url at path
    
            :param str url: URL of repo
            :param str branch: Branch name
    Severity: Minor
    Found in src/clowder/git/project_repo.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 herd has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def herd(self, url: str, depth: int = 0, fetch: bool = True,
    Severity: Minor
    Found in src/clowder/git/project_repo.py - About 35 mins to fix

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

          def herd_tag(self, url: str, tag: str, depth: int = 0,
      Severity: Minor
      Found in src/clowder/git/project_repo.py - About 35 mins to fix

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

            def _herd(self, remote: str, ref: str, depth: int = 0, fetch: bool = True, rebase: bool = False) -> None:
        Severity: Minor
        Found in src/clowder/git/project_repo.py - About 35 mins to fix

          There are no issues that match your filters.

          Category
          Status