Godley/MuseParse

View on GitHub
MuseParse/classes/Input/MxmlParser.py

Summary

Maintainability
F
1 mo
Test Coverage

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
Severity: Minor
Found in MuseParse/classes/Input/MxmlParser.py - About 1 wk to fix

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
Severity: Minor
Found in MuseParse/classes/Input/MxmlParser.py - About 4 days to fix

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
Severity: Minor
Found in MuseParse/classes/Input/MxmlParser.py - About 4 days to fix

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, \
Severity: Major
Found in MuseParse/classes/Input/MxmlParser.py - About 3 days to fix

    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
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py by radon

    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.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    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
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py - About 1 day to fix

    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
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py by radon

    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.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    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:
    
    
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py - About 1 day to fix

    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
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py by radon

    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.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    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
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py - About 1 day to fix

    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"])
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py - About 7 hrs to fix

    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
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py - About 7 hrs to fix

    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
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py - About 7 hrs to fix

    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"))
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py - About 6 hrs to fix

    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:
    
    
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py by radon

    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.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    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
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py by radon

    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.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    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
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py by radon

    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.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    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":
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py - About 4 hrs to fix

    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:
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py - About 4 hrs to fix

    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
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py by radon

    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.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    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":
    
    
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py - About 3 hrs to fix

    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":
    
    
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py by radon

    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.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    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"])
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py by radon

    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.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    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"))
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py by radon

    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.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    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
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py by radon

    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.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    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":
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py by radon

    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.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    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
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py - About 2 hrs to fix

    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
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py by radon

    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.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    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:
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py by radon

    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.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    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
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py - About 2 hrs to fix

    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:
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py - About 2 hrs to fix

    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
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py by radon

    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.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    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:
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py by radon

    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.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    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
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py by radon

    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.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    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")
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py by radon

    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.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    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)
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py by radon

    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.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    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
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py by radon

    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.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    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:
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py by radon

    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.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    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
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py by radon

    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.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    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.
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py by radon

    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.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    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:
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py - About 1 hr to fix

    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:
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py by radon

    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.

    Source: http://radon.readthedocs.org/en/latest/intro.html

    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)
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py - About 1 hr to fix

    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
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py - About 1 hr to fix

    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:
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py - About 1 hr to fix

    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")
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py - About 1 hr to fix

    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
    
    
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py - About 1 hr to fix

    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
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py - About 1 hr to fix

    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
    Severity: Minor
    Found in MuseParse/classes/Input/MxmlParser.py - About 1 hr to fix

    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(
    Severity: Major
    Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

      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"]:
      Severity: Major
      Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

        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)
        Severity: Major
        Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

          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(
          Severity: Major
          Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if "root-alter" in content:
                                    root.alter = content["root-alter"]
            
            
            Severity: Major
            Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

              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)
              Severity: Major
              Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                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"] == "":
                Severity: Major
                Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if "degree-value" in content:
                                          data["degree"].value = content["degree-value"]
                                  if "degree-alter" in tag:
                  Severity: Major
                  Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        if data["note"].Search(type(accent)) is None:
                                            data["note"].addNotation(accent)
                                        accent = None
                    Severity: Major
                    Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                      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:
                      Severity: Major
                      Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                        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:
                        Severity: Major
                        Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                          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"]:
                          Severity: Major
                          Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                if "dacapo" in attrs["sound"]:
                                                    measure.dacapo = YesNoToBool(attrs["sound"]["dacapo"])
                                                if "dalsegno" in attrs["sound"]:
                            Severity: Major
                            Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                  if "fine" in attrs["sound"]:
                                                      measure.fine = YesNoToBool(attrs["sound"]["fine"])
                                                  if "segno" in attrs["sound"]:
                              Severity: Major
                              Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                    if "segno" in attrs["sound"]:
                                                        measure.segno = attrs["sound"]["segno"]
                                                    if "tocoda" in attrs["sound"]:
                                Severity: Major
                                Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                  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:
                                  Severity: Major
                                  Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                        if "degree-type" in content:
                                                            data["degree"].type = content["degree-type"]
                                                        if "degree-type" in attrib:
                                    Severity: Major
                                    Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                          if "parentheses" in attrs["metronome"]:
                                                              data["direction"].parentheses = YesNoToBool(
                                                                  attrs["metronome"]["parentheses"])
                                                  if tags[-1] == "per-minute":
                                      Severity: Major
                                      Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                        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"]:
                                        Severity: Major
                                        Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                              if "root-step" in content:
                                                                  root.step = content["root-step"]
                                                          if tag[-1] == "root-alter":
                                          Severity: Major
                                          Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                                if "text" in attrib["kind"]:
                                                                    kind.text = attrib["kind"]["text"]
                                                                if "halign" in attrib["kind"]:
                                            Severity: Major
                                            Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                              Avoid deeply nested control flow statements.
                                              Open

                                                                  if not hasattr(piece.GetItem().meta, "copyright"):
                                                                      piece.GetItem().meta.copyright = ""
                                                                  piece.GetItem().meta.copyright += rights
                                              Severity: Major
                                              Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                                    if "dalsegno" in attrs["sound"]:
                                                                        measure.dalsegno = attrs["sound"]["dalsegno"]
                                                                    if "fine" in attrs["sound"]:
                                                Severity: Major
                                                Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                  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(
                                                  Severity: Major
                                                  Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                    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:
                                                    Severity: Major
                                                    Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                      Avoid deeply nested control flow statements.
                                                      Open

                                                                          if not hasattr(piece.GetItem(), "meta"):
                                                                              piece.GetItem().meta = Meta.Meta()
                                                                          piece.GetItem().meta.AddCredit(credit)
                                                      Severity: Major
                                                      Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                        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:
                                                        Severity: Major
                                                        Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                          Avoid deeply nested control flow statements.
                                                          Open

                                                                              if "coda" in attrs["sound"]:
                                                                                  measure.coda = attrs["sound"]["coda"]
                                                                              if "dacapo" in attrs["sound"]:
                                                          Severity: Major
                                                          Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                            Avoid deeply nested control flow statements.
                                                            Open

                                                                                if "default-x" in temp:
                                                                                    x = float(temp["default-x"])
                                                                                if "default-y" in temp:
                                                            Severity: Major
                                                            Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                              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"] = ""
                                                              Severity: Major
                                                              Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                                Avoid deeply nested control flow statements.
                                                                Open

                                                                                    if "parenthesis-degrees" in attrib["kind"]:
                                                                                        kind.parenthesis = attrib[
                                                                                            "kind"]["parenthesis-degrees"]
                                                                
                                                                
                                                                Severity: Major
                                                                Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                                  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"]
                                                                  
                                                                  
                                                                  Severity: Major
                                                                  Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                                    Avoid deeply nested control flow statements.
                                                                    Open

                                                                                        if part.getMeasure(measure_id, staff) is None:
                                                                                            part.addEmptyMeasure(measure_id, staff)
                                                                                measure = part.getMeasure(
                                                                    Severity: Major
                                                                    Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                                      Avoid deeply nested control flow statements.
                                                                      Open

                                                                                          if hasattr(barline, "ending"):
                                                                                              position = -2
                                                                                              index = part.getMeasureIDAtPosition(
                                                                                                  position,
                                                                                                  staff=data["staff_id"])
                                                                      Severity: Major
                                                                      Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                                        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":
                                                                        Severity: Major
                                                                        Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                                          Avoid deeply nested control flow statements.
                                                                          Open

                                                                                              if "font-size" in temp:
                                                                                                  size = float(temp["font-size"])
                                                                                              if "justify" in temp:
                                                                          Severity: Major
                                                                          Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                                            Avoid deeply nested control flow statements.
                                                                            Open

                                                                                                if "valign" in temp:
                                                                                                    valign = temp["valign"]
                                                                                                    if valign == "bottom" and data["handleType"] == "":
                                                                                                        data["handleType"] = "rights"
                                                                            
                                                                            
                                                                            Severity: Major
                                                                            Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                                              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(
                                                                              Severity: Major
                                                                              Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                                                Avoid deeply nested control flow statements.
                                                                                Open

                                                                                                    if "halign" in attrib["kind"]:
                                                                                                        kind.halign = attrib["kind"]["halign"]
                                                                                                    if "parenthesis-degrees" in attrib["kind"]:
                                                                                Severity: Major
                                                                                Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                                                  Avoid deeply nested control flow statements.
                                                                                  Open

                                                                                                      if "degree-alter" in content:
                                                                                                          data["degree"].alter = content["degree-alter"]
                                                                                                  if "degree-type" in tag:
                                                                                  Severity: Major
                                                                                  Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                                                    Avoid deeply nested control flow statements.
                                                                                    Open

                                                                                                        if data["frame_note"] is None:
                                                                                                            data["frame_note"] = Harmony.FrameNote()
                                                                                    
                                                                                    
                                                                                    Severity: Major
                                                                                    Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                                                      Avoid deeply nested control flow statements.
                                                                                      Open

                                                                                                          if "parentheses" in attrs["metronome"]:
                                                                                                              data["direction"].parentheses = YesNoToBool(
                                                                                                                  attrs["metronome"]["parentheses"])
                                                                                              if tags[-1] == "wedge":
                                                                                      Severity: Major
                                                                                      Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                                                        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:
                                                                                        Severity: Major
                                                                                        Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                                                          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"]:
                                                                                          Severity: Major
                                                                                          Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                                                            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:
                                                                                            Severity: Minor
                                                                                            Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                                                            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:
                                                                                            Severity: Major
                                                                                            Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                                                              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"])
                                                                                              Severity: Major
                                                                                              Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                                                                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(",")
                                                                                                Severity: Major
                                                                                                Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                                                                  Avoid deeply nested control flow statements.
                                                                                                  Open

                                                                                                                      if not hasattr(
                                                                                                                              data["direction"],
                                                                                                                              "beat") or data["direction"].beat is None:
                                                                                                                          data["direction"].beat = unit
                                                                                                                      else:
                                                                                                  Severity: Major
                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                                                                    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(
                                                                                                    Severity: Major
                                                                                                    Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                                                                      Avoid deeply nested control flow statements.
                                                                                                      Open

                                                                                                                          if "tocoda" in attrs["sound"]:
                                                                                                                              measure.tocoda = attrs["sound"]["tocoda"]
                                                                                                      
                                                                                                      
                                                                                                      Severity: Major
                                                                                                      Found in MuseParse/classes/Input/MxmlParser.py - About 45 mins to fix

                                                                                                        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":
                                                                                                        Severity: Major
                                                                                                        Found in MuseParse/classes/Input/MxmlParser.py - About 40 mins to fix

                                                                                                          Function HandleArpeggiates has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                          Open

                                                                                                          def HandleArpeggiates(tags, attrs, content, piece, data):
                                                                                                          Severity: Minor
                                                                                                          Found in MuseParse/classes/Input/MxmlParser.py - About 35 mins to fix

                                                                                                            Function handleOtherNotations has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                            Open

                                                                                                            def handleOtherNotations(tag, attrs, content, piece, data):
                                                                                                            Severity: Minor
                                                                                                            Found in MuseParse/classes/Input/MxmlParser.py - About 35 mins to fix

                                                                                                              Function HandleFermata has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                              Open

                                                                                                              def HandleFermata(tags, attrs, chars, piece, data):
                                                                                                              Severity: Minor
                                                                                                              Found in MuseParse/classes/Input/MxmlParser.py - About 35 mins to fix

                                                                                                                Function handleTimeMod has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                Open

                                                                                                                def handleTimeMod(tags, attrs, chars, piece, data):
                                                                                                                Severity: Minor
                                                                                                                Found in MuseParse/classes/Input/MxmlParser.py - About 35 mins to fix

                                                                                                                  Function handleClef has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                  Open

                                                                                                                  def handleClef(tag, attrib, content, piece, data):
                                                                                                                  Severity: Minor
                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py - About 35 mins to fix

                                                                                                                    Function handleBarline has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                    Open

                                                                                                                    def handleBarline(tag, attrib, content, piece, data):
                                                                                                                    Severity: Minor
                                                                                                                    Found in MuseParse/classes/Input/MxmlParser.py - About 35 mins to fix

                                                                                                                      Function CreateNote has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                      Open

                                                                                                                      def CreateNote(tag, attrs, content, piece, data):
                                                                                                                      Severity: Minor
                                                                                                                      Found in MuseParse/classes/Input/MxmlParser.py - About 35 mins to fix

                                                                                                                        Function HandleMeasures has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                        Open

                                                                                                                        def HandleMeasures(tag, attrib, content, piece, data):
                                                                                                                        Severity: Minor
                                                                                                                        Found in MuseParse/classes/Input/MxmlParser.py - About 35 mins to fix

                                                                                                                          Function handleLyrics has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                          Open

                                                                                                                          def handleLyrics(tags, attrs, chars, piece, data):
                                                                                                                          Severity: Minor
                                                                                                                          Found in MuseParse/classes/Input/MxmlParser.py - About 35 mins to fix

                                                                                                                            Function HandleMovementBetweenDurations has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                            Open

                                                                                                                            def HandleMovementBetweenDurations(tags, attrs, chars, piece, data):
                                                                                                                            Severity: Minor
                                                                                                                            Found in MuseParse/classes/Input/MxmlParser.py - About 35 mins to fix

                                                                                                                              Function HandleNoteheads has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                              Open

                                                                                                                              def HandleNoteheads(tags, attrs, content, piece, data):
                                                                                                                              Severity: Minor
                                                                                                                              Found in MuseParse/classes/Input/MxmlParser.py - About 35 mins to fix

                                                                                                                                Function SetupFormat has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                Open

                                                                                                                                def SetupFormat(tags, attrs, text, piece, data):
                                                                                                                                Severity: Minor
                                                                                                                                Found in MuseParse/classes/Input/MxmlParser.py - About 35 mins to fix

                                                                                                                                  Function HandleRepeatMarking has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                  Open

                                                                                                                                  def HandleRepeatMarking(tags, attrs, chars, piece, data):
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py - About 35 mins to fix

                                                                                                                                    Function SetupPiece has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                    Open

                                                                                                                                    def SetupPiece(tag, attrib, content, piece, data):
                                                                                                                                    Severity: Minor
                                                                                                                                    Found in MuseParse/classes/Input/MxmlParser.py - About 35 mins to fix

                                                                                                                                      Function handleArticulation has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                      Open

                                                                                                                                      def handleArticulation(tag, attrs, content, piece, data):
                                                                                                                                      Severity: Minor
                                                                                                                                      Found in MuseParse/classes/Input/MxmlParser.py - About 35 mins to fix

                                                                                                                                        Function HandleSlidesAndGliss has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                        Open

                                                                                                                                        def HandleSlidesAndGliss(tags, attrs, content, piece, data):
                                                                                                                                        Severity: Minor
                                                                                                                                        Found in MuseParse/classes/Input/MxmlParser.py - About 35 mins to fix

                                                                                                                                          Function handleOrnaments has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                          Open

                                                                                                                                          def handleOrnaments(tags, attrs, content, piece, data):
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in MuseParse/classes/Input/MxmlParser.py - About 35 mins to fix

                                                                                                                                            Function UpdatePart has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                            Open

                                                                                                                                            def UpdatePart(tag, attrib, content, piece, data):
                                                                                                                                            Severity: Minor
                                                                                                                                            Found in MuseParse/classes/Input/MxmlParser.py - About 35 mins to fix

                                                                                                                                              Function HandlePitch has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                              Open

                                                                                                                                              def HandlePitch(tags, attrs, text, piece, data):
                                                                                                                                              Severity: Minor
                                                                                                                                              Found in MuseParse/classes/Input/MxmlParser.py - About 35 mins to fix

                                                                                                                                                Function HandleDirections has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                Open

                                                                                                                                                def HandleDirections(tags, attrs, chars, piece, data):
                                                                                                                                                Severity: Minor
                                                                                                                                                Found in MuseParse/classes/Input/MxmlParser.py - About 35 mins to fix

                                                                                                                                                  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
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py - About 25 mins to fix

                                                                                                                                                  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'''
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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"))
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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(
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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'''
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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"))
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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'''
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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")
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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"])
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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":
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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.'''
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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[-
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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"])
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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":
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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.
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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:
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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"))
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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 '''
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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:
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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.
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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:
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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:
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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,
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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(
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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")
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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, \
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in MuseParse/classes/Input/MxmlParser.py by pep8

                                                                                                                                                  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.

                                                                                                                                                  There are no issues that match your filters.

                                                                                                                                                  Category
                                                                                                                                                  Status