fabiommendes/sidekick

View on GitHub

Showing 157 of 157 total issues

Function run has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

def run(
Severity: Major
Found in sidekick-beta/sidekick/beta/app/gcf.py - About 1 hr to fix

    Function pprint has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def pprint(
    Severity: Major
    Found in sidekick-extra/sidekick/extra/render.py - About 1 hr to fix

      Function _is_identical has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def _is_identical(
      Severity: Major
      Found in sidekick-functions/sidekick/functions/pred.py - About 1 hr to fix

        Function throttle has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        def throttle(
            dt: float,
            func: Func,
            policy: Literal["last", "block"] = "last",
            clock: Callable[[], T] = time.monotonic,
        Severity: Minor
        Found in sidekick-functions/sidekick/functions/lib_runtime.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 curry has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        def curry(n, func=None):  # noqa: F811
            """
            Return the curried version of a function of n arguments.
        
            Curried functions return partial applications of the function if called with
        Severity: Minor
        Found in sidekick-functions/sidekick/functions/lib_partial_application.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 args has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def args(self, how="short") -> Tuple[type, ...]:
                """
                Return a tuple with function argument types.
                """
        
        
        Severity: Minor
        Found in sidekick-functions/sidekick/functions/signature.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 __eq__ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def __eq__(self, other):
                if not isinstance(other, list):
                    return NotImplemented
        
                if isinstance(other, LazyList):
        Severity: Minor
        Found in sidekick-collections/sidekick/collections/lazylist.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 iter_children has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def iter_children(
                node,
                how=None,
                *,
                self: bool = None,
        Severity: Minor
        Found in sidekick-tree/sidekick/tree/node_iterators.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 retry has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        def retry(n: int, func: Func, *, error: Catchable = Exception, sleep=None) -> fn:
            """
            Retry to execute function at least n times before raising an error.
        
            This is useful for functions that may fail due to interaction with external
        Severity: Minor
        Found in sidekick-functions/sidekick/functions/lib_runtime.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 _bind has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def _bind(*args, **kwargs):
                self, partial, *args = args
                n_sigs = len(self.signatures)
                for n, sig in enumerate(self.signatures, 1):
                    try:
        Severity: Minor
        Found in sidekick-functions/sidekick/functions/stub.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 from_semigroup has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def from_semigroup(cls, semigroup, unit=None, unit_factory=None):
                """
                Creates a monoid from semigroup, supplying the unit element or the unit
                factory.
                """
        Severity: Minor
        Found in sidekick-functions/sidekick/functions/fn_interfaces.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 _drop_at_lazy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        def _drop_at_lazy(indices, seq):
            idx = next(indices, None)
            if idx is None:
                return
            for i, x in enumerate(seq):
        Severity: Minor
        Found in sidekick-seq/sidekick/seq/lib_selecting.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 new_record_type has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def new_record_type(
        Severity: Major
        Found in sidekick-types/sidekick/types/named_record.py - About 50 mins to fix

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

          def pformat(obj, indent=1, width=80, depth=None, *, compact=False, **options) -> str:
          Severity: Major
          Found in sidekick-extra/sidekick/extra/render.py - About 50 mins to fix

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

            def wrap_function(
                fn: Callable,
                parse_value: Callable[[str], Any] = None,
                display: Callable[[Any], str] = None,
            ) -> Callable:
            Severity: Minor
            Found in sidekick-beta/sidekick/beta/app/function_wrapper.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 __eq__ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def __eq__(a, b):
                    nil = Nil
                    if isinstance(b, List):
                        while a is not nil and b is not nil:
                            if a is b:
            Severity: Minor
            Found in sidekick-experimental/sidekick/experimental/types/linkedlist.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 __ge__ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def __ge__(a, b):
                    nil = Nil
                    if isinstance(b, List):
                        while a is not nil and b is not nil:
                            if a is b:
            Severity: Minor
            Found in sidekick-experimental/sidekick/experimental/types/linkedlist.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 ttl_cache has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def ttl_cache(key, fn, *, timeout=6 * 3600, memory=None, **cache_kwargs):
            Severity: Minor
            Found in sidekick-beta/sidekick/beta/cache.py - About 45 mins to fix

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

                  def retry(
              Severity: Minor
              Found in sidekick-functions/sidekick/functions/fn_mixins.py - About 45 mins to fix

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

                def first_error(*args):
                    """
                    Return the first error in a sequence of Result values.
                
                    If no value is an error, return None.
                Severity: Minor
                Found in sidekick-types/sidekick/types/result.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

                Severity
                Category
                Status
                Source
                Language