fabiommendes/sidekick

View on GitHub

Showing 157 of 157 total issues

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

def separate(pred: Func, seq: Seq, consume: bool = False) -> (Seq, Seq):
    """
    Split sequence it two. The first consists of items that pass the
    predicate and the second of those items that don't.

Severity: Minor
Found in sidekick-seq/sidekick/seq/lib_selecting.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 keywords has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def keywords(self, how="short") -> Dict[str, type]:
        """
        Return a dictionary with signatures of function keyword parameters.
        """
        keywords = {}
Severity: Minor
Found in sidekick-functions/sidekick/functions/signature.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 impure has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

def impure(name, tt, ns, *, arity=None, flip=False):
Severity: Minor
Found in sidekick-experimental/sidekick/experimental/magics/base_magics.py - About 45 mins to fix

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

    def casedispatch(typ):
        """
        Decorator that declares a method that participates in a case dispatch.
    
        Example::
    Severity: Minor
    Found in sidekick-experimental/sidekick/experimental/case_syntax.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 lazy has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def lazy(  # type: ignore
    Severity: Minor
    Found in sidekick-properties/sidekick/properties/properties.py - About 45 mins to fix

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

      def retry(n: int, func: Func, *, error: Catchable = Exception, sleep=None) -> fn:
      Severity: Minor
      Found in sidekick-functions/sidekick/functions/lib_runtime.py - About 35 mins to fix

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

        def indexed(transform, func: Callable, seq: Seq, *, start=0) -> Seq:
        Severity: Minor
        Found in sidekick-seq/sidekick/seq/lib_selecting.py - About 35 mins to fix

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

          def do(func, x, /, *args, **kwargs):
          Severity: Minor
          Found in sidekick-functions/sidekick/functions/lib_combinators.py - About 35 mins to fix

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

                def __init__(self, children=(), *, parent=None, leaf_class=None, **kwargs):
            Severity: Minor
            Found in sidekick-tree/sidekick/tree/node_classes.py - About 35 mins to fix

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

              def _create_fn_functions(mod, ns, arities=None, flipped=(), blacklist=()):
              Severity: Minor
              Found in sidekick-experimental/sidekick/experimental/contrib/builtins.py - About 35 mins to fix

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

                def chunks(
                Severity: Minor
                Found in sidekick-seq/sidekick/seq/lib_grouping.py - About 35 mins to fix

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

                      def flip(self, x, y, /, *args, **kwargs):
                  Severity: Minor
                  Found in sidekick-functions/sidekick/functions/fn_mixins.py - About 35 mins to fix

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

                        def __new__(mcs, name, bases, ns, use_invalid=False, **kwargs):
                    Severity: Minor
                    Found in sidekick-types/sidekick/types/named_record.py - About 35 mins to fix

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

                          def function(sub, st, *, start=0, end=None):
                      Severity: Minor
                      Found in sidekick-experimental/sidekick/experimental/contrib/string.py - About 35 mins to fix

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

                            def __init__(
                        Severity: Minor
                        Found in sidekick-functions/sidekick/functions/fn.py - About 35 mins to fix

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

                          def unique(seq: Seq, *, key: Func = None, exclude: Seq = (), slow=False) -> Iter:
                          Severity: Minor
                          Found in sidekick-seq/sidekick/seq/lib_selecting.py - About 35 mins to fix

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

                            def join(leftkey: Func, leftseq: Seq, rightkey: Func, rightseq: Seq, **kwargs) -> Iter:
                            Severity: Minor
                            Found in sidekick-seq/sidekick/seq/lib_combining.py - About 35 mins to fix

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

                                  def from_semigroup(cls, semigroup, unit=None, unit_factory=None, *, inv):
                              Severity: Minor
                              Found in sidekick-functions/sidekick/functions/fn_interfaces.py - About 35 mins to fix

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

                                def throttle(
                                Severity: Minor
                                Found in sidekick-functions/sidekick/functions/lib_runtime.py - About 35 mins to fix

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

                                      def __new__(mcs, name, bases, ns, *, type=None):
                                  Severity: Minor
                                  Found in sidekick-experimental/sidekick/experimental/magics/base_magics.py - About 35 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language