ionelmc/python-lazy-object-proxy

View on GitHub

Showing 4 of 4 total issues

Proxy has 94 functions (exceeds 20 allowed). Consider refactoring.
Open

class Proxy(with_metaclass(_ProxyMetaType)):
    """
    A proxy implementation in pure Python, using slots. You can subclass this to add
    local methods or attributes, or enable __dict__.

Severity: Major
Found in src/lazy_object_proxy/slots.py - About 1 day to fix

    Proxy has 28 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Proxy(with_metaclass(_ProxyMetaType)):
        __factory__ = None
    
        def __init__(self, factory):
            self.__dict__['__factory__'] = factory
    Severity: Minor
    Found in src/lazy_object_proxy/simple.py - About 3 hrs to fix

      File slots.py has 302 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import operator
      
      from .compat import string_types
      from .compat import with_metaclass
      from .utils import await_
      Severity: Minor
      Found in src/lazy_object_proxy/slots.py - About 3 hrs to fix

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

        def exec_in_env():
            env_path = base_path / '.tox' / 'bootstrap'
            if sys.platform == 'win32':
                bin_path = env_path / 'Scripts'
            else:
        Severity: Minor
        Found in ci/bootstrap.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

        Severity
        Category
        Status
        Source
        Language