fabiommendes/sidekick

View on GitHub

Showing 157 of 157 total issues

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

def catch(exc: Union[Catchable, Dict[Catchable, Any]], func: Func, /, *args, **kwargs):
    """
    Handle exception in function. If the exception occurs, it executes the given
    handler.

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

    def _stub_declarations(self) -> Iterable[str]:
        name = self.name

        if len(self.signatures) == 0:
            yield f"def {name}(*args, **kwargs) -> Any: ..."
Severity: Minor
Found in sidekick-functions/sidekick/functions/stub.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 define has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def define(
    Severity: Minor
    Found in sidekick-types/sidekick/types/named_record.py - About 45 mins to fix

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

      def clean_field(field, use_invalid=False):
          """
          Coerce argument to a Field instance.
          """
          tt = object
      Severity: Minor
      Found in sidekick-types/sidekick/types/named_record.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 __gt__ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def __gt__(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 map has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      def map(func: Func, *seqs: Seq, index: Index = None, product: bool = None) -> Iter:
          """
          Evaluate function at elements of sequences.
      
              sk.map(func, *seqs) ==> f(X[0], Y[0], ...), f(X[1], Y[1], ...), ...
      Severity: Minor
      Found in sidekick-seq/sidekick/seq/lib_transforming.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 set_null has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      def set_null(func, /, *defaults: Any, **kwargs) -> fn:
          """
          Return a new function that replace all null arguments in the given positions
          by the provided default value.
          """
      Severity: Minor
      Found in sidekick-functions/sidekick/functions/lib_arguments.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 wrapped_func has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              def wrapped_func(printer, obj, stream, indent, allowance, context, level):
      Severity: Minor
      Found in sidekick-extra/sidekick/extra/render.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 thread_if has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          def thread_if(data, *forms):
              """
              Similar to thread, but each form must be a tuple with (test, fn, ...args)
              and only pass the argument to fn if the boolean test is True.
          
          
          Severity: Minor
          Found in sidekick-functions/sidekick/functions/lib_composition.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 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 normalize_field_mapping has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          def normalize_field_mapping(fields):
              """
              Normalize each declaration in a field mapping.
              """
              for name, value in fields.items():
          Severity: Minor
          Found in sidekick-types/sidekick/types/named_record.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 rtake has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          def rtake(key: Union[Pred, int], seq: Seq) -> Iter:
              """
              Return the last entries iterable.
          
              Examples:
          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 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

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

              def __init__(self, data, **kwargs):
                  self.data = data
                  self.pre_setitem = []
                  self.post_setitem = []
                  self.pre_delitem = []
          Severity: Minor
          Found in sidekick-experimental/sidekick/experimental/observableseq.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 iter_children has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def iter_children(
          Severity: Minor
          Found in sidekick-tree/sidekick/tree/node_iterators.py - About 45 mins to fix

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

                def replace_child(self, child, other, raises=False, append=False):
                    """
                    Replace element for child.
                    """
                    other.parent = self
            Severity: Minor
            Found in sidekick-tree/sidekick/tree/node_classes.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 pure has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

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

              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

              Severity
              Category
              Status
              Source
              Language