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

Make tests modular and split into a class w class methods. #18

Open
M4cs opened this issue Oct 11, 2019 · 2 comments
Open

Make tests modular and split into a class w class methods. #18

M4cs opened this issue Oct 11, 2019 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers Hacktoberfest Open Source 2019 Hacktoberfest Project help wanted Extra attention is needed

Comments

@M4cs
Copy link
Owner

M4cs commented Oct 11, 2019

I think if we can split input tests and other tests into their own functions it will make the code more readable and easier to maintain.

Inside the Scanner class we need to clean up the payload test code. This links with #1 and #13.

@M4cs M4cs added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers Hacktoberfest Open Source 2019 Hacktoberfest Project labels Oct 11, 2019
@TotallyNotChase
Copy link
Contributor

@M4cs Hello again! I suggest wrapping this "printing results" code snippet to a function that returns a boolean like so :-

image

We can then call this function like so:-

image

That's one part's readability improved! Let's move on to the tests themselves. I'm thinking of merging the 2 tests, as in the 2 payload loops this will cut down the time required for scans by HALF! (Ofcourse, the HTML scan will still only work if and only if self.html_scan is true)
Then we can just wrap each of those tests into a function to improve readability.

image

This does mean however that there won't be any status updates in the middle saying "Completed query scan" and "Starting HTML scan". Instead we could wrap the final report as a seperate function and finally include the store_results function inside it (btw the store_results function works right?)

image

That's what I've planned for this issue. This should NOT change anything at all (I've the functional changes in another branch, not done yet), it only rewraps the code. Let me know if you'd like any changes on these screenshots, otherwise I'd open a PR!

@M4cs
Copy link
Owner Author

M4cs commented Oct 13, 2019

I think this is a good idea 👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers Hacktoberfest Open Source 2019 Hacktoberfest Project help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants