Showing 151 of 151 total issues
Function calc_phi
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def calc_phi(
Function init_db
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def init_db(
Function calc_tau
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def calc_tau(
Consider simplifying this complex logical expression. Open
if "Number" in dot and len(["Number"]) == 1:
value = dot["Number"][0]
elif "Number" in dot and len(["Number"]) > 1:
value = ", ".join([str(s) for s in dot["Number"]])
elif (
Function _go_inside
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _go_inside(self, key: Union[int, str]) -> JsonNavigator:
new = []
for z in self.contents:
if key in z:
# nav = z.get_as("_nav", list, [])
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
def find(self, inchikey: str) -> Sequence[T]:
data = self.api.fetch_data(inchikey)
results = []
for dd in data.biomolecular_interactions_and_pathways.drugbank_interactions:
if dd.target_type in self.target_types:
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
def find(self, inchikey: str) -> Sequence[AcuteEffectHit]:
data = self.api.fetch_data(inchikey)
results = []
for dd in data.toxicity.acute_effects:
for effect in dd.effects:
- 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 calc_one
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def calc_one(self, key: str, hits: Sequence[AbstractHit]) -> SimilarityDfShortForm:
ik2hits = Au.hit_multidict(hits, "origin_inchikey")
logger.info(f"Calculating J on {key} for {len(ik2hits):,} compounds and {len(hits):,} hits")
data = defaultdict(dict)
inf = _Inf(n=int(len(ik2hits) * (len(ik2hits) - 1) / 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 calc_projection
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def calc_projection(
Function calc_ecfp
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def calc_ecfp(
Function set_default
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def set_default(
Function search
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def search(
Function set
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def set(
Avoid deeply nested control flow statements. Open
if xref["xref_src_db"] == f"Go{self.go_type.name.capitalize()}":
terms.add((xref["xref_id"], xref["xref_name"]))
hits = []
Function __init__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, path: Path, compounds: Sequence[str], *, restart: bool, proceed: bool):
# TODO: This class is pretty bad
self._path = path
exists = self._path.exists() and self._meta_path.exists()
if exists:
- 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 _if_match
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _if_match(
Function create
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def create(
Function _get_metadata
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _get_metadata(
Function adjust_filename
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def adjust_filename(
Function get_kwargs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_kwargs(
self, n_rows: int, n_categories: int, more: Mapping[str, Any]
) -> Mapping[str, Any]:
kwargs = dict(dropna=False)
kwargs.update(**more)
- 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"