nikoheikkila / pwnedapi

Library for easily interfacing with Have I Been Pwned API v2
https://pypi.org/project/pwnedapi/
MIT License
9 stars 5 forks source link

Improving Code Quality #8

Open nikoheikkila opened 6 years ago

nikoheikkila commented 6 years ago

We are using Codacy to monitor code quality and security issues. Its grade is now C B so there's some room for improvement.

Anyone willing to fix those? Discuss here if some rules need ignoring or adjustment.

embiem commented 6 years ago

Good Hacktober issue :-)

I'll work on this and create a PR later.

embiem commented 6 years ago

There are lots of warnings for test files, e.g. because assert is used. I will add a codacy config file to exclude these files, or do you want to use another approach?

nikoheikkila commented 6 years ago

There are lots of warnings for test files, e.g. because assert is used. I will add a codacy config file to exclude these files, or do you want to use another approach?

I don't think pytest can work without asserts (unless hiding/wrapping them somehow) so let's just modify the rules.

amirulabu commented 6 years ago

i want to fix .github/ISSUE_TEMPLATE/bug_report.md .github/ISSUE_TEMPLATE/feature_request.md

following the issues from Codacy

derekwilling commented 6 years ago

I am trying to fix some of the security issues in setup.py but I am not sure how to go about it. Can someone point me in the right direction?

about = {}

if not VERSION:
    with open(os.path.join(here, NAME, '__version__.py')) as f:
        exec(f.read(), about)
else:
    about["__version__"] = VERSION

How should I go about getting rid of exec? https://app.codacy.com/app/nikoheikkila/pwnedapi/file/24506394925/issues/source?bid=9308018&fileBranchId=9308018#l32

nikoheikkila commented 6 years ago

@DirtySoc exec is there to quickly read the version information from module __version__ to dictionary about. Therefore, it's not very necessary if you want to refactor fetching the version information.

Can you cooperate with @embiem to avoid conflicts on this?