Showing 34 of 34 total issues
Function is_gitlab_auth_redirect
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def is_gitlab_auth_redirect(response):
"""Return `True` if a response indicates a gitlab auth redirect.
Parameters
----------
- Read upRead up
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
At least two spaces before inline comment Open
Open
</S:Envelope>""".strip(), # noqa
- Read upRead up
- Exclude checks
Separate inline comments by at least two spaces.
An inline comment is a comment on the same line as a statement.
Inline comments should be separated by at least two spaces from the
statement. They should start with a # and a single space.
Each line of a block comment starts with a # and a single space
(unless it is indented text inside the comment).
Okay: x = x + 1 # Increment x
Okay: x = x + 1 # Increment x
Okay: # Block comment
E261: x = x + 1 # Increment x
E262: x = x + 1 #Increment x
E262: x = x + 1 # Increment x
E265: #Block comment
E266: ### Block comment
Possible hardcoded password: 'mypasswd' Open
Open
auth = self.TEST_CLASS._init_auth(
"https://idp.test.com",
username="me",
password="mypasswd",
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
Open
assert isinstance(auth, HTTPBasicAuth)
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
Open
assert session.auth._num_ecp_auth == 0
- Exclude checks
Using etree to parse untrusted XML data is known to be vulnerable to XML attacks. Replace etree with the equivalent defusedxml package. Open
Open
from lxml import etree
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
Open
assert auth.username == "me"
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
Open
assert auth.password == "mypasswd"
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
Open
assert requests_ecp_auth.is_ecp_auth_redirect(resp)
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
Open
assert isinstance(auth, requests_gssapi.HTTPKerberosAuth)
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
Open
assert requests_mock.call_count == 3
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
Open
assert requests_ecp_auth.is_gitlab_auth_redirect(resp)
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
Open
assert not requests_ecp_auth.is_gitlab_auth_redirect(resp)
- Exclude checks
Possible hardcoded password: 'passwd' Open
Open
session.auth = self.TEST_CLASS(
idp="test",
username="user",
password="passwd",
- Exclude checks
Possible hardcoded password: 'passwd' Open
Open
session.auth = self.TEST_CLASS(
idp="test",
username="user",
password="passwd",
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
Open
assert ecp._get_xml_attribute(
etree.XML(SP_ECP_PAOS_RESPONSE),
"//ecp:RelayState",
).text.strip() == "relay_state_text"
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
Open
assert auth.password == "passwd"
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
Open
assert sess.auth.idp == "test"
- Exclude checks
Using etree to parse untrusted XML data is known to be vulnerable to XML attacks. Replace etree with the equivalent defusedxml package. Open
Open
from lxml import etree
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
Open
assert auth.username == "me"
- Exclude checks