Hi all,
Just a quick question - I may be missing something because I am fogged up with a head cold, but CodeIt.Right Analysis seems to have started going wrong on me recently in that the Statistics seem to have gone way off beam, and it is persistently detecting two violations that are clearly incorrect.
I have a large project that before I started working on it was 20,000+ lines of code. Admittedly I have been refactoring and down-sizing the code, but not down to 2,011 lines of code that the Solution Summary is now reporting. I have removed some dead wood, but have added significant functionality too, so the stats just do not add up. Is there something that needs resetting? Is there something that has somehow got out of whack and needs a poke? Just FYI, I always run an analysis against the full Solution, so I am not just running against a selection of files (like open or checked out) which was my first thought.
Also, I have two persistent incorrect detections of "Remove Unused Locals". In both cases the "accused" variables are declared and used in two places - first in an interpolated string to display a message to a log file, and secondly as a parameter to a DataAdapter to write a record to a database logging table. The variables are clearly used, but CodeIt.Right is determined to hassle me continuously about them. Code clips of one such case are below - maybe there is some reason that someone else can spot:
Declaration
Dim machineOffAt As DateTime = DateTime.Now()
Use In Interpolated String
Dim logMessage As String = $"Machine Switched Off: {machineOffAt:dd/MM/yyyy HH:mm:ss}"
Use As Parameter To DataAdapter
dtoAdapter.WriteMachineSwitchedOffLog(machineOffAt, machineCode)
The declaration and two uses are within a few lines of each other, in the same function. How they are seen as unused locals is beyond me.
Any help appreciated. These are more petty annoyances than issues.
Steve