Coverage audit
The coverage audit is how Niro learns what it fails to read in real code. While building, the engine notes the lines it could not make sense of. For example, a call it could not link, or a framework it does not know. A small, masked piece of the code around each such line is sent to Niro, so support for that kind of code can be added.
What exactly is sent
For each flagged line:
- the method that holds it, or, outside a method, the 10 lines before and the 40 lines after;
- one line for each name that piece uses that is defined in the same file;
- every other line of the file is sent blank, so line numbers still match. A whole file is never sent;
- the file's path inside the repository, so the gap can be found.
Before it leaves your computer:
- secrets are masked by the engine, in the code and in the path;
- the names of authors and companies become
<author>and<company>.
Separately, the audit sends a list of the libraries and kinds of files the build saw. That list carries no file names or paths.
When and on which plans
The audit is sent on every plan. It does not depend on the code-sharing switch. The background watcher sends it every 5 minutes. You can also send it yourself with niro audit-send.
There is no switch to turn it off in niro. For what Niro may keep and do with what it receives, read Niro's Data Processing Agreement, summarised in What leaves your machine.
See it before it is sent
niro audit # what is waiting to be sent
niro audit --export DIR # write the waiting items to a folder, to read them
Code sharing is a separate choice
"Share redacted code" is a switch on your account, in the console under Settings, Privacy. Switching it on is your consent; nothing more is asked on your computer. It does two things:
- it removes the line limit on the Free plan;
- the background watcher shares the files Niro indexes in each folder on your computer, by itself, with secrets masked and author and company names removed first: the whole indexed set the first time, then only changed files. A folder you keep out with
niro share exclude <folder>is never sent.
niro audit-push-repo is separate from the switch. It is how you send one folder's indexed files to Niro when something is wrong and you want us to look at it. It works with the switch on or off, on every plan: typing it and answering yes is the consent. The files are the same and are masked the same way. For a folder you excluded, it asks "Send it anyway?" first and sends only on yes.
Turning the switch off stops the sharing: nothing more is sent after the next check. niro uninstall does not turn the switch off. Turn it off in the console.