Godley/MuseParse

View on GitHub

Showing 228 of 691 total issues

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

          Avoid deeply nested control flow statements.
          Open

                                  if result is None:
                                      item.close_timemod = True
                                  if previous is not None:
          Severity: Major
          Found in MuseParse/classes/ObjectHierarchy/TreeClasses/VoiceNode.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if previous is not None:
                                        if hasattr(previous.GetItem(), "timeMod"):
                                            item.timeMod.first = False
                                        else:
                                            item.timeMod.first = True
            Severity: Major
            Found in MuseParse/classes/ObjectHierarchy/TreeClasses/VoiceNode.py - About 45 mins to fix

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

                  def __init__(self, **kwargs):
                      text = None
                      size = None
                      font = None
                      type = None
              Severity: Minor
              Found in MuseParse/classes/ObjectHierarchy/ItemClasses/Directions.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 not isinstance(
                                          values[key][k],
                                          str) and not isinstance(
                                          values[key][k],
                                          int) and not isinstance(
              Severity: Major
              Found in MuseParse/classes/ObjectHierarchy/ItemClasses/BaseClass.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if result is not None:
                                            if next_result is None:
                                                note.CheckForGraceNotes()
                                            else:
                                                result.last = False
                Severity: Major
                Found in MuseParse/classes/ObjectHierarchy/TreeClasses/VoiceNode.py - About 45 mins to fix

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

                      def toLily(self):
                          lilystring = ""
                          style_line = ""
                          if hasattr(self, "lineType"):
                              if self.lineType == "solid":
                  Severity: Minor
                  Found in MuseParse/classes/ObjectHierarchy/ItemClasses/Directions.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

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

                      def toLily(self):
                          val = ""
                          gliss = "\glissando"
                          values = []
                          if hasattr(self, "lineType"):
                  Severity: Minor
                  Found in MuseParse/classes/ObjectHierarchy/ItemClasses/Note.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 not isinstance(
                                              item,
                                              str) and not isinstance(
                                              item,
                                              int) and not isinstance(
                  Severity: Major
                  Found in MuseParse/classes/ObjectHierarchy/ItemClasses/BaseClass.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        if counter == index:
                                            return node.GetChild(child)
                                    if isinstance(result, cls_type):
                    Severity: Major
                    Found in MuseParse/classes/ObjectHierarchy/TreeClasses/BaseTree.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                  if len(barres) > 0:
                                                      val += "-".join(barres)
                      
                      
                      Severity: Major
                      Found in MuseParse/classes/ObjectHierarchy/ItemClasses/Harmony.py - About 45 mins to fix

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

                            def __init__(self, **kwargs):
                                if "strings" in kwargs:
                                    if kwargs["strings"] is not None:
                                        self.strings = kwargs["strings"]
                                    else:
                        Severity: Minor
                        Found in MuseParse/classes/ObjectHierarchy/ItemClasses/Harmony.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 hasattr(item, "timeMod"):
                                                    res = item.Search(Tuplet)
                        
                                                    if not hasattr(
                                                            next_item,
                        Severity: Major
                        Found in MuseParse/classes/ObjectHierarchy/TreeClasses/VoiceNode.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if hasattr(self, "trem_length"):
                                                      value *= self.trem_length
                                                  value = int(value)
                          Severity: Major
                          Found in MuseParse/classes/ObjectHierarchy/ItemClasses/Note.py - About 45 mins to fix

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

                                def __init__(self, **kwargs):
                                    text = None
                                    size = None
                                    font = None
                                    placement = None
                            Severity: Minor
                            Found in MuseParse/classes/ObjectHierarchy/ItemClasses/Directions.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 hasattr(self, "trem_length"):
                                                        rounded *= self.trem_length
                                                    value = int(rounded)
                            Severity: Major
                            Found in MuseParse/classes/ObjectHierarchy/ItemClasses/Note.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
                                Severity
                                Category
                                Status
                                Source
                                Language