Showing 151 of 151 total issues
Function find
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def find(self, inchikey: str) -> Sequence[DgiHit]:
data = self.api.fetch_data(inchikey)
results = []
for dd in data.biomolecular_interactions_and_pathways.drug_gene_interactions:
if len(dd.interactions) == 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 concat
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def concat(
path: Path = Arg.in_dir(
rf"""
Directory containing results from a mandos search.
- 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 _go_inside
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _go_inside(
self, keys: Sequence[Union[None, str, Callable[[Any], Any]]]
) -> JsonNavigatorListOfLists:
fns = [_get_conversion_fn(fn) for fn in keys]
gotcha = []
- 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 set_default
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def set_default(
cls,
*,
pubchem: bool = True,
chembl: bool = 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 get_smart_taxonomy
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_smart_taxonomy(
cls,
*,
allow: Iterable[Union[int, str]],
forbid: Iterable[Union[int, str]],
- 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 _scrape_cid
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _scrape_cid(self, inchikey: str) -> int:
# This is awful
# Every attempt to get the actual, correct, unique CID corresponding to the inchikey
# failed with every proper PubChem API
# We can't use <pug_view>/data/compound/<inchikey> -- we can only use a CID there
- 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 links
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def links(
self, rel_types: Set[TargetRelType]
) -> Sequence[Tup[ChemblTargetGraph, TargetRelType]]:
"""
Gets adjacent targets in the graph.
- 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 find
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def find(self, inchikey: str) -> Sequence[CtdGeneHit]:
data = self.api.fetch_data(inchikey)
results = []
for dd in data.biomolecular_interactions_and_pathways.chemical_gene_interactions:
for interaction in dd.interactions:
- 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 ecfp_matrix
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def ecfp_matrix(cls, df: InputCompoundsDf, radius: int, n_bits: int) -> SimilarityDfShortForm:
from mandos.model.utils.rdkit_utils import RdkitUtils
# TODO: This is inefficient and long
indices = range(len(df))
- 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 __truediv__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __truediv__(
self, key: Union[int, str, FilterFn, Callable[[NestedDotDict], NestedDotDict]]
) -> JsonNavigator:
if isinstance(key, FilterFn):
try:
- 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 __truediv__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __truediv__(
self, key: Union[None, str, FilterFn, Callable[[Any], Any]]
) -> JsonNavigatorListOfOptionals:
if isinstance(key, FilterFn):
try:
- 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"