File _repo.py
has 477 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding=utf-8
"""
Manages the local Git repo
"""
import logging
Repo
has 37 functions (exceeds 20 allowed). Consider refactoring. Open
class Repo(BaseRepo):
"""
Wrapper for git.Repo
"""
Function _sanitize_amend_commit_message
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _sanitize_amend_commit_message(
self,
append_to_msg: typing.Optional[str] = None,
new_message: typing.Optional[str] = None,
previous_message: str = None,
- 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 stash
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def stash(self, stash_name: str):
"""
Stashes the current working tree changes
:param stash_name: name of the stash
- 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 amend_commit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def amend_commit(
self,
append_to_msg: typing.Optional[str] = None,
new_message: typing.Optional[str] = None,
files_to_add: typing.Optional[typing.Union[typing.List[str], str]] = None,
- 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 checkout
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def checkout(self, reference: str):
"""
Checks out a reference.
If the index is dirty, or if the repository contains untracked files, the function will fail.
- 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"