Check brick measurements and findings against thresholds.
The config maps each report section (:dependencies, :complexity, :modularity, :io, :errors, :tests) to its metrics, and each metric to its settings: a :warning and an :error threshold, and any options the metric has, such as :allow for :library-spread. A threshold is a number, or for a metric of a brick's own value, {:std-devs k}, which flags a brick more than k sample standard deviations past the mean of the other bricks the metric checks (with at least :min-peers of them, default 3).
What a threshold means comes from the metric (see metrics/metrics): its :direction says whether values above (:max) or below (:min) the limit are flagged, its :checks which brick types are checked, and its :kind what is compared. A value past both thresholds is an error. A nil threshold turns that level off, and a nil metric turns the metric off.
Check brick measurements and findings against thresholds.
The config maps each report section (:dependencies, :complexity,
:modularity, :io, :errors, :tests) to its metrics, and each metric to
its settings: a :warning and an :error threshold, and any options the
metric has, such as :allow for :library-spread. A threshold is a
number, or for a metric of a brick's own value, {:std-devs k}, which
flags a brick more than k sample standard deviations past the mean of
the other bricks the metric checks (with at least :min-peers of them,
default 3).
What a threshold means comes from the metric (see metrics/metrics): its
:direction says whether values above (:max) or below (:min) the limit
are flagged, its :checks which brick types are checked, and its :kind
what is compared. A value past both thresholds is an error. A nil
threshold turns that level off, and a nil metric turns the metric off.(by-severity violations)Violations sorted most severe first: errors before warnings, then by how far each value is past its limit, relative to the limit.
Violations sorted most severe first: errors before warnings, then by how far each value is past its limit, relative to the limit.
(check config measurements findings)Check measurements (as returned by the dependencies component) and findings, a map of metric key to findings (each a map of :brick, and optionally :value, :subject, :location, :message, and :historical?), against merged config. Returns a map of :bricks, the measurements with the values of :function, :finding, and :count metrics added to :metrics, and :violations, each a map of :metric, :section, :kind, :direction, :brick, :value, :limit, :level, :message, and when known :subject, :location, :stats, and :historical?; a function's violation also has :function-line, the line it is defined on, where :location is at the metric's line (such as the deepest form, for depth).
Check measurements (as returned by the dependencies component) and findings, a map of metric key to findings (each a map of :brick, and optionally :value, :subject, :location, :message, and :historical?), against merged config. Returns a map of :bricks, the measurements with the values of :function, :finding, and :count metrics added to :metrics, and :violations, each a map of :metric, :section, :kind, :direction, :brick, :value, :limit, :level, :message, and when known :subject, :location, :stats, and :historical?; a function's violation also has :function-line, the line it is defined on, where :location is at the metric's line (such as the deepest form, for depth).
The settings used when no configuration overrides them, shaped like the config: section to metric to settings.
The settings used when no configuration overrides them, shaped like the config: section to metric to settings.
(describe config k)Metric k's thresholds in merged config, such as "warning > 8, error > 10", or nil when it has none.
Metric k's thresholds in merged config, such as "warning > 8, error > 10", or nil when it has none.
(merge-config config)Merge config over the defaults, metric by metric and setting by setting, so {:complexity {:function-depth {:error 12}}} keeps the default warning. Throws, with :type :systems.thoughtfull.assay.thresholds.core/invalid-config in its data, for an unknown section, metric, or setting, a metric under the wrong section, or a malformed threshold.
Merge config over the defaults, metric by metric and setting by
setting, so {:complexity {:function-depth {:error 12}}} keeps the
default warning. Throws, with :type
:systems.thoughtfull.assay.thresholds.core/invalid-config in its data,
for an unknown section, metric, or setting, a metric under the wrong
section, or a malformed threshold.(row-text row)What a row (from rows) says, as plain text: each of a function's metrics past its limit, such as "complexity 12 > 10, depth 9 > 8 (line 7)"; how widely a library is required, and by which bricks; which bricks share a duplicate; or what its one violation says.
What a row (from rows) says, as plain text: each of a function's metrics past its limit, such as "complexity 12 > 10, depth 9 > 8 (line 7)"; how widely a library is required, and by which bricks; which bricks share a duplicate; or what its one violation says.
(rows violations)Violations grouped into the rows reports show, one per finding: a function's violations across its metrics, a library's spread across its bricks, and a duplicate's copies are one row each. Each row is a map of :group (the metric key, or :function-rows for a function's row), :section, :metric (its first violation's), :subject, :value, :level (the worst), :status (new if any violation is), :bricks, :locations, and :violations. Rows are most severe first: errors, then by how far past the limit.
Violations grouped into the rows reports show, one per finding: a function's violations across its metrics, a library's spread across its bricks, and a duplicate's copies are one row each. Each row is a map of :group (the metric key, or :function-rows for a function's row), :section, :metric (its first violation's), :subject, :value, :level (the worst), :status (new if any violation is), :bricks, :locations, and :violations. Rows are most severe first: errors, then by how far past the limit.
(settings config k)The settings of metric k in merged config, or nil when it has none or is off.
The settings of metric k in merged config, or nil when it has none or is off.
(threshold-text metric t)Threshold t of metric (a registry entry) in short notation, the values it flags, such as "> 10", "< 0.5", or "> mean + 2σ"; nil for nil.
Threshold t of metric (a registry entry) in short notation, the values it flags, such as "> 10", "< 0.5", or "> mean + 2σ"; nil for nil.
(worse-level a b)The more severe of two levels: :error, :warning, or nil for none.
The more severe of two levels: :error, :warning, or nil for none.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |