CodeInspector Tutorial
CodeInspector Tutorial
The functions in the CodeInspector` context provide functionality for linting of WL code.
| CodeInspect[code] | returns a list of problems found in code |
| CodeInspectSummarize[code] | returns an inspection summary object |
Needs["CodeInspector`"]str = "1+f[,2]";lints = CodeInspect[str]CodeInspectSummarize[str, lints]paclet = PacletFind["CodeInspector"][[1]];buggyCollatz = paclet["AssetLocation", "Collatz"];CodeInspect[File[buggyCollatz]]CodeInspectSummarize[File[buggyCollatz], %, ConfidenceLevel -> 0.]The linter has caught 2 strings accidentally being multiplied together with implicit Times, because the = is missing. The line should be this:
Collatz::usage = "Collatz[n] gives a list of the iterates in the 3n+1 problem,