Skip to content
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

Merged
merged 7 commits into from
Sep 19, 2024
Merged

add more linting rules and fixes #696

merged 7 commits into from
Sep 19, 2024

Conversation

helylle
Copy link
Contributor

@helylle helylle commented Sep 19, 2024

Adds a few more rules and small fixes
Largest patch is list comprehension replacing list manipulation inside for loops

Copy link

sonarcloud bot commented Sep 19, 2024

Comment on lines +303 to +304
resources = [{"id": str(this.scim_id), "displayName": this.display_name} for this in groups]

Copy link
Contributor Author

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)
Copy link
Contributor Author

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)

@helylle helylle marked this pull request as ready for review September 19, 2024 08:20
@johanlundberg johanlundberg merged commit 14f017a into main Sep 19, 2024
11 checks passed
@johanlundberg johanlundberg deleted the ylle-new-linting branch September 19, 2024 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants