Try to understand the meaning of each violation.
Try to search about it in Googlr
You can refer to this FAQ, to understand about UR anamoly
Click the link provided at each line and it will redirect you to the corresponding error description.
From the description of errors ,change the name of the variables used.As far as I can recall, yu have to name variables using camelCase i.e. lets say i have a variable named loss_function.This will give error ,instead use lossFunc. Also for the name data members intelligently and name should not be equal to class name.
From the given file, I can see you have mainly 5 types of issues. I’ll try explaining each of them.
For DD, DU and UR, I’ll highly recommend you go over the forum and Google. There are a lot of solutions that are easy to understand, and I feel its an easy learning curve and therefore a good opportunity for you to learn. Try doing that and if it doesn’t work, we are always here.
For the field name errors, I think it might be due to not using camelCase for naming variables. For example, you might be using PortfolioTrades PortfolioTrades instead of PortfolioTrades portfolioTrades, which may be causing the error. Just try going to mentioned line number in the given file and correcting it. A small change of letter would resolve this.
For the last one, looks like you have not declared a variable in interface but used it in implementation. You can try resolving it by adding same variable to the interface as well. Otherwise again, Google the issue. Stackoverflow should be helpful.
Let me know if the issue persists!
As much as I know, PMD rule violations need not be solved, when you solve spotbug errors that will lead you to pass the build.
I’m closing this topic due to no response from anyone since last 12 hours. If your query is resolved you can mark any reply as a solution. If you still have the query, please create a new topic paste the link of this topic in the description.