zeehio/parmap

View on GitHub

Showing 8 of 55 total issues

File parmap.py has 394 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/env python
#   Copyright 2014 Sergio Oller <sergioller@gmail.com>
#
#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
Severity: Minor
Found in parmap/parmap.py - About 5 hrs to fix

    Function _map_or_starmap has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    def _map_or_starmap(function, iterable, args, kwargs, map_or_starmap):
        """
        Shared function between parmap.map and parmap.starmap.
        Refer to those functions for details.
        """
    Severity: Minor
    Found in parmap/parmap.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 _map_or_starmap_async has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    def _map_or_starmap_async(function, iterable, args, kwargs, map_or_starmap):
        """
        Shared function between parmap.map_async and parmap.starmap_async.
        Refer to those functions for details.
        """
    Severity: Minor
    Found in parmap/parmap.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 _serial_map_or_starmap has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def _serial_map_or_starmap(function, iterable, args, kwargs, progress,
    Severity: Minor
    Found in parmap/parmap.py - About 45 mins to fix

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

      def _map_or_starmap(function, iterable, args, kwargs, map_or_starmap):
      Severity: Minor
      Found in parmap/parmap.py - About 35 mins to fix

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

        def _map_or_starmap_async(function, iterable, args, kwargs, map_or_starmap):
        Severity: Minor
        Found in parmap/parmap.py - About 35 mins to fix

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

          def _do_pbar(async_result, num_tasks, chunksize, refresh_time=2):
              remaining = num_tasks
              # tqdm provides a progress bar.
              # the pbar needs to be updated with the increment on each
              # iteration.
          Severity: Minor
          Found in parmap/parmap.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 _deprecated_kwargs has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def _deprecated_kwargs(kwargs, arg_newarg):
              """ arg_newarg is a list of tuples, where each tuple has a pair of strings.
                  ('old_arg', 'new_arg')
                  A DeprecationWarning is raised for the arguments that need to be
                  replaced.
          Severity: Minor
          Found in parmap/parmap.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

          Severity
          Category
          Status
          Source
          Language