blabla1337 / skf-flask

Security Knowledge Framework (SKF) Python Flask / Angular project
https://www.securityknowledgeframework.org
Apache License 2.0
805 stars 308 forks source link

Creating requirements hangs when answering no to all questionnaire question #735

Closed Superpiojo17 closed 2 years ago

Superpiojo17 commented 3 years ago

If you go through the process of creating a new set of requirements, and you answer no to all the questions in the questionnaire, the tool hangs. Additionally, it seems that the requirement functionality does not working correctly after you run into this bug. I have tracked down the part of the code that causes this and have provided a screenshots. The code file is https://github.com/blabla1337/skf-flask/blob/main/skf/api/questions/business.py specifically line 36. As you can see from my print statements, if you answer no to all of the questions, Data is empty. Therefore you never enter the for loop and never set project id. So when you get down to line 40, you are trying to pass in project_id, but it has not been defined (since you never went into the for loop b/c data is empty). I hope my screenshots explain the situation well enough.

bugCode error printStatement frontEndError2
Superpiojo17 commented 3 years ago

Upon more digging, I think the real issue lies in https://github.com/blabla1337/skf-flask/blob/main/Angular2/src/app/pages/projects/wizard/wizard.component.ts on line 141. It only checks if count_sprint == 0, but it should check if count_sprint == 0 || this.sprintStore.length == 0

as well, or at least that is what I believe.

blabla1337 commented 3 years ago

Thank you for the impressive debugging, we really appreciate it! I will give it a try locally and see if it resolved the issue

blabla1337 commented 2 years ago

@Superpiojo17 Thank you for the suggested fix and we had implemented it a while ago already but the ticket was still open :)