Showing 31 of 31 total issues

File concurrent.py has 276 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
"""Coroutines concurrent pool executor with built-in
concurrency limit based on a semaphore free slots algorithm.

Usage::
Severity: Minor
Found in paco/concurrent.py - About 2 hrs to fix

    Function curry has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    def curry(arity_or_fn=None, ignore_kwargs=False, evaluator=None, *args, **kw):
        """
        Creates a function that accepts one or more arguments of a function and
        either invokes func returning its result if at least arity number of
        arguments have been provided, or returns a function that accepts the
    Severity: Minor
    Found in paco/curry.py - About 2 hrs 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 race has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def race(iterable, loop=None, timeout=None, *args, **kw):
        """
        Runs coroutines from a given iterable concurrently without waiting until
        the previous one has completed.
    
    
    Severity: Minor
    Found in paco/race.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 run has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def run(self,
                timeout=None,
                return_when=None,
                return_exceptions=None,
                ignore_empty=None):
    Severity: Minor
    Found in paco/concurrent.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 decorate has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def decorate(fn):
        """
        Generic decorator for coroutines helper functions allowing
        multiple variadic initialization arguments.
    
    
    Severity: Minor
    Found in paco/decorator.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 each has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def each(coro, iterable, limit=0, loop=None,
    Severity: Major
    Found in paco/each.py - About 1 hr to fix

      Function flat_map has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def flat_map(coro, iterable, limit=0, loop=None, timeout=None,
      Severity: Major
      Found in paco/flat_map.py - About 1 hr to fix

        Function times has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

        def times(coro, limit=1, raise_exception=False, return_value=None):
            """
            Wraps a given coroutine function to be executed only a certain amount
            of times.
        
        
        Severity: Minor
        Found in paco/times.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 map has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def map(coro, iterable, limit=0, loop=None, timeout=None,
        Severity: Major
        Found in paco/map.py - About 1 hr to fix

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

          def gather(*coros_or_futures, limit=0, loop=None, timeout=None,
                     preserve_order=False, return_exceptions=False):
              """
              Return a future aggregating results from the given coroutine objects
              with a concurrency execution limit.
          Severity: Minor
          Found in paco/gather.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 throttle has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          def throttle(coro, limit=1, timeframe=1,
                       return_value=None, raise_exception=False):
              """
              Creates a throttled coroutine function that only invokes
              ``coro`` at most once per every time frame of seconds or milliseconds.
          Severity: Minor
          Found in paco/throttle.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 wait has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def wait(*coros_or_futures, limit=0, timeout=None, loop=None,
          Severity: Minor
          Found in paco/wait.py - About 45 mins to fix

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

            def gather(*coros_or_futures, limit=0, loop=None, timeout=None,
            Severity: Minor
            Found in paco/gather.py - About 45 mins to fix

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

              def reduce(coro, iterable, initializer=None, limit=1, right=False, loop=None):
              Severity: Minor
              Found in paco/reduce.py - About 45 mins to fix

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

                def curry(arity_or_fn=None, ignore_kwargs=False, evaluator=None, *args, **kw):
                Severity: Minor
                Found in paco/curry.py - About 35 mins to fix

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

                  def whilst(coro, coro_test, assert_coro=None, *args, **kw):
                  Severity: Minor
                  Found in paco/whilst.py - About 35 mins to fix

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

                    def until(coro, coro_test, assert_coro=None, *args, **kw):
                    Severity: Minor
                    Found in paco/until.py - About 35 mins to fix

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

                          def currier(arity, acc, fn, *args, **kw):
                      Severity: Minor
                      Found in paco/curry.py - About 35 mins to fix

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

                        def collect(coro, index, results,
                        Severity: Minor
                        Found in paco/concurrent.py - About 35 mins to fix

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

                          def throttle(coro, limit=1, timeframe=1,
                          Severity: Minor
                          Found in paco/throttle.py - About 35 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language