Function HandleMeasures
has a Cognitive Complexity of 361 (exceeds 5 allowed). Consider refactoring. Open
def HandleMeasures(tag, attrib, content, piece, data):
part_id = helpers.GetID(attrib, "part", "id")
measure_id = IdAsInt(helpers.GetID(attrib, "measure", "number"))
part = None
key = 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 HandleDirections
has a Cognitive Complexity of 204 (exceeds 5 allowed). Consider refactoring. Open
def HandleDirections(tags, attrs, chars, piece, data):
global expressions, items
return_val = None
if len(tags) == 0:
return 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 SetupPiece
has a Cognitive Complexity of 202 (exceeds 5 allowed). Consider refactoring. Open
def SetupPiece(tag, attrib, content, piece, data):
return_val = None
if content is not [] and len(tag) > 0:
title = None
composer = 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
File MxmlParser.py
has 1403 lines of code (exceeds 250 allowed). Consider refactoring. Open
import xml.sax
from xml.sax import make_parser, handler
import copy
from MuseParse.classes.ObjectHierarchy.ItemClasses import Directions, Key, BarlinesAndMarkers, Clef, Meter, \
Cyclomatic complexity is too high in function HandleMeasures. (116) Open
def HandleMeasures(tag, attrib, content, piece, data):
part_id = helpers.GetID(attrib, "part", "id")
measure_id = IdAsInt(helpers.GetID(attrib, "measure", "number"))
part = None
key = None
- Read upRead up
- Exclude checks
Cyclomatic Complexity
Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.
Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:
Construct | Effect on CC | Reasoning |
---|---|---|
if | +1 | An if statement is a single decision. |
elif | +1 | The elif statement adds another decision. |
else | +0 | The else statement does not cause a new decision. The decision is at the if. |
for | +1 | There is a decision at the start of the loop. |
while | +1 | There is a decision at the while statement. |
except | +1 | Each except branch adds a new conditional path of execution. |
finally | +0 | The finally block is unconditionally executed. |
with | +1 | The with statement roughly corresponds to a try/except block (see PEP 343 for details). |
assert | +1 | The assert statement internally roughly equals a conditional statement. |
Comprehension | +1 | A list/set/dict comprehension of generator expression is equivalent to a for loop. |
Boolean Operator | +1 | Every boolean operator (and, or) adds a decision point. |
Function handleBarline
has a Cognitive Complexity of 99 (exceeds 5 allowed). Consider refactoring. Open
def handleBarline(tag, attrib, content, piece, data):
part_id = helpers.GetID(attrib, "part", "id")
measure_id = IdAsInt(helpers.GetID(attrib, "measure", "number"))
measure = None
times = 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
Cyclomatic complexity is too high in function HandleDirections. (67) Open
def HandleDirections(tags, attrs, chars, piece, data):
global expressions, items
return_val = None
if len(tags) == 0:
return None
- Read upRead up
- Exclude checks
Cyclomatic Complexity
Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.
Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:
Construct | Effect on CC | Reasoning |
---|---|---|
if | +1 | An if statement is a single decision. |
elif | +1 | The elif statement adds another decision. |
else | +0 | The else statement does not cause a new decision. The decision is at the if. |
for | +1 | There is a decision at the start of the loop. |
while | +1 | There is a decision at the while statement. |
except | +1 | Each except branch adds a new conditional path of execution. |
finally | +0 | The finally block is unconditionally executed. |
with | +1 | The with statement roughly corresponds to a try/except block (see PEP 343 for details). |
assert | +1 | The assert statement internally roughly equals a conditional statement. |
Comprehension | +1 | A list/set/dict comprehension of generator expression is equivalent to a for loop. |
Boolean Operator | +1 | Every boolean operator (and, or) adds a decision point. |
Function CreateNote
has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring. Open
def CreateNote(tag, attrs, content, piece, data):
ret_value = None
if len(tag) > 0 and "note" in tag:
- 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
Cyclomatic complexity is too high in function SetupPiece. (53) Open
def SetupPiece(tag, attrib, content, piece, data):
return_val = None
if content is not [] and len(tag) > 0:
title = None
composer = None
- Read upRead up
- Exclude checks
Cyclomatic Complexity
Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.
Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:
Construct | Effect on CC | Reasoning |
---|---|---|
if | +1 | An if statement is a single decision. |
elif | +1 | The elif statement adds another decision. |
else | +0 | The else statement does not cause a new decision. The decision is at the if. |
for | +1 | There is a decision at the start of the loop. |
while | +1 | There is a decision at the while statement. |
except | +1 | Each except branch adds a new conditional path of execution. |
finally | +0 | The finally block is unconditionally executed. |
with | +1 | The with statement roughly corresponds to a try/except block (see PEP 343 for details). |
assert | +1 | The assert statement internally roughly equals a conditional statement. |
Comprehension | +1 | A list/set/dict comprehension of generator expression is equivalent to a for loop. |
Boolean Operator | +1 | Every boolean operator (and, or) adds a decision point. |
Function handleArticulation
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
def handleArticulation(tag, attrs, content, piece, data):
if len(tag) > 0:
if "articulations" in tag:
if data["note"] is not None:
accent = 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 HandleRepeatMarking
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
def HandleRepeatMarking(tags, attrs, chars, piece, data):
global last_note
if "direction" in tags or "forward" in tags:
if tags[-1] == "voice":
data["voice"] = int(chars["voice"])
- 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 UpdatePart
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
def UpdatePart(tag, attrib, content, piece, data):
part_id = helpers.GetID(attrib, "part", "id")
if part_id is None:
part_id = helpers.GetID(attrib, "score-part", "id")
return_val = 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 EndTag
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
def EndTag(self, name):
'''
Method called by the SAX parser when a tag is ended
:param name: the name of the tag
- 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 handleClef
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
def handleClef(tag, attrib, content, piece, data):
data["staff_id"] = IdAsInt(helpers.GetID(attrib, "clef", "number"))
if data["staff_id"] is None:
data["staff_id"] = 1
measure_id = IdAsInt(helpers.GetID(attrib, "measure", "number"))
- 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
Cyclomatic complexity is too high in function CreateNote. (31) Open
def CreateNote(tag, attrs, content, piece, data):
ret_value = None
if len(tag) > 0 and "note" in tag:
- Read upRead up
- Exclude checks
Cyclomatic Complexity
Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.
Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:
Construct | Effect on CC | Reasoning |
---|---|---|
if | +1 | An if statement is a single decision. |
elif | +1 | The elif statement adds another decision. |
else | +0 | The else statement does not cause a new decision. The decision is at the if. |
for | +1 | There is a decision at the start of the loop. |
while | +1 | There is a decision at the while statement. |
except | +1 | Each except branch adds a new conditional path of execution. |
finally | +0 | The finally block is unconditionally executed. |
with | +1 | The with statement roughly corresponds to a try/except block (see PEP 343 for details). |
assert | +1 | The assert statement internally roughly equals a conditional statement. |
Comprehension | +1 | A list/set/dict comprehension of generator expression is equivalent to a for loop. |
Boolean Operator | +1 | Every boolean operator (and, or) adds a decision point. |
Cyclomatic complexity is too high in function handleBarline. (31) Open
def handleBarline(tag, attrib, content, piece, data):
part_id = helpers.GetID(attrib, "part", "id")
measure_id = IdAsInt(helpers.GetID(attrib, "measure", "number"))
measure = None
times = 2
- Read upRead up
- Exclude checks
Cyclomatic Complexity
Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.
Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:
Construct | Effect on CC | Reasoning |
---|---|---|
if | +1 | An if statement is a single decision. |
elif | +1 | The elif statement adds another decision. |
else | +0 | The else statement does not cause a new decision. The decision is at the if. |
for | +1 | There is a decision at the start of the loop. |
while | +1 | There is a decision at the while statement. |
except | +1 | Each except branch adds a new conditional path of execution. |
finally | +0 | The finally block is unconditionally executed. |
with | +1 | The with statement roughly corresponds to a try/except block (see PEP 343 for details). |
assert | +1 | The assert statement internally roughly equals a conditional statement. |
Comprehension | +1 | A list/set/dict comprehension of generator expression is equivalent to a for loop. |
Boolean Operator | +1 | Every boolean operator (and, or) adds a decision point. |
Cyclomatic complexity is too high in method EndTag. (26) Open
def EndTag(self, name):
'''
Method called by the SAX parser when a tag is ended
:param name: the name of the tag
- Read upRead up
- Exclude checks
Cyclomatic Complexity
Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.
Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:
Construct | Effect on CC | Reasoning |
---|---|---|
if | +1 | An if statement is a single decision. |
elif | +1 | The elif statement adds another decision. |
else | +0 | The else statement does not cause a new decision. The decision is at the if. |
for | +1 | There is a decision at the start of the loop. |
while | +1 | There is a decision at the while statement. |
except | +1 | Each except branch adds a new conditional path of execution. |
finally | +0 | The finally block is unconditionally executed. |
with | +1 | The with statement roughly corresponds to a try/except block (see PEP 343 for details). |
assert | +1 | The assert statement internally roughly equals a conditional statement. |
Comprehension | +1 | A list/set/dict comprehension of generator expression is equivalent to a for loop. |
Boolean Operator | +1 | Every boolean operator (and, or) adds a decision point. |
Function handleOrnaments
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def handleOrnaments(tags, attrs, content, piece, data):
if "ornaments" in tags:
if tags[-1] == "inverted-mordent":
data["note"].addNotation(Ornaments.InvertedMordent())
if tags[-1] == "mordent":
- 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 HandlePitch
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def HandlePitch(tags, attrs, text, piece, data):
return_val = None
if len(tags) > 0:
if "pitch" or "unpitched" in tags:
if not hasattr(data["note"], "pitch") and data["note"] 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
Cyclomatic complexity is too high in function UpdatePart. (19) Open
def UpdatePart(tag, attrib, content, piece, data):
part_id = helpers.GetID(attrib, "part", "id")
if part_id is None:
part_id = helpers.GetID(attrib, "score-part", "id")
return_val = None
- Read upRead up
- Exclude checks
Cyclomatic Complexity
Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.
Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:
Construct | Effect on CC | Reasoning |
---|---|---|
if | +1 | An if statement is a single decision. |
elif | +1 | The elif statement adds another decision. |
else | +0 | The else statement does not cause a new decision. The decision is at the if. |
for | +1 | There is a decision at the start of the loop. |
while | +1 | There is a decision at the while statement. |
except | +1 | Each except branch adds a new conditional path of execution. |
finally | +0 | The finally block is unconditionally executed. |
with | +1 | The with statement roughly corresponds to a try/except block (see PEP 343 for details). |
assert | +1 | The assert statement internally roughly equals a conditional statement. |
Comprehension | +1 | A list/set/dict comprehension of generator expression is equivalent to a for loop. |
Boolean Operator | +1 | Every boolean operator (and, or) adds a decision point. |
Function handleOtherNotations
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def handleOtherNotations(tag, attrs, content, piece, data):
if len(tag) > 0:
if "notations" in tag:
if tag[-1] == "slur":
- 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
Cyclomatic complexity is too high in function handleOtherNotations. (17) Open
def handleOtherNotations(tag, attrs, content, piece, data):
if len(tag) > 0:
if "notations" in tag:
if tag[-1] == "slur":
- Read upRead up
- Exclude checks
Cyclomatic Complexity
Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.
Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:
Construct | Effect on CC | Reasoning |
---|---|---|
if | +1 | An if statement is a single decision. |
elif | +1 | The elif statement adds another decision. |
else | +0 | The else statement does not cause a new decision. The decision is at the if. |
for | +1 | There is a decision at the start of the loop. |
while | +1 | There is a decision at the while statement. |
except | +1 | Each except branch adds a new conditional path of execution. |
finally | +0 | The finally block is unconditionally executed. |
with | +1 | The with statement roughly corresponds to a try/except block (see PEP 343 for details). |
assert | +1 | The assert statement internally roughly equals a conditional statement. |
Comprehension | +1 | A list/set/dict comprehension of generator expression is equivalent to a for loop. |
Boolean Operator | +1 | Every boolean operator (and, or) adds a decision point. |
Cyclomatic complexity is too high in function HandleRepeatMarking. (17) Open
def HandleRepeatMarking(tags, attrs, chars, piece, data):
global last_note
if "direction" in tags or "forward" in tags:
if tags[-1] == "voice":
data["voice"] = int(chars["voice"])
- Read upRead up
- Exclude checks
Cyclomatic Complexity
Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.
Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:
Construct | Effect on CC | Reasoning |
---|---|---|
if | +1 | An if statement is a single decision. |
elif | +1 | The elif statement adds another decision. |
else | +0 | The else statement does not cause a new decision. The decision is at the if. |
for | +1 | There is a decision at the start of the loop. |
while | +1 | There is a decision at the while statement. |
except | +1 | Each except branch adds a new conditional path of execution. |
finally | +0 | The finally block is unconditionally executed. |
with | +1 | The with statement roughly corresponds to a try/except block (see PEP 343 for details). |
assert | +1 | The assert statement internally roughly equals a conditional statement. |
Comprehension | +1 | A list/set/dict comprehension of generator expression is equivalent to a for loop. |
Boolean Operator | +1 | Every boolean operator (and, or) adds a decision point. |
Cyclomatic complexity is too high in function handleClef. (17) Open
def handleClef(tag, attrib, content, piece, data):
data["staff_id"] = IdAsInt(helpers.GetID(attrib, "clef", "number"))
if data["staff_id"] is None:
data["staff_id"] = 1
measure_id = IdAsInt(helpers.GetID(attrib, "measure", "number"))
- Read upRead up
- Exclude checks
Cyclomatic Complexity
Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.
Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:
Construct | Effect on CC | Reasoning |
---|---|---|
if | +1 | An if statement is a single decision. |
elif | +1 | The elif statement adds another decision. |
else | +0 | The else statement does not cause a new decision. The decision is at the if. |
for | +1 | There is a decision at the start of the loop. |
while | +1 | There is a decision at the while statement. |
except | +1 | Each except branch adds a new conditional path of execution. |
finally | +0 | The finally block is unconditionally executed. |
with | +1 | The with statement roughly corresponds to a try/except block (see PEP 343 for details). |
assert | +1 | The assert statement internally roughly equals a conditional statement. |
Comprehension | +1 | A list/set/dict comprehension of generator expression is equivalent to a for loop. |
Boolean Operator | +1 | Every boolean operator (and, or) adds a decision point. |
Cyclomatic complexity is too high in function handleArticulation. (16) Open
def handleArticulation(tag, attrs, content, piece, data):
if len(tag) > 0:
if "articulations" in tag:
if data["note"] is not None:
accent = None
- Read upRead up
- Exclude checks
Cyclomatic Complexity
Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.
Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:
Construct | Effect on CC | Reasoning |
---|---|---|
if | +1 | An if statement is a single decision. |
elif | +1 | The elif statement adds another decision. |
else | +0 | The else statement does not cause a new decision. The decision is at the if. |
for | +1 | There is a decision at the start of the loop. |
while | +1 | There is a decision at the while statement. |
except | +1 | Each except branch adds a new conditional path of execution. |
finally | +0 | The finally block is unconditionally executed. |
with | +1 | The with statement roughly corresponds to a try/except block (see PEP 343 for details). |
assert | +1 | The assert statement internally roughly equals a conditional statement. |
Comprehension | +1 | A list/set/dict comprehension of generator expression is equivalent to a for loop. |
Boolean Operator | +1 | Every boolean operator (and, or) adds a decision point. |
Cyclomatic complexity is too high in function handleOrnaments. (14) Open
def handleOrnaments(tags, attrs, content, piece, data):
if "ornaments" in tags:
if tags[-1] == "inverted-mordent":
data["note"].addNotation(Ornaments.InvertedMordent())
if tags[-1] == "mordent":
- Read upRead up
- Exclude checks
Cyclomatic Complexity
Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.
Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:
Construct | Effect on CC | Reasoning |
---|---|---|
if | +1 | An if statement is a single decision. |
elif | +1 | The elif statement adds another decision. |
else | +0 | The else statement does not cause a new decision. The decision is at the if. |
for | +1 | There is a decision at the start of the loop. |
while | +1 | There is a decision at the while statement. |
except | +1 | Each except branch adds a new conditional path of execution. |
finally | +0 | The finally block is unconditionally executed. |
with | +1 | The with statement roughly corresponds to a try/except block (see PEP 343 for details). |
assert | +1 | The assert statement internally roughly equals a conditional statement. |
Comprehension | +1 | A list/set/dict comprehension of generator expression is equivalent to a for loop. |
Boolean Operator | +1 | Every boolean operator (and, or) adds a decision point. |
Function handleTimeMod
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def handleTimeMod(tags, attrs, chars, piece, data):
if "notations" in tags:
if tags[-1] == "tuplet":
type = None
bracket = 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
Cyclomatic complexity is too high in function CheckDynamics. (12) Open
def CheckDynamics(tag):
return_val = False
dmark = ["p", "f"]
if len(tag) == 1 and tag in dmark:
return_val = True
- Read upRead up
- Exclude checks
Cyclomatic Complexity
Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.
Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:
Construct | Effect on CC | Reasoning |
---|---|---|
if | +1 | An if statement is a single decision. |
elif | +1 | The elif statement adds another decision. |
else | +0 | The else statement does not cause a new decision. The decision is at the if. |
for | +1 | There is a decision at the start of the loop. |
while | +1 | There is a decision at the while statement. |
except | +1 | Each except branch adds a new conditional path of execution. |
finally | +0 | The finally block is unconditionally executed. |
with | +1 | The with statement roughly corresponds to a try/except block (see PEP 343 for details). |
assert | +1 | The assert statement internally roughly equals a conditional statement. |
Comprehension | +1 | A list/set/dict comprehension of generator expression is equivalent to a for loop. |
Boolean Operator | +1 | Every boolean operator (and, or) adds a decision point. |
Cyclomatic complexity is too high in function HandlePitch. (12) Open
def HandlePitch(tags, attrs, text, piece, data):
return_val = None
if len(tags) > 0:
if "pitch" or "unpitched" in tags:
if not hasattr(data["note"], "pitch") and data["note"] is not None:
- Read upRead up
- Exclude checks
Cyclomatic Complexity
Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.
Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:
Construct | Effect on CC | Reasoning |
---|---|---|
if | +1 | An if statement is a single decision. |
elif | +1 | The elif statement adds another decision. |
else | +0 | The else statement does not cause a new decision. The decision is at the if. |
for | +1 | There is a decision at the start of the loop. |
while | +1 | There is a decision at the while statement. |
except | +1 | Each except branch adds a new conditional path of execution. |
finally | +0 | The finally block is unconditionally executed. |
with | +1 | The with statement roughly corresponds to a try/except block (see PEP 343 for details). |
assert | +1 | The assert statement internally roughly equals a conditional statement. |
Comprehension | +1 | A list/set/dict comprehension of generator expression is equivalent to a for loop. |
Boolean Operator | +1 | Every boolean operator (and, or) adds a decision point. |
Function CheckDynamics
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def CheckDynamics(tag):
return_val = False
dmark = ["p", "f"]
if len(tag) == 1 and tag in dmark:
return_val = 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 HandleArpeggiates
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def HandleArpeggiates(tags, attrs, content, piece, data):
if len(tags) > 0:
if tags[-1] == "arpeggiate":
data["direction"] = None
if "arpeggiate" 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
Cyclomatic complexity is too high in function handleTimeMod. (10) Open
def handleTimeMod(tags, attrs, chars, piece, data):
if "notations" in tags:
if tags[-1] == "tuplet":
type = None
bracket = None
- Read upRead up
- Exclude checks
Cyclomatic Complexity
Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.
Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:
Construct | Effect on CC | Reasoning |
---|---|---|
if | +1 | An if statement is a single decision. |
elif | +1 | The elif statement adds another decision. |
else | +0 | The else statement does not cause a new decision. The decision is at the if. |
for | +1 | There is a decision at the start of the loop. |
while | +1 | There is a decision at the while statement. |
except | +1 | Each except branch adds a new conditional path of execution. |
finally | +0 | The finally block is unconditionally executed. |
with | +1 | The with statement roughly corresponds to a try/except block (see PEP 343 for details). |
assert | +1 | The assert statement internally roughly equals a conditional statement. |
Comprehension | +1 | A list/set/dict comprehension of generator expression is equivalent to a for loop. |
Boolean Operator | +1 | Every boolean operator (and, or) adds a decision point. |
Cyclomatic complexity is too high in function HandleSlidesAndGliss. (9) Open
def HandleSlidesAndGliss(tags, attrs, content, piece, data):
type = None
number = None
lineType = None
if "slide" in tags or "glissando" in tags:
- Read upRead up
- Exclude checks
Cyclomatic Complexity
Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.
Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:
Construct | Effect on CC | Reasoning |
---|---|---|
if | +1 | An if statement is a single decision. |
elif | +1 | The elif statement adds another decision. |
else | +0 | The else statement does not cause a new decision. The decision is at the if. |
for | +1 | There is a decision at the start of the loop. |
while | +1 | There is a decision at the while statement. |
except | +1 | Each except branch adds a new conditional path of execution. |
finally | +0 | The finally block is unconditionally executed. |
with | +1 | The with statement roughly corresponds to a try/except block (see PEP 343 for details). |
assert | +1 | The assert statement internally roughly equals a conditional statement. |
Comprehension | +1 | A list/set/dict comprehension of generator expression is equivalent to a for loop. |
Boolean Operator | +1 | Every boolean operator (and, or) adds a decision point. |
Cyclomatic complexity is too high in method CopyNote. (9) Open
def CopyNote(self, part, measure_id, new_note):
'''
handles copying the latest note into the measure note list.
done at end of note loading to make sure staff_id is right as staff id could be encountered
any point during the note tag
- Read upRead up
- Exclude checks
Cyclomatic Complexity
Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.
Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:
Construct | Effect on CC | Reasoning |
---|---|---|
if | +1 | An if statement is a single decision. |
elif | +1 | The elif statement adds another decision. |
else | +0 | The else statement does not cause a new decision. The decision is at the if. |
for | +1 | There is a decision at the start of the loop. |
while | +1 | There is a decision at the while statement. |
except | +1 | Each except branch adds a new conditional path of execution. |
finally | +0 | The finally block is unconditionally executed. |
with | +1 | The with statement roughly corresponds to a try/except block (see PEP 343 for details). |
assert | +1 | The assert statement internally roughly equals a conditional statement. |
Comprehension | +1 | A list/set/dict comprehension of generator expression is equivalent to a for loop. |
Boolean Operator | +1 | Every boolean operator (and, or) adds a decision point. |
Cyclomatic complexity is too high in function HandleMovementBetweenDurations. (8) Open
def HandleMovementBetweenDurations(tags, attrs, chars, piece, data):
global last_note
measure_id = IdAsInt(helpers.GetID(attrs, "measure", "number"))
part_id = helpers.GetID(attrs, "part", "id")
- Read upRead up
- Exclude checks
Cyclomatic Complexity
Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.
Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:
Construct | Effect on CC | Reasoning |
---|---|---|
if | +1 | An if statement is a single decision. |
elif | +1 | The elif statement adds another decision. |
else | +0 | The else statement does not cause a new decision. The decision is at the if. |
for | +1 | There is a decision at the start of the loop. |
while | +1 | There is a decision at the while statement. |
except | +1 | Each except branch adds a new conditional path of execution. |
finally | +0 | The finally block is unconditionally executed. |
with | +1 | The with statement roughly corresponds to a try/except block (see PEP 343 for details). |
assert | +1 | The assert statement internally roughly equals a conditional statement. |
Comprehension | +1 | A list/set/dict comprehension of generator expression is equivalent to a for loop. |
Boolean Operator | +1 | Every boolean operator (and, or) adds a decision point. |
Cyclomatic complexity is too high in function handleLyrics. (8) Open
def handleLyrics(tags, attrs, chars, piece, data):
if "lyric" in tags:
if not hasattr(data["note"], "lyrics"):
data["note"].lyrics = {}
number = len(data["note"].lyrics)
- Read upRead up
- Exclude checks
Cyclomatic Complexity
Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.
Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:
Construct | Effect on CC | Reasoning |
---|---|---|
if | +1 | An if statement is a single decision. |
elif | +1 | The elif statement adds another decision. |
else | +0 | The else statement does not cause a new decision. The decision is at the if. |
for | +1 | There is a decision at the start of the loop. |
while | +1 | There is a decision at the while statement. |
except | +1 | Each except branch adds a new conditional path of execution. |
finally | +0 | The finally block is unconditionally executed. |
with | +1 | The with statement roughly corresponds to a try/except block (see PEP 343 for details). |
assert | +1 | The assert statement internally roughly equals a conditional statement. |
Comprehension | +1 | A list/set/dict comprehension of generator expression is equivalent to a for loop. |
Boolean Operator | +1 | Every boolean operator (and, or) adds a decision point. |
Cyclomatic complexity is too high in method StartTag. (8) Open
def StartTag(self, name, attrs):
'''
A method which is called by the SAX parser when a new tag is encountered
:param name: name of the tag
:param attrs: the tag's attributes
- Read upRead up
- Exclude checks
Cyclomatic Complexity
Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.
Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:
Construct | Effect on CC | Reasoning |
---|---|---|
if | +1 | An if statement is a single decision. |
elif | +1 | The elif statement adds another decision. |
else | +0 | The else statement does not cause a new decision. The decision is at the if. |
for | +1 | There is a decision at the start of the loop. |
while | +1 | There is a decision at the while statement. |
except | +1 | Each except branch adds a new conditional path of execution. |
finally | +0 | The finally block is unconditionally executed. |
with | +1 | The with statement roughly corresponds to a try/except block (see PEP 343 for details). |
assert | +1 | The assert statement internally roughly equals a conditional statement. |
Comprehension | +1 | A list/set/dict comprehension of generator expression is equivalent to a for loop. |
Boolean Operator | +1 | Every boolean operator (and, or) adds a decision point. |
Cyclomatic complexity is too high in function HandleArpeggiates. (8) Open
def HandleArpeggiates(tags, attrs, content, piece, data):
if len(tags) > 0:
if tags[-1] == "arpeggiate":
data["direction"] = None
if "arpeggiate" in attrs:
- Read upRead up
- Exclude checks
Cyclomatic Complexity
Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.
Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:
Construct | Effect on CC | Reasoning |
---|---|---|
if | +1 | An if statement is a single decision. |
elif | +1 | The elif statement adds another decision. |
else | +0 | The else statement does not cause a new decision. The decision is at the if. |
for | +1 | There is a decision at the start of the loop. |
while | +1 | There is a decision at the while statement. |
except | +1 | Each except branch adds a new conditional path of execution. |
finally | +0 | The finally block is unconditionally executed. |
with | +1 | The with statement roughly corresponds to a try/except block (see PEP 343 for details). |
assert | +1 | The assert statement internally roughly equals a conditional statement. |
Comprehension | +1 | A list/set/dict comprehension of generator expression is equivalent to a for loop. |
Boolean Operator | +1 | Every boolean operator (and, or) adds a decision point. |
Cyclomatic complexity is too high in method NewData. (8) Open
def NewData(self, text):
'''
Method which is called by the SAX parser upon encountering text inside a tag
:param text: the text encountered
:return: None, has side effects modifying the class itself
- Read upRead up
- Exclude checks
Cyclomatic Complexity
Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.
Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:
Construct | Effect on CC | Reasoning |
---|---|---|
if | +1 | An if statement is a single decision. |
elif | +1 | The elif statement adds another decision. |
else | +0 | The else statement does not cause a new decision. The decision is at the if. |
for | +1 | There is a decision at the start of the loop. |
while | +1 | There is a decision at the while statement. |
except | +1 | Each except branch adds a new conditional path of execution. |
finally | +0 | The finally block is unconditionally executed. |
with | +1 | The with statement roughly corresponds to a try/except block (see PEP 343 for details). |
assert | +1 | The assert statement internally roughly equals a conditional statement. |
Comprehension | +1 | A list/set/dict comprehension of generator expression is equivalent to a for loop. |
Boolean Operator | +1 | Every boolean operator (and, or) adds a decision point. |
Cyclomatic complexity is too high in class MxmlParser. (7) Open
class MxmlParser(object):
"""
This class encases a standard XML SAX parser in order to parse MusicXML into a tree of objects. Only one is needed for any parse job
and it can be reused for multiple files.
- Read upRead up
- Exclude checks
Cyclomatic Complexity
Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.
Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:
Construct | Effect on CC | Reasoning |
---|---|---|
if | +1 | An if statement is a single decision. |
elif | +1 | The elif statement adds another decision. |
else | +0 | The else statement does not cause a new decision. The decision is at the if. |
for | +1 | There is a decision at the start of the loop. |
while | +1 | There is a decision at the while statement. |
except | +1 | Each except branch adds a new conditional path of execution. |
finally | +0 | The finally block is unconditionally executed. |
with | +1 | The with statement roughly corresponds to a try/except block (see PEP 343 for details). |
assert | +1 | The assert statement internally roughly equals a conditional statement. |
Comprehension | +1 | A list/set/dict comprehension of generator expression is equivalent to a for loop. |
Boolean Operator | +1 | Every boolean operator (and, or) adds a decision point. |
Function HandleSlidesAndGliss
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def HandleSlidesAndGliss(tags, attrs, content, piece, data):
type = None
number = None
lineType = None
if "slide" in tags or "glissando" in tags:
- 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
Cyclomatic complexity is too high in function HandleNoteheads. (6) Open
def HandleNoteheads(tags, attrs, content, piece, data):
if "note" in tags:
if tags[-1] == "notehead":
data["note"].notehead = Note.Notehead()
if "notehead" in attrs:
- Read upRead up
- Exclude checks
Cyclomatic Complexity
Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.
Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:
Construct | Effect on CC | Reasoning |
---|---|---|
if | +1 | An if statement is a single decision. |
elif | +1 | The elif statement adds another decision. |
else | +0 | The else statement does not cause a new decision. The decision is at the if. |
for | +1 | There is a decision at the start of the loop. |
while | +1 | There is a decision at the while statement. |
except | +1 | Each except branch adds a new conditional path of execution. |
finally | +0 | The finally block is unconditionally executed. |
with | +1 | The with statement roughly corresponds to a try/except block (see PEP 343 for details). |
assert | +1 | The assert statement internally roughly equals a conditional statement. |
Comprehension | +1 | A list/set/dict comprehension of generator expression is equivalent to a for loop. |
Boolean Operator | +1 | Every boolean operator (and, or) adds a decision point. |
Function handleLyrics
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def handleLyrics(tags, attrs, chars, piece, data):
if "lyric" in tags:
if not hasattr(data["note"], "lyrics"):
data["note"].lyrics = {}
number = len(data["note"].lyrics)
- 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 NewData
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def NewData(self, text):
'''
Method which is called by the SAX parser upon encountering text inside a tag
:param text: the text encountered
:return: None, has side effects modifying the class itself
- 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 HandleNoteheads
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def HandleNoteheads(tags, attrs, content, piece, data):
if "note" in tags:
if tags[-1] == "notehead":
data["note"].notehead = Note.Notehead()
if "notehead" 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
Function HandleMovementBetweenDurations
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def HandleMovementBetweenDurations(tags, attrs, chars, piece, data):
global last_note
measure_id = IdAsInt(helpers.GetID(attrs, "measure", "number"))
part_id = helpers.GetID(attrs, "part", "id")
- 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 ResetHandler
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def ResetHandler(self, name):
'''
Method which assigns handler to the tag encountered before the current, or else
sets it to 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 CopyNote
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def CopyNote(self, part, measure_id, new_note):
'''
handles copying the latest note into the measure note list.
done at end of note loading to make sure staff_id is right as staff id could be encountered
any point during the note tag
- 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 StartTag
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def StartTag(self, name, attrs):
'''
A method which is called by the SAX parser when a new tag is encountered
:param name: name of the tag
:param attrs: the tag's attributes
- 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["handleType"] == "rights":
if not hasattr(piece.GetItem().meta, "copyright"):
piece.GetItem().meta.copyright = text
else:
if text.replace(
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 "strong-accent" in attrs:
if "type" in attrs["strong-accent"]:
s_type = attrs["strong-accent"]["type"]
accent = Mark.StrongAccent(type=s_type)
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 "root-alter" in content:
root.alter = content["root-alter"]
Avoid deeply nested control flow statements. Open
if "fingering" in tag and "fingering" in content:
data["frame_note"].fingering = content["fingering"]
handleBarline(tag, attrib, content, piece, data)
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
if "degree-value" in content:
data["degree"].value = content["degree-value"]
if "degree-alter" in tag:
Avoid deeply nested control flow statements. Open
if data["note"].Search(type(accent)) is None:
data["note"].addNotation(accent)
accent = None
Avoid deeply nested control flow statements. Open
if "fret" in tag and "fret" in content:
data["frame_note"].fret = content["fret"]
if "barre" in tag and "barre" 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 "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 "dacapo" in attrs["sound"]:
measure.dacapo = YesNoToBool(attrs["sound"]["dacapo"])
if "dalsegno" 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"]:
Avoid deeply nested control flow statements. Open
if "segno" in attrs["sound"]:
measure.segno = attrs["sound"]["segno"]
if "tocoda" in attrs["sound"]:
Avoid deeply nested control flow statements. Open
if measure is None:
part.addEmptyMeasure(measure_id, data["staff_id"])
measure = part.getMeasure(measure_id, data["staff_id"])
if measure is not None:
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 "parentheses" in attrs["metronome"]:
data["direction"].parentheses = YesNoToBool(
attrs["metronome"]["parentheses"])
if tags[-1] == "per-minute":
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 "root-step" in content:
root.step = content["root-step"]
if tag[-1] == "root-alter":
Avoid deeply nested control flow statements. Open
if "text" in attrib["kind"]:
kind.text = attrib["kind"]["text"]
if "halign" in attrib["kind"]:
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 "dalsegno" in attrs["sound"]:
measure.dalsegno = attrs["sound"]["dalsegno"]
if "fine" in attrs["sound"]:
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.newSystem = YesNoToBool(
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 not hasattr(piece.GetItem(), "meta"):
piece.GetItem().meta = Meta.Meta()
piece.GetItem().meta.AddCredit(credit)
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 "coda" in attrs["sound"]:
measure.coda = attrs["sound"]["coda"]
if "dacapo" in attrs["sound"]:
Avoid deeply nested control flow statements. Open
if "default-x" in temp:
x = float(temp["default-x"])
if "default-y" in temp:
Avoid deeply nested control flow statements. Open
if data["handleType"] == "page number":
if not hasattr(piece.GetItem().meta, "pageNum"):
piece.GetItem().meta.pageNum = True
data["handleType"] = ""
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-type" in attrib:
if "text" in attrib["degree-type"]:
data["degree"].display = attrib[
"degree-type"]["text"]
Avoid deeply nested control flow statements. Open
if part.getMeasure(measure_id, staff) is None:
part.addEmptyMeasure(measure_id, staff)
measure = part.getMeasure(
Avoid deeply nested control flow statements. Open
if hasattr(barline, "ending"):
position = -2
index = part.getMeasureIDAtPosition(
position,
staff=data["staff_id"])
Avoid deeply nested control flow statements. Open
if attrib["creator"]["type"] == "composer":
if "creator" in content:
composer = content["creator"]
if tag[-1] == "movement-title" or "creator":
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 "valign" in temp:
valign = temp["valign"]
if valign == "bottom" and data["handleType"] == "":
data["handleType"] = "rights"
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 "halign" in attrib["kind"]:
kind.halign = attrib["kind"]["halign"]
if "parenthesis-degrees" in attrib["kind"]:
Avoid deeply nested control flow statements. Open
if "degree-alter" in content:
data["degree"].alter = content["degree-alter"]
if "degree-type" in tag:
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 "parentheses" in attrs["metronome"]:
data["direction"].parentheses = YesNoToBool(
attrs["metronome"]["parentheses"])
if tags[-1] == "wedge":
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 "font-size" in attrs["metronome"]:
data["direction"].size = attrs[
"metronome"]["font-size"]
if "parentheses" in attrs["metronome"]:
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
if "default-y" in temp:
y = float(temp["default-y"])
if "font-size" in temp:
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 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 not hasattr(
data["direction"],
"beat") or data["direction"].beat is None:
data["direction"].beat = unit
else:
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 "tocoda" in attrs["sound"]:
measure.tocoda = attrs["sound"]["tocoda"]
Consider simplifying this complex logical expression. Open
if tag[-
2] == "technical" and tag[-
1] != "bend" and tag[-
1] != "hammer-on" and tag[-
1] != "pull-off":
Function HandleArpeggiates
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def HandleArpeggiates(tags, attrs, content, piece, data):
Function handleOtherNotations
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def handleOtherNotations(tag, attrs, content, piece, data):
Function HandleFermata
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def HandleFermata(tags, attrs, chars, piece, data):
Function handleTimeMod
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def handleTimeMod(tags, attrs, chars, piece, data):
Function handleClef
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def handleClef(tag, attrib, content, piece, data):
Function handleBarline
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def handleBarline(tag, attrib, content, piece, data):
Function CreateNote
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def CreateNote(tag, attrs, content, piece, data):
Function HandleMeasures
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def HandleMeasures(tag, attrib, content, piece, data):
Function handleLyrics
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def handleLyrics(tags, attrs, chars, piece, data):
Function HandleMovementBetweenDurations
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def HandleMovementBetweenDurations(tags, attrs, chars, piece, data):
Function HandleNoteheads
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def HandleNoteheads(tags, attrs, content, piece, data):
Function SetupFormat
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def SetupFormat(tags, attrs, text, piece, data):
Function HandleRepeatMarking
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def HandleRepeatMarking(tags, attrs, chars, piece, data):
Function SetupPiece
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def SetupPiece(tag, attrib, content, piece, data):
Function handleArticulation
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def handleArticulation(tag, attrs, content, piece, data):
Function HandleSlidesAndGliss
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def HandleSlidesAndGliss(tags, attrs, content, piece, data):
Function handleOrnaments
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def handleOrnaments(tags, attrs, content, piece, data):
Function UpdatePart
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def UpdatePart(tag, attrib, content, piece, data):
Function HandlePitch
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def HandlePitch(tags, attrs, text, piece, data):
Function HandleDirections
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def HandleDirections(tags, attrs, chars, piece, data):
Function validateData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validateData(self, text):
'''
Method which validates the data from each tag, to check whether it is an empty string
:param text: data to be validated
:return: True or False depending on the result
- 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
Line too long (123 > 79 characters) Open
'''not sure this is needed anymore, but tags which we shouldn't clear the previous data for should be added here'''
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (104 > 79 characters) Open
Exceptions.DrumNotImplementedException("Drum Tab notation found: stopping"))
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (82 > 79 characters) Open
"") not in piece.GetItem().meta.copyright.replace(
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (136 > 79 characters) Open
This class encases a standard XML SAX parser in order to parse MusicXML into a tree of objects. Only one is needed for any parse job
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (106 > 79 characters) Open
'''A dictionary holding data which needs to be tracked by the parser, but is specific to each piece'''
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (98 > 79 characters) Open
Exceptions.TabNotImplementedException("Tab notation found: stopping"))
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (98 > 79 characters) Open
Method which resets any variables held by this class, so that the parser can be used again
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (81 > 79 characters) Open
'''Indicator of whether the current thing being processed is a dynamic'''
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Block comment should start with '# ' Open
#part.AddBarline(measure=index, staff=staff_id, item=BarlinesAndMarkers.Barline(repeat="forward"), location="left")
- Read upRead up
- Exclude checks
Separate inline comments by at least two spaces.
An inline comment is a comment on the same line as a statement.
Inline comments should be separated by at least two spaces from the
statement. They should start with a # and a single space.
Each line of a block comment starts with a # and a single space
(unless it is indented text inside the comment).
Okay: x = x + 1 # Increment x
Okay: x = x + 1 # Increment x
Okay: # Block comment
E261: x = x + 1 # Increment x
E262: x = x + 1 #Increment x
E262: x = x + 1 # Increment x
E265: #Block comment
E266: ### Block comment
Line too long (83 > 79 characters) Open
copy.deepcopy(self.data["expression"]), self.data["voice"])
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (109 > 79 characters) Open
1] != "pull-off":
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (123 > 79 characters) Open
'''this will be put in later, but parser can take in tags we want to ignore, e.g clefs, BarlinesAndMarkerss etc.'''
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (100 > 79 characters) Open
done at end of note loading to make sure staff_id is right as staff id could be encountered
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (93 > 79 characters) Open
1] != "hammer-on" and tag[-
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (82 > 79 characters) Open
copy.deepcopy(self.data["direction"]), self.data["voice"])
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (80 > 79 characters) Open
elif len(tag) >= 3 and tag[-3] == "technical" and tag[-2] == "bend":
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (92 > 79 characters) Open
Method which takes in either yes or no and converts it to bool. Often found in MusicXML.
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Do not use bare 'except' Open
except:
- Read upRead up
- Exclude checks
When catching exceptions, mention specific exceptions when possible.
Okay: except Exception:
Okay: except BaseException:
E722: except:
Line too long (141 > 79 characters) Open
borrowed from: http://stackoverflow.com/questions/2262333/is-there-a-built-in-or-more-pythonic-way-to-try-to-parse-a-string-to-an-integer
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (99 > 79 characters) Open
Exceptions.NoScorePartException("ERROR IN UPDATEPART: no score-part id found"))
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (97 > 79 characters) Open
''' the method which will handle the current tag, and the data currently in the class '''
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (92 > 79 characters) Open
if self.handler is not None and not self.isDynamic and name not in self.closed_tags:
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (115 > 79 characters) Open
- excluded - a list of tags which the parser should ignore. functionality of this is not currently implemented.
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Do not use bare 'except' Open
except:
- Read upRead up
- Exclude checks
When catching exceptions, mention specific exceptions when possible.
Okay: except Exception:
Okay: except BaseException:
E722: except:
Line too long (92 > 79 characters) Open
new_note, "BarlinesAndMarkersRest") and new_note.BarlinesAndMarkersRest:
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (102 > 79 characters) Open
# stuff for parsing. Tags refers to the xml tag list, chars refers to the content of each tag,
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (81 > 79 characters) Open
"") not in piece.GetItem().meta.composer.replace(
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (143 > 79 characters) Open
#part.AddBarline(measure=index, staff=staff_id, item=BarlinesAndMarkers.Barline(repeat="forward"), location="left")
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (93 > 79 characters) Open
Method which validates the data from each tag, to check whether it is an empty string
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (87 > 79 characters) Open
Method which assigns handler to the tag encountered before the current, or else
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (109 > 79 characters) Open
from MuseParse.classes.ObjectHierarchy.ItemClasses import Directions, Key, BarlinesAndMarkers, Clef, Meter, \
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (80 > 79 characters) Open
A method which is called by the SAX parser when a new tag is encountered
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Line too long (84 > 79 characters) Open
Method which is called by the SAX parser upon encountering text inside a tag
- Read upRead up
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.