Showing 228 of 691 total issues
Function __init__
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, **kwargs):
self.wrapped = True
BaseClass.Base.__init__(self)
if "type" in kwargs:
if kwargs["type"] is not None:
- 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 toLily
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def toLily(self):
val = ""
if hasattr(self, "type"):
if self.type == "subtract":
val += "no "
- 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 __init__
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, **kwargs):
BaseClass.Base.__init__(self)
if "title" in kwargs:
if kwargs["title"] is not None:
self.title = kwargs["title"]
- 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
Avoid deeply nested control flow statements. Open
if data["frame_note"] is None:
data["frame_note"] = Harmony.FrameNote()
Avoid deeply nested control flow statements. Open
if "string" in tag and "string" in content:
data["frame_note"].string = content["string"]
data["direction"].frame.notes[
int(content["string"])] = data["frame_note"]
if "fret" in tag and "fret" in content:
Avoid deeply nested control flow statements. Open
if "parentheses" in attrs["metronome"]:
data["direction"].parentheses = YesNoToBool(
attrs["metronome"]["parentheses"])
if tags[-1] == "wedge":
Avoid deeply nested control flow statements. Open
if previous * 2 == value:
result += "."
if previous == value:
Avoid deeply nested control flow statements. Open
if not hasattr(piece.GetItem().meta, "copyright"):
piece.GetItem().meta.copyright = ""
piece.GetItem().meta.copyright += rights
Avoid deeply nested control flow statements. Open
if measure is not None:
key = measure.GetLastKey(voice=data["voice"])
if key is not None and type(key) is not Key.Key:
key = key.GetItem()
measure.addKey(Key.Key(), data["voice"])
Avoid deeply nested control flow statements. Open
if "halign" in attrib["kind"]:
kind.halign = attrib["kind"]["halign"]
if "parenthesis-degrees" in attrib["kind"]:
Avoid deeply nested control flow statements. Open
if "dalsegno" in attrs["sound"]:
measure.dalsegno = attrs["sound"]["dalsegno"]
if "fine" in attrs["sound"]:
Avoid deeply nested control flow statements. Open
if "font-size" in temp:
size = float(temp["font-size"])
if "justify" in temp:
Avoid deeply nested control flow statements. Open
if "first-fret" in content:
if "first-fret" not in attrib:
data["direction"].frame.firstFret = [
content["first-fret"]]
else:
Avoid deeply nested control flow statements. Open
if "parentheses" in attrs["metronome"]:
data["direction"].parentheses = YesNoToBool(
attrs["metronome"]["parentheses"])
if tags[-1] == "per-minute":
Avoid deeply nested control flow statements. Open
if "justify" in temp:
justify = temp["justify"]
if justify == "center" and data["handleType"] == "":
data["handleType"] = "title"
if justify == "right" and data["handleType"] == "":
Avoid deeply nested control flow statements. Open
for c in children:
child = placeholder.GetChild(c)
if child.GetItem(
).__class__.__name__ == OctaveShift.__name__:
i = placeholder.PopChild(c)
Avoid deeply nested control flow statements. Open
if counter == index:
return node.GetChild(child)
if isinstance(result, cls_type):
Avoid deeply nested control flow statements. Open
if data["handleType"] == "title":
if not hasattr(piece.GetItem().meta, "title"):
piece.GetItem().meta.title = text
else:
if text.replace(
Avoid deeply nested control flow statements. Open
if not isinstance(node, NoteNode.Placeholder):
self.index += 1
else:
Avoid deeply nested control flow statements. Open
if "strong-accent" in attrs:
if "type" in attrs["strong-accent"]:
s_type = attrs["strong-accent"]["type"]
accent = Mark.StrongAccent(type=s_type)