Implementing analyzer for gotta-snatch-em-all in the Java track

Hello, I was trying to find my first open source contribution project, and I found the gotta-snatch-em-all analyzer project, which I was interested in doing. I have read all the documentation about how analyzers work, I read the API that I need to use to implement the analyzer, and I even did the exercise myself to see what exactly I should focus on testing for the analyzer. I also have experience with java and apis and created my own software development projects before. So, I have a good grasp of the actual task.

However I just have a few questions on how I can actually update the repository to put my contribution.

From what I understand and have done so far:
I forked the java-analyzer repository

What I am stuck on is that the actual exercise is in the java repository but I have to do the analyzer in the java-analyzer repository. When I forked the java analyzer repository, I don’t see the exercise. So from what I understand is I am supposed to create a folder under main/java/analyzer/exercises and in it create a file called snatchEmAllAnalyzer and put the code there?

Also, when I am done with the code, am I supposed to create my own unit tests or do I just run thee global test that exists already? Last question is how do I test my code? Somewhere in the documentation it mentions something about running some docker script to test one of the analyzers. So would I just use this docker script and run it on the new file I created for the gottaSnatchEmAllAnalyzer file?

If someone could just give me the workflow for how I can get the code into the system, and additional stuff like testing and documentation I have to do it would be great. The implementation and API for the analyzer I could handle.

Thanks for taking on the task! I think you’re not too far off from what to do…

When I forked the java analyzer repository, I don’t see the exercise. So from what I understand is I am supposed to create a folder under main/java/analyzer/exercises and in it create a file called snatchEmAllAnalyzer and put the code there?

That’s right! … Although, I would suggest using the full exercise name (e.g. GottaSnatchEmAllAnalyzer), like the other analyzers, to be both consistent and make it easier to find the analyzer for the exercise.

Also, when I am done with the code, am I supposed to create my own unit tests or do I just run thee global test that exists already? Last question is how do I test my code? Somewhere in the documentation it mentions something about running some docker script to test one of the analyzers. So would I just use this docker script and run it on the new file I created for the gottaSnatchEmAllAnalyzer file?

For the unit tests, its fine to just run the ones that are already there (assuming we add smoke tests for the analyzer). Once you’ve added them, run the docker script to run the tests.

Thanks for the help. I have another question now.

I have been trying to test how to run a Java analyzer for the leap exercise. Which is this step:

image.png

This is how I wrote the command on git bash:
$ java -jar build/libs/java-analyzer.jar leap /src/main/java/analyzer/exercises/leap /tests/leap

But I am getting this error:
Exception in thread “main” java.lang.IllegalArgumentException: Not a valid directory: C:/Program Files/Git/src/main/java/analyzer/exercises/leap
at analyzer.AnalyzerCli.validateDirectory(AnalyzerCli.java:21)
at analyzer.AnalyzerCli.main(AnalyzerCli.java:34)

This is briefly how my file hierarchy looks like for the project on vscode:

image.png

image.png

Do you know how to fix it?

Thanks,

Joseph Guirguis