Godley/MuseParse

View on GitHub

Showing 691 of 691 total issues

Avoid deeply nested control flow statements.
Open

                        if fraction == 0.25:
                            value += "."
        return value
Severity: Major
Found in MuseParse/classes/ObjectHierarchy/TreeClasses/MeasureNode.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 "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 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 "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 "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 "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 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 "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 "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

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

                          def addClef(self, item, measure_id, staff_id, voice):
                              measure = self.getMeasure(measure_id, staff_id)
                              if measure is not None:
                                  measure.addClef(item, voice)
                              else:
                      Severity: Minor
                      Found in MuseParse/classes/ObjectHierarchy/TreeClasses/PartNode.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 "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 not isinstance(node, NoteNode.Placeholder):
                                                    self.index += 1
                                        else:
                        Severity: Major
                        Found in MuseParse/classes/ObjectHierarchy/TreeClasses/MeasureNode.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 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 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 "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 "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

                                                        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

                                                              for c in children:
                                                                  child = placeholder.GetChild(c)
                                                                  if child.GetItem(
                                                                  ).__class__.__name__ == OctaveShift.__name__:
                                                                      i = placeholder.PopChild(c)
                                      Severity: Major
                                      Found in MuseParse/classes/ObjectHierarchy/TreeClasses/MeasureNode.py - About 45 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language