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

addresses active reported issues as reported by CodeQL #233

Merged
merged 3 commits into from
Dec 10, 2024

Conversation

tlgevers
Copy link
Contributor

@tlgevers tlgevers commented Dec 4, 2024

Issues addressed within this PR:
222 Unused import - file: tools/picklescanner.py
223 Unused import - file: skip.py
224 Missing call to init - file: issues.py
225 Potentially uninitialized local variable - file: cli.py
226 File is not always closed- file: cli.py
227 File is not always closed - file: model.py

Issues: 222, 223, 224, 225, 226, 227
Copy link
Member

@iamfaisalkhan iamfaisalkhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the changes looks good. Explicit close within context appear redundant. Also do you mind, running make format to fix some of the issues related to formatting.

modelscan/cli.py Outdated
@@ -115,6 +115,7 @@ def scan(
with open(settings_file_path, encoding="utf-8") as sf:
settings = parse(sf.read()).unwrap()
click.echo(f"Detected settings file. Using {settings_file_path}. \n")
sf.close()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The close should be redundant as the context manager should close it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Faisal, I have updated the PR, removed the redundant close & also ran make format to ensure formatting is corrected.

Trevor Gevers and others added 2 commits December 9, 2024 10:36
Copy link
Member

@iamfaisalkhan iamfaisalkhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@iamfaisalkhan iamfaisalkhan merged commit 45ed304 into protectai:main Dec 10, 2024
8 checks passed
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