Godley/MuseParse

View on GitHub

Showing 691 of 691 total issues

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 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 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 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
                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 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 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 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

              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):
                        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

                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

                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

                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

                  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 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

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                              if "type" in kwargs:
                                  if kwargs["type"] is not None:
                                      type = kwargs["type"]
                      Severity: Minor
                      Found in MuseParse/classes/ObjectHierarchy/ItemClasses/Directions.py and 1 other location - About 45 mins to fix
                      MuseParse/classes/ObjectHierarchy/ItemClasses/Directions.py on lines 274..276

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 37.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                      majors = {-
                                7: "Cflat", -
                                6: "Gflat", -
                                5: "Dflat", -
                                4: "Aflat", -
                      Severity: Minor
                      Found in MuseParse/classes/ObjectHierarchy/ItemClasses/Key.py and 1 other location - About 45 mins to fix
                      MuseParse/classes/ObjectHierarchy/ItemClasses/Key.py on lines 11..12

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 37.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                              if "placement" in kwargs:
                                  if kwargs["placement"] is not None:
                                      placement = kwargs["placement"]
                      Severity: Minor
                      Found in MuseParse/classes/ObjectHierarchy/ItemClasses/Directions.py and 1 other location - About 45 mins to fix
                      MuseParse/classes/ObjectHierarchy/ItemClasses/Directions.py on lines 401..403

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 37.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                              if "repeatNum" in kwargs:
                                  if kwargs["repeatNum"] is not None:
                                      self.repeatNum = kwargs["repeatNum"]
                                  else:
                                      self.repeatNum = 2
                      MuseParse/classes/ObjectHierarchy/ItemClasses/Harmony.py on lines 84..88

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 37.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                              if "strings" in kwargs:
                                  if kwargs["strings"] is not None:
                                      self.strings = kwargs["strings"]
                                  else:
                                      self.strings = 6
                      Severity: Minor
                      Found in MuseParse/classes/ObjectHierarchy/ItemClasses/Harmony.py and 1 other location - About 45 mins to fix
                      MuseParse/classes/ObjectHierarchy/ItemClasses/BarlinesAndMarkers.py on lines 34..38

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 37.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Severity
                      Category
                      Status
                      Source
                      Language