IF Commons GitHub

physical/files

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0003-findings-importers FR-006

Reading report files: a file given by name must be a report an importer reads; a folder is walked, and a JSON or XML file in it that no importer reads is skipped without a word. The findings of all the reports are given identities (the same finding in two reports is one, and the count of repeats is said), and each is kept with the file it was read from.

import { importPaths } from "./files.ts";
// await importPaths(["reports/"], { asset: "portal" }) // { findings, problems, files, repeats }

Source: commons/findings/src/physical/files.ts

1 of 4 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

physical.ImportedPathstypeno test imports it
type ImportedPaths = { readonly findings: readonly Finding[]; readonly problems: readonly string[]; readonly files: readonly { readonly source: string; readonly format: ReportFormat; readonly findings: number }[]; readonly repeats: number };

What reading several paths gave.

physical.importPathsfunctionno test imports it
function importPaths(paths: readonly string[], options?: { readonly asset?: string | undefined; }): Promise<ImportedPaths>

The findings of the reports at the paths; asset is what a SARIF report is of.

ImportedPathstypeno test imports it
type ImportedPaths = { readonly findings: readonly Finding[]; readonly problems: readonly string[]; readonly files: readonly { readonly source: string; readonly format: ReportFormat; readonly findings: number }[]; readonly repeats: number };

What reading several paths gave.

importPathsfunction
function importPaths(paths: readonly string[], options?: { readonly asset?: string | undefined; }): Promise<ImportedPaths>

The findings of the reports at the paths; asset is what a SARIF report is of.

Imported by 8 tests of the run (8 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.