netdata/netdata

View on GitHub
src/collectors/python.d.plugin/python_modules/urllib3/contrib/ntlmpool.py

Summary

Maintainability
A
3 hrs
Test Coverage

Function _new_conn has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def _new_conn(self):
        # Performs the NTLM handshake that secures the connection. The socket
        # must be kept open while requests are performed.
        self.num_connections += 1
        log.debug('Starting NTLM HTTPS connection no. %d: https://%s%s',

    Function urlopen has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def urlopen(self, method, url, body=None, headers=None, retries=3,

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

          def __init__(self, user, pw, authurl, *args, **kwargs):

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

            def _new_conn(self):
                # Performs the NTLM handshake that secures the connection. The socket
                # must be kept open while requests are performed.
                self.num_connections += 1
                log.debug('Starting NTLM HTTPS connection no. %d: https://%s%s',

        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

        There are no issues that match your filters.

        Category
        Status