Showing 507 of 611 total issues
Function generate_archiver_tests
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def generate_archiver_tests(metafunc, kinds: str):
# Generate tests for different scenarios: local repository, remote repository, and using the borg binary.
archivers = []
for kind in kinds.split(","):
if kind == "local":
- 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 reopen
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def reopen(repository, exclusive: Optional[bool] = True, create=False):
if isinstance(repository, Repository):
if repository.opened:
raise RuntimeError("Repo must be closed before a reopen. Cannot support nested repository contexts.")
return Repository(repository._location, exclusive=exclusive, create=create)
- 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 _create_filesystem
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _create_filesystem(self):
self._create_dir(parent=1) # first call, create root dir (inode == 1)
self.versions_index = FuseVersionsIndex()
archives = self._manifest.archives.list_considering(self._args)
name_counter = Counter(a.name for a in archives)
- 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 assert_no_manifest_replay
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def assert_no_manifest_replay(self, manifest, key):
try:
with open(self.manifest_ts_file) as fd:
timestamp = fd.read()
logger.debug("security: read manifest timestamp %r", timestamp)
- 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
Avoid too many return
statements within this function. Open
return dict(name=name, id=values["id"], time=values["time"])
Avoid too many return
statements within this function. Open
return super().default(o)
Avoid too many return
statements within this function. Open
return default
Avoid too many return
statements within this function. Open
return ""
Avoid too many return
statements within this function. Open
return 1
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return ec1
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return ec2
Avoid too many return
statements within this function. Open
return
Avoid too many return
statements within this function. Open
return
Avoid too many return
statements within this function. Open
return EXIT_SUCCESS
Avoid too many return
statements within this function. Open
return any(key_serialized.startswith(pattern) for pattern in keys_serialized)
Avoid too many return
statements within this function. Open
return seen_commit
Avoid too many return
statements within this function. Open
return
Avoid too many return
statements within this function. Open
return