williamfzc/findit

View on GitHub

Showing 11 of 11 total issues

Function point_list_filter has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def point_list_filter(
    point_list: typing.Sequence, distance: float, point_limit: int = None
) -> typing.Sequence:
    """ remove some points which are too close """
    if not point_limit:
Severity: Minor
Found in findit/toolbox.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 __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(
Severity: Major
Found in findit/engine/template.py - About 50 mins to fix

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

        def execute(
    Severity: Minor
    Found in findit/engine/ocr.py - About 45 mins to fix

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

          def execute(
      Severity: Minor
      Found in findit/engine/template.py - About 45 mins to fix

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

            def find(
        Severity: Minor
        Found in findit/core.py - About 35 mins to fix

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

              def __init__(
          Severity: Minor
          Found in findit/engine/feature.py - About 35 mins to fix

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

            def compress_frame(
            Severity: Minor
            Found in findit/toolbox.py - About 35 mins to fix

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

                  def __init__(
              Severity: Minor
              Found in findit/core.py - About 35 mins to fix

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

                    def _compare_template(
                        self,
                        template_pic_object: np.ndarray,
                        target_pic_object: np.ndarray,
                        scale: typing.Sequence,
                Severity: Minor
                Found in findit/engine/template.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 analyse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def analyse():
                    # required
                    # support multi pictures, split with ','
                    template_name = request.form.get("template_name")
                    template_name_list = template_name.split(",") if template_name else list()
                Severity: Minor
                Found in findit/server/router.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

                Function _find_with_template has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _find_with_template(
                        self, target_pic_object: np.ndarray, _mark_pic: bool = None, *args, **kwargs
                    ) -> dict:
                        # pre assert
                        assert not self.template.is_empty(), "template is empty"
                Severity: Minor
                Found in findit/core.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