codeinspector
codeinspector copied to clipboard
Some important CodeInspect hints do not get shown (too low confidence?)
The code error Which[a, b, a, c] gets picked up by the plugin, but a related one like Which[a, b, c] does not. Presumably this is because CodeInspect assigns a relatively low confidence (0.55) to this case?
CodeInspect["Which[a, b, a, c]"]
CodeInspect["Which[a, b, c]"]
This is rather unfortunate, since this is a pretty important and common error to catch. I don't know what the proper solution is, but I feel like this is worth addressing.
The problem is that issues that have to do with argument counts (like CodeInspect["Which[a, b, c]"]) do not currently have good technology for distinguishing when a pattern sequence represents the correct arguments.
I mean like with:
CodeInspect["foo[c___] := Which[a, b, c]"]
where c is actually a sequence of arguments.
It would be really good for CodeInspector` to get to the point of understanding these things.
So issues about argument counts have low confidence (for now).