-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add more linting rules and fixes #696
Conversation
as per the documentation, a micro-optimization but more readable code
Quality Gate passedIssues Measures |
resources = [{"id": str(this.scim_id), "displayName": this.display_name} for this in groups] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For readability 'this' should probably be replaced with 'group'
@@ -58,7 +58,7 @@ def is_valid_password(password: str, user_info: Sequence[str], min_entropy: int, | |||
# Check password complexity with zxcvbn | |||
result = zxcvbn(password, user_inputs=user_info) | |||
_guesses = result.get("guesses", 1) | |||
_pw_entropy = math.log(_guesses, 2) | |||
_pw_entropy = math.log2(_guesses) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log2(x) is usually more accurate than log(x, 2) according to
https://docs.python.org/3/library/math.html#math.log2
(Added in python 3.3)
Adds a few more rules and small fixes
Largest patch is list comprehension replacing list manipulation inside for loops