Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Low quality code #75

Open
ragri8 opened this issue Sep 23, 2021 · 0 comments
Open

Low quality code #75

ragri8 opened this issue Sep 23, 2021 · 0 comments

Comments

@ragri8
Copy link

ragri8 commented Sep 23, 2021

Is this project still alive?

I've just been asigned at my job with an old project using an old fork of this one and I came here to see if any improvement have been made since.

Let's ignore for now the PEP8 styling issues (right now my IDE gives me 1 issue every 2 lines of code in subbrute.py, I'm not even kidding! CamelCase convention for class name, bad spacing around params, number of blank lines, too broad exception clause, invalid typing like a function expecting a boolean and receiving an int?, etc.)

In a short amount of time, I found 2 severe issues in subbrute.py:

  • The class "resolver" shadowname itself inside the method "add_ns(self, resolver)". This is a red flag that could blow in your face at any moment. Hopefully you could just rename in CamelCase the class to fix this issue
  • Also with the class "resolver", the init method use a mutable type as a parameter. This means that if the parameter "nameservers" is modified (directly or simply by calling the init method with a new value for "nameservers"), then the next call to the method done using the default parameter will instead use the modified one, giving unexpected results to the user and making it pretty hard to debug it. So unless you wanted it to use it as a cache (doesn't seems like so rn) you should use None as the default value and then, within the method, if the parameter is still None, assign it with the value of your list.

I don't have time to actually take part more than that in your project (my project actually use a dozen of forks from other legacy code like this one) but at least seeing the popularity of it I wanted to let you know of some improvement you could do.

In fact, I recommend any developper working on this to download a good IDE with strong inspection like Pycharm (community edition is free) and follow the PEP8 guidelines. It won't make the code faster, but the debugging will be.

P.S. sorry if I sound rude, I just wanted to give my two cents as a programmer rather than a pentester

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant