Associate Prof. X is committed to reproducible research and makes his code available. He authors a paper with Dr. Y and others.
Dr. Y is the first author of the paper and the code is shared on Ass. Prof. X's website. It is clearly stated in the paper that the code produces the graphs in the paper.
I downloaded the code, ran the code and found it works well i.e produces the same graphs in the paper. However, the code was not descriptive and easy to understand (Apparently, the variables which makes it easy to read has been changed to something difficult to understand except with much effort and time). Anyway, I studied the code and was able to clearly understand the meanings of various parts of the code. I gave the variables their proper definitions while generating the same graphs
Now, I find the graphs for some figures are not provided, then mailed Ass Prof. X, who after a while informed me that first author Dr. Y will send the code. The code was sent and I was able to understand this paper.
Currently, I am about making an extension to this work. However, I observe there are some errors in several equations in the paper which adversely affects the behavior of some graphs! Furthermore, on a deeper investigation into the paper, some inferences and propositions were made based on some of the mistakes within the paper! At a time I tried contacting Dr. Y about something I wanted to know better about the paper but I didn't get a response.
The challenge I have now is, I want to present my own paper and as well make corrections to these mistakes since it directly extends this work. How do I handle this? Do I say for example: "We corrected equation (y) in [ref] and thus, the graphs behave like this?". Also, I am thinking that since I got the code for some of the graphs (via email), I should thank the authors for sharing the code (for those graphs). However, I am not sure this is appropriate as the public gets to know implicitly that the code for some of the graphs are not provided in the paper.
Note that, I appreciate and consider it as an obligation to be straightforward in my research!