MTG/SymbTr-extras

View on GitHub

Showing 8 of 10 total issues

Function parse_usul_dict has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    def parse_usul_dict(cls):
        mu2_usul_dict = {}
        inv_mu2_usul_dict = {}
        usul_dict = cls.get_usul_dict()
        for key, val in iteritems(usul_dict):
Severity: Minor
Found in symbtrextras/scoreextras.py - About 2 hrs 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 correct_offset_gracenote has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def correct_offset_gracenote(cls, txt_file, mu2_file):
        # extract symbtr data
        data = ScoreExtras.get_symbtr_data(txt_file, mu2_file)

        # get zaman and mertebe from usul variant
Severity: Minor
Found in symbtrextras/txtextras.py - About 1 hr 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 _chk_usul_by_id has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _chk_usul_by_id(cls, index, inv_mu2_usul_dict, row, symbtr_name,
Severity: Major
Found in symbtrextras/txtextras.py - About 50 mins to fix

    Function _parse_usul_row has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def _parse_usul_row(cls, row, index, mu2_usul_dict, inv_mu2_usul_dict,
    Severity: Minor
    Found in symbtrextras/txtextras.py - About 45 mins to fix

      Function _chk_usul_by_name has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def _chk_usul_by_name(cls, index, mu2_usul_dict, row, symbtr_name, usul_id,
      Severity: Minor
      Found in symbtrextras/txtextras.py - About 45 mins to fix

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

            def _chk_usul_attr(row, usul, attr_str, symbtr_name, index, usul_name):
        Severity: Minor
        Found in symbtrextras/txtextras.py - About 35 mins to fix

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

              def add_usul_to_first_row(cls, txt_file, mu2_file):
                  # extract symbtr data
                  data = ScoreExtras.get_symbtr_data(txt_file, mu2_file)
          
                  # get usul variant
          Severity: Minor
          Found in symbtrextras/txtextras.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 _get_zaman_mertebe has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def _get_zaman_mertebe(data):
                  usul_dict = ScoreExtras.get_usul_dict()
                  for usul in usul_dict.values():
                      for uv in usul['variants']:
                          if uv['mu2_name'] == data['usul']['mu2_name']:
          Severity: Minor
          Found in symbtrextras/txtextras.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

          Severity
          Category
          Status
          Source
          Language