Dynamic Application Scanning Tools (DAST) like ZAP attack an application from the "outside".
DAST tools to not look at or understand source code.
For that you need to use a Static Application Scanning Tool (SAST).
DAST and SAST tools work in different ways are are complimentory - they both have diffrent strengths and weaknesses.
One of DASTs strengths is that it can be used to test apps written in any language - it is not technology specific. One of it's disadvantages is that because it does not understand source code it cannot tell you which lines of code to look at.
Cheers,
Simon