Showing 507 of 611 total issues
File archive.py
has 1968 lines of code (exceeds 250 allowed). Consider refactoring. Open
import base64
import errno
import json
import os
import stat
File legacyrepository.py
has 1437 lines of code (exceeds 250 allowed). Consider refactoring. Open
import errno
import mmap
import os
import shutil
import stat
Function call_many
has a Cognitive Complexity of 172 (exceeds 5 allowed). Consider refactoring. Open
def call_many(self, cmd, calls, wait=True, is_preloaded=False, async_wait=True):
if not calls and cmd != "async_responses":
return
def send_buffer():
- 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 call_many
has a Cognitive Complexity of 171 (exceeds 5 allowed). Consider refactoring. Open
def call_many(self, cmd, calls, wait=True, is_preloaded=False, async_wait=True):
if not calls and cmd != "async_responses":
return
def send_buffer():
- 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 helpers_test.py
has 1196 lines of code (exceeds 250 allowed). Consider refactoring. Open
import base64
import errno
import getpass
import hashlib
import os
File remote.py
has 1061 lines of code (exceeds 250 allowed). Consider refactoring. Open
import atexit
import errno
import functools
import inspect
import logging
Function do_create
has a Cognitive Complexity of 127 (exceeds 5 allowed). Consider refactoring. Open
def do_create(self, args, repository, manifest):
"""Create new archive"""
key = manifest.key
matcher = PatternMatcher(fallback=True)
matcher.add_inclexcl(args.patterns)
- 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 rebuild_archives
has a Cognitive Complexity of 125 (exceeds 5 allowed). Consider refactoring. Open
def rebuild_archives(
self, first=0, last=0, sort_by="", match=None, older=None, newer=None, oldest=None, newest=None
):
"""Analyze and rebuild archives, expecting some damage and trying to make stuff consistent again."""
- 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 parseformat.py
has 991 lines of code (exceeds 250 allowed). Consider refactoring. Open
import abc
import argparse
import base64
import binascii
import hashlib
File create_cmd.py
has 851 lines of code (exceeds 250 allowed). Consider refactoring. Open
import errno
import sys
import argparse
import logging
import os
File legacyrepository_test.py
has 832 lines of code (exceeds 250 allowed). Consider refactoring. Open
import logging
import os
import sys
from typing import Optional
from unittest.mock import patch
Function do_transfer
has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring. Open
def do_transfer(self, args, *, repository, manifest, cache, other_repository=None, other_manifest=None):
"""archives transfer from other repository, optionally upgrade data format"""
key = manifest.key
other_key = other_manifest.key
if not uses_same_id_hash(other_key, key):
- 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 legacyremote.py
has 763 lines of code (exceeds 250 allowed). Consider refactoring. Open
import errno
import functools
import inspect
import logging
import os
File create_cmd_test.py
has 751 lines of code (exceeds 250 allowed). Consider refactoring. Open
import errno
import json
import os
import tempfile
import shutil
File key.py
has 750 lines of code (exceeds 250 allowed). Consider refactoring. Open
import binascii
import hmac
import os
import textwrap
from hashlib import sha256, pbkdf2_hmac
Function extract_item
has a Cognitive Complexity of 87 (exceeds 5 allowed). Consider refactoring. Open
def extract_item(
self,
item,
*,
restore_attrs=True,
- 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 serve
has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring. Open
def serve(self):
def inner_serve():
os.set_blocking(self.stdin_fd, False)
assert not os.get_blocking(self.stdin_fd)
os.set_blocking(self.stdout_fd, True)
- 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 cache.py
has 725 lines of code (exceeds 250 allowed). Consider refactoring. Open
import configparser
import io
import os
import shutil
import stat
Function rst_to_text
has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring. Open
def rst_to_text(text, state_hook=None, references=None):
"""
Convert rST to a more human text form.
This is a very loose conversion. No advanced rST features are supported.
- 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 test_transfer_upgrade
has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring. Open
def test_transfer_upgrade(archivers, request):
archiver = request.getfixturevalue(archivers)
if archiver.get_kind() in ["remote", "binary"]:
pytest.skip("only works locally")
- 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"