Measure Clojure source files and Polylith bricks.
Measure Clojure source files and Polylith bricks.
(column-text column metrics)A column's values from a map of metrics, joined with " / ".
A column's values from a map of metrics, joined with " / ".
Ordered display columns for brick metrics, each a map of :label, :description (a short tooltip), :explanation (a longer legend entry), and :keys, the metrics it shows. Mean and max function complexity share one column.
Ordered display columns for brick metrics, each a map of :label, :description (a short tooltip), :explanation (a longer legend entry), and :keys, the metrics it shows. Mean and max function complexity share one column.
(format-value k v)Brick metric k's value v for display: decimals to their precision, nil as a dash.
Brick metric k's value v for display: decimals to their precision, nil as a dash.
(function-id function)A function's identity across a workspace: its name qualified by its namespace, since bricks often have same-named functions in different namespaces.
A function's identity across a workspace: its name qualified by its namespace, since bricks often have same-named functions in different namespaces.
Ordered function metrics, each a map of :key, :label, :description (a short tooltip), and :explanation (a longer legend entry).
Ordered function metrics, each a map of :key, :label, :description (a short tooltip), and :explanation (a longer legend entry).
(label m)The display label of a violation, or of any map of :metric and optionally :scope (:brick, the default, or :function). A :label in the map wins, then the registry's label, then the metric's name.
The display label of a violation, or of any map of :metric and optionally :scope (:brick, the default, or :function). A :label in the map wins, then the registry's label, then the metric's name.
(measure-brick root brick)Measure every source file of brick (as returned by the workspace component), reading files relative to root. Returns a map of :brick, :metrics (metric key to number, or nil when undefined), :locations (metric key to the {:file :line :name} responsible for a max-* metric), :functions, and :sources (each source file's :file, :ns, :requires, :forms, and :definitions).
Measure every source file of brick (as returned by the workspace
component), reading files relative to root. Returns a map of :brick,
:metrics (metric key to number, or nil when undefined), :locations
(metric key to the {:file :line :name} responsible for a max-* metric),
:functions, and :sources (each source file's :file, :ns, :requires,
:forms, and :definitions).(measure-source file source)Measure a string of Clojure source from file (a path used for locations). Returns a map of :file, :ns and :requires (from its ns form, if any), :forms, :top-level-forms, :max-nesting-depth, :max-nesting-location, :functions (each also has :ns), and :definitions. Each definition (def, defn, defmulti, and so on) is a map of :name (a symbol), :line, and :references, the set of symbols in its body. Each function is a map of :name, :file, :line, :complexity, :depth (with :depth-line, the line of its deepest form), :forms, and :params.
Measure a string of Clojure source from file (a path used for locations). Returns a map of :file, :ns and :requires (from its ns form, if any), :forms, :top-level-forms, :max-nesting-depth, :max-nesting-location, :functions (each also has :ns), and :definitions. Each definition (def, defn, defmulti, and so on) is a map of :name (a symbol), :line, and :references, the set of symbols in its body. Each function is a map of :name, :file, :line, :complexity, :depth (with :depth-line, the line of its deepest form), :forms, and :params.
(notable-functions measurements flagged? n)The functions worth showing in a report: those for which flagged? is true, then the most complex of the rest, up to n in all (or more, if more are flagged). Each function map gets the :brick it belongs to.
The functions worth showing in a report: those for which flagged? is true, then the most complex of the rest, up to n in all (or more, if more are flagged). Each function map gets the :brick it belongs to.
(totals measurements)Brick metrics totalled across measurements: sums of counts, maxima of maxima, means of ratios, and the mean complexity of all functions. Metrics with no meaningful total (afferent, efferent) are omitted.
Brick metrics totalled across measurements: sums of counts, maxima of maxima, means of ratios, and the mean complexity of all functions. Metrics with no meaningful total (afferent, efferent) are omitted.
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 |