Godley/Music-Library

View on GitHub

Showing 74 of 202 total issues

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

    def add_instrument_to_piece(self, data, piece_id, clefs={}, keys={}):
        ins = self.get_or_add(data, table='instruments')[0]
        for clef_data in clefs:
            clef = self.query(clef_data, table='clefs')
            if len(clef) > 0:
Severity: Minor
Found in implementation/primaries/ExtractMetadata/classes/DataLayer/musicdata.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 __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, parent, file, title, design_folder, data_set="mine"):
Severity: Minor
Found in implementation/primaries/GUI/Widgets.py - About 35 mins to fix

    Function handleTransposition has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def handleTransposition(tags, attrs, chars, parts, data):
    Severity: Minor
    Found in implementation/primaries/ExtractMetadata/classes/MetaParser.py - About 35 mins to fix

      Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(self, method, callback, queue, data, kwargs={}):
      Severity: Minor
      Found in implementation/primaries/GUI/thread_classes.py - About 35 mins to fix

        Function create_elem has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def create_elem(chars, key1, key2, cast1=int, cast2=str):
        Severity: Minor
        Found in implementation/primaries/ExtractMetadata/classes/MetaParser.py - About 35 mins to fix

          Function handleMeter has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def handleMeter(tags, attrs, chars, parts, data):
          Severity: Minor
          Found in implementation/primaries/ExtractMetadata/classes/MetaParser.py - About 35 mins to fix

            Function handle_clef_or_key has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def handle_clef_or_key(tags, attrs, chars, parts, data):
            Severity: Minor
            Found in implementation/primaries/ExtractMetadata/classes/MetaParser.py - About 35 mins to fix

              Function handleBibliography has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def handleBibliography(tags, attrs, chars, parts, data):
              Severity: Minor
              Found in implementation/primaries/ExtractMetadata/classes/MetaParser.py - About 35 mins to fix

                Function fetch_and_form_results has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def fetch_and_form_results(self, data, key, method, *args, **kwargs):
                Severity: Minor
                Found in implementation/primaries/ExtractMetadata/classes/MusicManager.py - About 35 mins to fix

                  Function fetch_results has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def fetch_results(self, data, key, method, *args, **kwargs):
                  Severity: Minor
                  Found in implementation/primaries/ExtractMetadata/classes/MusicManager.py - About 35 mins to fix

                    Function make_new_part has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def make_new_part(tags, attrs, chars, parts, data):
                    Severity: Minor
                    Found in implementation/primaries/ExtractMetadata/classes/MetaParser.py - About 35 mins to fix

                      Function getPieceByTitle has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def getPieceByTitle(self, title, *args,
                      Severity: Minor
                      Found in implementation/primaries/ExtractMetadata/classes/DataLayer/musicdata.py - About 35 mins to fix

                        Function handle_tempo has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def handle_tempo(tags, attrs, chars, parts, data):
                        Severity: Minor
                        Found in implementation/primaries/ExtractMetadata/classes/MetaParser.py - About 35 mins to fix

                          Function parseNewFiles has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def parseNewFiles(self, file_list):
                                  """
                                  method to call the sax parser on each of the new files then send the data to the data layer
                                  :param file_list:
                                  :return:
                          Severity: Minor
                          Found in implementation/primaries/ExtractMetadata/classes/MusicManager.py - About 35 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 getPieceByMeter has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def getPieceByMeter(self, meters, archived=False, online=False):
                                  results = set()
                                  for meter in meters:
                                      if "/" in meter:
                                          values = meter.split("/")
                          Severity: Minor
                          Found in implementation/primaries/ExtractMetadata/classes/DataLayer/musicdata.py - About 35 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 getPieceByInstrumentIn_ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def getPieceByInstrumentIn_(
                                      self,
                                      data,
                                      table="clefs",
                                      archived=False,
                          Severity: Minor
                          Found in implementation/primaries/ExtractMetadata/classes/DataLayer/musicdata.py - About 35 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 query_multiple has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def query_multiple(
                                      self,
                                      data,
                                      filter_col="piece.id",
                                      table="clefs_ins_piece"):
                          Severity: Minor
                          Found in implementation/primaries/ExtractMetadata/classes/DataLayer/querylayer.py - About 35 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 cleanupContentLayout has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def cleanupContentLayout(self, layout):
                                  if layout is not None:
                                      while layout.count():
                                          item = layout.takeAt(0)
                                          widge = item.widget()
                          Severity: Minor
                          Found in implementation/primaries/GUI/MainWindow.py - About 35 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 make_new_part has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def make_new_part(tags, attrs, chars, parts, data):
                              """
                              handler which works with anything inside the score-part tag, which creates a new part inside the data dict
                              :param tags: current list of xml tags
                              :param attrs: current dict of attribs
                          Severity: Minor
                          Found in implementation/primaries/ExtractMetadata/classes/MetaParser.py - About 35 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 handle_beat_unit_dot has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def handle_beat_unit_dot(list_of_dicts, tag):
                              if tag == "beat-unit-dot":
                                  copy_of_dict = copy.deepcopy(list_of_dicts)
                                  if len(copy_of_dict) > 0:
                                      if "beat_2" in copy_of_dict[-1]:
                          Severity: Minor
                          Found in implementation/primaries/ExtractMetadata/classes/MetaParser.py - About 35 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

                          Severity
                          Category
                          Status
                          Source
                          Language