fabiocaccamo/python-fontbro

View on GitHub

Showing 12 of 15 total issues

Function get_filename has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    def get_filename(
        self,
        *,
        variable_suffix: str = "Variable",
        variable_axes_tags: bool = True,
Severity: Minor
Found in fontbro/font.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 get_characters has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def get_characters(
        self,
        *,
        ignore_blank: bool = False,
    ) -> Generator[dict[str, Any]]:
Severity: Minor
Found in fontbro/font.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 get_features_tags has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def get_features_tags(
        self,
    ) -> list[str]:
        """
        Gets the font opentype features tags.
Severity: Minor
Found in fontbro/font.py - About 55 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 to_static has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def to_static(
Severity: Major
Found in fontbro/font.py - About 50 mins to fix

    Function get_image has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def get_image(  # type: ignore
    Severity: Major
    Found in fontbro/font.py - About 50 mins to fix

      Function save_variable_instances has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def save_variable_instances(
      Severity: Major
      Found in fontbro/font.py - About 50 mins to fix

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

            def get_fingerprint_match(  # type: ignore
        Severity: Minor
        Found in fontbro/font.py - About 45 mins to fix

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

          def parse_unicodes(
              unicodes: Iterable[int | str] | str,
          ) -> list[int]:
              if isinstance(unicodes, (list, set, tuple)):
                  # convert possible int codepoints to hex str
          Severity: Minor
          Found in fontbro/subset.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 _save_with_flavor has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def _save_with_flavor(
          Severity: Minor
          Found in fontbro/font.py - About 35 mins to fix

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

                def rename(
            Severity: Minor
            Found in fontbro/font.py - About 35 mins to fix

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

                  def __exit__(  # type: ignore
              Severity: Minor
              Found in fontbro/font.py - About 35 mins to fix

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

                    def get_filename(
                Severity: Minor
                Found in fontbro/font.py - About 35 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language