Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion share/lib/python/neuron/rxd/rxdmath.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@
pass
return False

def _semi_compile(self, region, instruction):

Check failure on line 743 in share/lib/python/neuron/rxd/rxdmath.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this function to reduce its Cognitive Complexity from 19 to the 15 allowed.

See more on https://sonarcloud.io/project/issues?id=neuronsimulator_nrn&issues=AZ78RUCvv2bAtrO4ixwf&open=AZ78RUCvv2bAtrO4ixwf&pullRequest=3808
items = []
counts = []
items_append = items.append
Expand All @@ -750,7 +750,10 @@
try:
items_append(item._semi_compile(region, instruction))
except AttributeError:
items_append(f"{item!r}")
try:
items_append(repr(float(item)))
except (TypeError, ValueError):
items_append(f"{item!r}")
counts_append(count)
result = ""
for i, c in zip(items, counts):
Expand Down
Loading