fabiommendes/sidekick

View on GitHub

Showing 155 of 157 total issues

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

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

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

    def lazy(
    Severity: Minor
    Found in sidekick-properties/sidekick/properties/properties.py - About 35 mins to fix

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

      def alias(attr, *, transform=None, prepare=None, **kwargs) -> Any:
      Severity: Minor
      Found in sidekick-properties/sidekick/properties/properties.py - About 35 mins to fix

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

        def delegate_to(attr, *, transform=None, prepare=None, **kwargs):
        Severity: Minor
        Found in sidekick-properties/sidekick/properties/properties.py - About 35 mins to fix

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

          def _iterate_indexed_n(func, index, args):
              n = len(args)
              try:
                  yield from args
                  if n == 2:
          Severity: Minor
          Found in sidekick-seq/sidekick/seq/lib_creation.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 __getitem__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def __getitem__(self, i: int) -> NodeOrLeaf:
                  if isinstance(i, int):
                      if i == 0 or i == len(self._children):
                          return self.tag
                      if i > 0:
          Severity: Minor
          Found in sidekick-tree/sidekick/tree/node_sexpr.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 iterate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def iterate(func: Callable[..., T], x: T, *args, index: Index = None):
              f"""
              Repeatedly apply a function func to input.
          
              If more than one argument to func is passed, it iterate over the past n
          Severity: Minor
          Found in sidekick-seq/sidekick/seq/lib_creation.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 _iterate_n has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def _iterate_n(func, args):
              n = len(args)
              try:
                  yield from args
                  if n == 2:
          Severity: Minor
          Found in sidekick-seq/sidekick/seq/lib_creation.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 wrap_fn_functions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def wrap_fn_functions(globs: Dict[str, Any], lst=None, exclude=()):
              """
              Wraps all function in namespace using fn.
          
              This avoids the @fn decorator that sometimes confuses static checkers.
          Severity: Minor
          Found in sidekick-functions/sidekick/functions/fn.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 _next_function has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def _next_function(self, iterator, default, next=next, not_given=NOT_GIVEN):
                  stack = self._cursor_stack
                  pop = stack.pop
          
                  def yield_next():
          Severity: Minor
          Found in sidekick-experimental/sidekick/experimental/iterators.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 __getattr__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def __getattr__(self, item):
                  if item in self.__all__:
                      for package in get_subpackages(self):
                          try:
                              value = get_item(package, item)
          Severity: Minor
          Found in sidekick-api/sidekick/api/_modules.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 any_pred has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def any_pred(*predicates):
              """
              Return a new predicate function that performs a logic OR to all arguments.
          
              This behaves in a short-circuit manner and returns the first truthy result,
          Severity: Minor
          Found in sidekick-functions/sidekick/functions/pred.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 bind_handlers has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def bind_handlers(func_or_mod, handlers, methods):
              """
              Receive a function and a mapping from {(mime, method): handler_factory}
              and return a populated mapping of handlers.
              """
          Severity: Minor
          Found in sidekick-beta/sidekick/beta/app/gcf.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 to_function has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def to_function(func: Any, name=None, keep_signature=False) -> FunctionType:
              """
              Return object as as Python function.
          
              Non-functions are wrapped into a function definition.
          Severity: Minor
          Found in sidekick-functions/sidekick/functions/core_functions.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 all_pred has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def all_pred(*predicates):
              """
              Return a new predicate that performs an logic AND to all predicate
              functions.
          
          
          Severity: Minor
          Found in sidekick-functions/sidekick/functions/pred.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 tree_leaves has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def tree_leaves(root: Seq, *, follow: Pred = is_seqcont, children: Func = iter) -> Seq:
              """
              A way to list or iterate over all the tree leaves.
          
              Args:
          Severity: Minor
          Found in sidekick-experimental/sidekick/experimental/seq_nested.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 period_cache has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def period_cache(
                  key: str,
                  fn: callable,
                  *,
                  period: Union[str, int, datetime.timedelta],
          Severity: Minor
          Found in sidekick-beta/sidekick/beta/cache.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 delegate_to has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def delegate_to(attr, *, transform=None, prepare=None, **kwargs):
              """
              Delegate access to an inner variable.
          
              A delegate is an alias for an attribute of the same name that lives in an
          Severity: Minor
          Found in sidekick-properties/sidekick/properties/properties.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

          Avoid too many return statements within this function.
          Open

                          return [data[i] for i in item]
          Severity: Major
          Found in sidekick-seq/sidekick/seq/iter.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return Iter(_chunks_split(func, seq))
            Severity: Major
            Found in sidekick-seq/sidekick/seq/lib_grouping.py - About 30 mins to fix
              Severity
              Category
              Status
              Source
              Language