fabiocaccamo/python-fontbro

View on GitHub
fontbro/font.py

Summary

Maintainability
C
1 day
Test Coverage

File font.py has 1755 lines of code (exceeds 250 allowed). Consider refactoring.
Wontfix

from __future__ import annotations

import copy
import os
import re
Severity: Major
Found in fontbro/font.py - About 4 days to fix

    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], None, None]:
    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 set_style_flags has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Wontfix

        def set_style_flags(
    Severity: Major
    Found in fontbro/font.py - About 1 hr to fix

      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 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_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 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 subset has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Wontfix

                def subset(
            Severity: Minor
            Found in fontbro/font.py - About 45 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 _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 __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

                      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

                        There are no issues that match your filters.

                        Category
                        Status