Godley/MuseParse

View on GitHub

Showing 691 of 691 total issues

Avoid too many return statements within this function.
Open

                    return node
Severity: Major
Found in MuseParse/classes/ObjectHierarchy/TreeClasses/BaseTree.py - About 30 mins to fix

    Function PositionChild has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def PositionChild(self, item, key, voice=1):
            voice_obj = self.getVoice(voice)
            children = voice_obj.GetChildrenIndexes()
            if key in children:
                start_index = key
    Severity: Minor
    Found in MuseParse/classes/ObjectHierarchy/TreeClasses/MeasureNode.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

    Function CheckDivisions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def CheckDivisions(self):
            children = self.GetChildrenIndexes()
            divisions = self.divisions
            for child in children:
                voice = self.GetChild(child)
    Severity: Minor
    Found in MuseParse/classes/ObjectHierarchy/TreeClasses/MeasureNode.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

    Function addKey has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def addKey(self, item, voice=1):
            if not hasattr(self, "key"):
                self.key = item
            else:
                if self.GetChild(voice) is None:
    Severity: Minor
    Found in MuseParse/classes/ObjectHierarchy/TreeClasses/MeasureNode.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

    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

    Function __init__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(self, **kwargs):
            text = None
            size = None
            font = None
            if "placement" in kwargs:
    Severity: Minor
    Found in MuseParse/classes/ObjectHierarchy/ItemClasses/Directions.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

    Function __init__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(
                self,
                piece_obj,
                fname,
                lyscript=""):
    Severity: Minor
    Found in MuseParse/classes/Output/LilypondOutput.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

    Function __init__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(self, **kwargs):
            placement = None
            size = None
            font = None
            if "size" in kwargs:
    Severity: Minor
    Found in MuseParse/classes/ObjectHierarchy/ItemClasses/Directions.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

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

        def toLily(self):
            var = "\\arpeggio"
            if not hasattr(self, "direction") or self.direction is None:
                var += "Normal"
            else:
    Severity: Minor
    Found in MuseParse/classes/ObjectHierarchy/ItemClasses/Note.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

    Function __init__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(self, **kwargs):
            if "type" in kwargs:
                if kwargs["type"] is not None:
                    self.type = kwargs["type"]
            if "bracket" in kwargs:
    Severity: Minor
    Found in MuseParse/classes/ObjectHierarchy/ItemClasses/Note.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

    Invalid escape sequence '\c'
    Open

            lstring = "\\markup { \n\r \column { "
    Severity: Minor
    Found in MuseParse/helpers.py by pep8

    Invalid escape sequences are deprecated in Python 3.6.

    Okay: regex = r'\.png$'
    W605: regex = '\.png$'

    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 (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 (126 > 79 characters)
    Open

        """same as node, except the children section have their own indexes. to be used in nodes like Piece and Part, as both have

    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 (121 > 79 characters)
    Open

            method to use when adding a clef. will either add it to the node itself or add it onto the first voice's children

    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

            Method which converts the object instance and its attributes to a string of lilypond code

    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 (86 > 79 characters)
    Open

                    len(string_list)) if string_list[i] == "\r" or string_list[i] == "\n"]
    Severity: Minor
    Found in MuseParse/helpers.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

            Method which converts the object instance and its attributes to a string of lilypond code

    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 (89 > 79 characters)
    Open

        handy method which pulls out a nested id: attrs refers to a dictionary holding the id
    Severity: Minor
    Found in MuseParse/helpers.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.
    Severity
    Category
    Status
    Source
    Language