alexandreborges / malwoverview

Malwoverview is a first response tool used for threat hunting and offers intel information from Virus Total, Hybrid Analysis, URLHaus, Polyswarm, Malshare, Alien Vault, Malpedia, Malware Bazaar, ThreatFox, Triage, InQuest and it is able to scan Android devices against VT.
https://github.com/alexandreborges/malwoverview
GNU General Public License v3.0
2.85k stars 439 forks source link

Cleaning up logical errors and syntax #14

Closed naveennamani closed 3 years ago

naveennamani commented 3 years ago

Hi Alexander,

This is a great tool, and it can be improved quite a lot by refactoring and tweeking the code a little so that it can be easily maintainable and easy to follow up for someone who wants to improve.

As I'm going through the code I noticed a lot of places where the logics are shortcircuited, like in packed function, the condition n<3 will never reach, and the whole if conditions block can be replaced with a single return condition.

Also, in some functions there is a repeated code in both if and else conditions which can be easily refactored to make it less confusing and more self explanatory.

I'm making changes as I'm going through the code, so you can expect a pull request by tomorrow or day after tomorrow. Meanwhile I'm informing you for ensuring that you're not adding any new features or changing the existing code which can broke my pull request.

I've few more suggestions on how we can refactor the code into small pieces, which we can discuss if you're interested after I go through the complete code.

Have a good day.

Thanks & Regards, Naveen Namani

alexandreborges commented 3 years ago

Mr. Naveen,

Good morning. How are you?

Thank you for your message. I'm aware on several points in the code that could be refactored, but I'll do it piece by piece because some of them can cause few side effects. The same explanation applies to repeated code, where I did it intentionally for having more freedom to change it later without breaking two or more functions when I change it.

As the tool has a reasonable number of features, so my next steps will be to refactor and change several pieces of the code, but I'll do it slowly because I'm very busy in doing researches in my job. Thus, I'm keeping the code frozen for some weeks.

Certainly, I'll be in touch with you when I decide to start the this process.

Thank you for you message and have an excellent day.

Warm regards,

Alexandre.

naveennamani commented 3 years ago

Thanks for your reply.

You can surely reopen this issue and comment when you are ready for refactoring.