Manual code review
Manual Code Review Findings¶
During the manual code review of the D21 voting system, two notable observations were made:
- Remaining Time Query Before Voting Start:
- The function
getRemainingTimereturns0when queried before the voting period has started. -
This behavior could be potentially misleading as it might be interpreted as 'no time left for voting' rather than 'voting not started.'
-
Results Retrieval Before Voting Commences:
- When
getResultsis called before the start of the voting period, it returns a list of subjects with zero votes. - This could be unexpected since the voting hasn't commenced and no votes have been cast yet. Typically, a function like this might be expected to either return an empty list or indicate that voting hasn't started.
These observations are not necessarily bugs, but they highlight areas where the system's response might be counterintuitive or unclear to users.