Godley/MuseParse

View on GitHub

Showing 228 of 691 total issues

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 UpdateArpeggiates has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    def UpdateArpeggiates(self, type="start"):
        '''
        method which searches for all arpeggiates and updates the top one of each chord to be a start,
        and the bottom one to be a stop ready for lilypond output
        :param type:
Severity: Minor
Found in MuseParse/classes/ObjectHierarchy/TreeClasses/NoteNode.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 toLily has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    def toLily(self):
        val = "\key"
        if hasattr(self, "fifths"):
            if hasattr(self, "mode"):
                keyname = ""
Severity: Minor
Found in MuseParse/classes/ObjectHierarchy/ItemClasses/Key.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 AttachDirection has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    def AttachDirection(self, item):
        if item.GetItem().__class__.__name__ == OctaveShift.__name__:
            self.shift = True
        if len(self.children) == 0:
            self.AttachExpression(OtherNodes.ExpressionNode())
Severity: Minor
Found in MuseParse/classes/ObjectHierarchy/TreeClasses/NoteNode.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

Function toLily has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    def toLily(self):
        lilystring = ""
        if not hasattr(self, "ending") and not hasattr(self, "repeat"):
            lilystring += " \\bar \""
            if hasattr(self, "style"):
Severity: Minor
Found in MuseParse/classes/ObjectHierarchy/ItemClasses/BarlinesAndMarkers.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 getPartialLength has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    def getPartialLength(self):
        """ method to calculate how much to give the "partial" indicator where a measure is a pickup
        :return: str which is the lilypond bar length
        """
        indexes = self.GetChildrenIndexes()
Severity: Minor
Found in MuseParse/classes/ObjectHierarchy/TreeClasses/MeasureNode.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 FindPosition has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

def FindPosition(node, addition, index=0):
    '''
    Method to search for children according to their position in list. Similar functionality to above method,
    except this is for adding items to the tree according to the nodes limits on children or types of children they can have
    :param node: current node being searched
Severity: Minor
Found in MuseParse/classes/ObjectHierarchy/TreeClasses/BaseTree.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

Function addNotation has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    def addNotation(self, obj):
        '''
        Method to add new notation. Use this rather than adding directly so new classes can be added automatically
        without needing to know which list to add it to in the main code.
        :param obj: the object to add
Severity: Minor
Found in MuseParse/classes/ObjectHierarchy/ItemClasses/Note.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

Function toLily has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    def toLily(self):
        '''
        Method which converts the object instance, its attributes and children to a string of lilypond code

        :return: str of lilypond code
Severity: Minor
Found in MuseParse/classes/ObjectHierarchy/TreeClasses/NoteNode.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

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

Function handleGroups has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    def handleGroups(self):
        lilystring = ""
        ids_loaded = []
        groupings = []
        group_ids = sorted(
Severity: Minor
Found in MuseParse/classes/ObjectHierarchy/TreeClasses/PieceTree.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

Function addDirection has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    def addDirection(self, item, voice=1):
        wrappers = [Directions.Bracket.__name__]
        if item.__class__.__name__ in wrappers and (
            not hasattr(
                item,
Severity: Minor
Found in MuseParse/classes/ObjectHierarchy/TreeClasses/MeasureNode.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

Function toLily has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    def toLily(self):
        '''
        Method which converts the object instance, its attributes and children to a string of lilypond code

        :return: str of lilypond code
Severity: Minor
Found in MuseParse/classes/ObjectHierarchy/TreeClasses/VoiceNode.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

Function Search has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    def Search(self, cls_type, list_id=-1):
        '''
        Method which looks for a particular class type in a particular list
        :param cls_type: the type of object to find
        :param list_id: the list it resides in
Severity: Minor
Found in MuseParse/classes/ObjectHierarchy/ItemClasses/Note.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

Function toLily has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    def toLily(self):
        val = Notation.toLily(self)
        if hasattr(self, "type"):
            if self.type != "fingering" and self.type != "pluck" and self.type != "string":
                splitter = self.type.split("-")
Severity: Minor
Found in MuseParse/classes/ObjectHierarchy/ItemClasses/Mark.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

MeasureNode has 27 functions (exceeds 20 allowed). Consider refactoring.
Open

class MeasureNode(IndexedNode):

    """
    Class representing the tree node for a measure.

Severity: Minor
Found in MuseParse/classes/ObjectHierarchy/TreeClasses/MeasureNode.py - About 3 hrs to fix

    Function SplitString has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

    def SplitString(value):
        """simple method that puts in spaces every 10 characters"""
        string_length = len(value)
        chunks = int(string_length / 10)
        string_list = list(value)
    Severity: Minor
    Found in MuseParse/helpers.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

    Function toLily has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        def toLily(self):
            val = ""
            val += "^\markup {\n\r\\fret-diagram #\""
            if hasattr(self, "frets"):
                val += "h:" + str(self.frets) + ";"
    Severity: Minor
    Found in MuseParse/classes/ObjectHierarchy/ItemClasses/Harmony.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

    Function toLily has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        def toLily(self):
            val = "\chords {"
            if hasattr(self, "root"):
                val += "\n\r" + self.root
            if hasattr(
    Severity: Minor
    Found in MuseParse/classes/ObjectHierarchy/ItemClasses/Harmony.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

    Severity
    Category
    Status
    Source
    Language