Showing 151 of 151 total issues
Function _guess_pk
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _guess_pk(self, desc: str) -> Optional[str]:
match = _re("^The (.+)").search(desc)
if match is not None and match.group(1) is not None:
split = _re("can be").split(match.group(1))
if len(split) == 2:
- 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 _read_hits
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _read_hits(self, path: Path) -> Sequence[AbstractHit]:
hits = HitDf.read_file(path)
keys = hits["search_key"].unique()
bad_excludes = [e for e in self.exclude if e not in keys]
if len(bad_excludes) > 0:
- 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 fill
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def fill(
Function _get_pubchem
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _get_pubchem(self, inchikey: Optional[str], cid: Optional[int]) -> Optional[CompoundStruct]:
logger.info(f"Fetching PubChem {inchikey} / {cid}")
api = Apis.Pubchem
if cid is not None:
# let it raise a CompoundNotFoundError
- 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 _process
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _process(
Function _fail
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _fail(self, e: BaseException, what: str, *, abort: bool) -> None:
_err("")
_err(f"--- {what} ---".upper())
dump_path = None
if not abort:
- 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 get_smart_taxonomy
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_smart_taxonomy(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function build
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def build(
Function export_copy
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def export_copy(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function filter
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def filter(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function create
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create(
Function _predicate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _predicate(
Function plot_heatmap
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_heatmap(
Function _make_df
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _make_df(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, path: Path, compounds: Sequence[str], *, restart: bool, proceed: bool):
Function cached_from_url
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def cached_from_url(