Showing 691 of 691 total issues
Avoid deeply nested control flow statements. Open
if "barre" in tag and "barre" in attrib:
data["frame_note"].barre = attrib["barre"]["type"]
if "fingering" in tag and "fingering" in content:
Avoid deeply nested control flow statements. Open
if measure.GetBarline(location) is None or not hasattr(
measure.GetBarline(location),
"ending"):
num_str = attrib["ending"]["number"]
split = num_str.split(",")
Avoid deeply nested control flow statements. Open
if "font-family" in attrs["metronome"]:
data["direction"].font = attrs[
"metronome"]["font-family"]
if "font-size" in attrs["metronome"]:
Avoid deeply nested control flow statements. Open
if not hasattr(piece.GetItem(), "meta"):
piece.GetItem().meta = Meta.Meta()
piece.GetItem().meta.AddCredit(credit)
Avoid deeply nested control flow statements. Open
if data["handleType"] == "composer":
if not hasattr(piece.GetItem().meta, "composer"):
piece.GetItem().meta.composer = text
else:
if text.replace(
Avoid deeply nested control flow statements. Open
if "root-alter" in content:
root.alter = content["root-alter"]
Avoid deeply nested control flow statements. Open
if "degree-type" in content:
data["degree"].type = content["degree-type"]
if "degree-type" in attrib:
Avoid deeply nested control flow statements. Open
if location not in measure.barlines or not hasattr(
measure.GetBarline(location),
"ending"):
btype = attrib["ending"]["type"]
else:
Avoid deeply nested control flow statements. Open
if not hasattr(
data["direction"],
"beat") or data["direction"].beat is None:
data["direction"].beat = unit
else:
Avoid deeply nested control flow statements. Open
if "tocoda" in attrs["sound"]:
measure.tocoda = attrs["sound"]["tocoda"]
Function toLily
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def toLily(self):
'''
Method which converts the object instance and its attributes to a string of lilypond code
- 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 HandleFermata
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def HandleFermata(tags, attrs, chars, piece, data):
if "fermata" in tags:
type = None
symbol = None
if "fermata" in attrs:
- 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
for staff in staves:
if part.getMeasure(measure_id, staff) is None:
part.addEmptyMeasure(measure_id, staff)
measure = part.getMeasure(measure_id, staff)
measure.newPage = YesNoToBool(
Avoid deeply nested control flow statements. Open
if "degree-alter" in content:
data["degree"].alter = content["degree-alter"]
if "degree-type" in tag:
Function GetLastClef
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def GetLastClef(self, voice=1):
if self.GetChild(voice) is None:
self.addVoice(VoiceNode(), voice)
voice_obj = self.GetChild(voice)
if voice_obj 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
Avoid deeply nested control flow statements. Open
if "parenthesis-degrees" in attrib["kind"]:
kind.parenthesis = attrib[
"kind"]["parenthesis-degrees"]
Avoid deeply nested control flow statements. Open
if "degree-value" in content:
data["degree"].value = content["degree-value"]
if "degree-alter" in tag:
Avoid deeply nested control flow statements. Open
if "font-size" in attrs["metronome"]:
data["direction"].size = float(
attrs["metronome"]["font-size"])
if "parentheses" in attrs["metronome"]:
Avoid deeply nested control flow statements. Open
if "coda" in attrs["sound"]:
measure.coda = attrs["sound"]["coda"]
if "dacapo" in attrs["sound"]:
Avoid deeply nested control flow statements. Open
if "fine" in attrs["sound"]:
measure.fine = YesNoToBool(attrs["sound"]["fine"])
if "segno" in attrs["sound"]: