Liking cljdoc? Tell your friends :D

Assay: assay

11 bricks, 0 errors, 40 warnings.

Violations

MetricErrorsWarnings
🟦 Co-change02
🟪 Deep functions028
🟪 Long functions08
🟪 Many-parameter functions02
🟩 Main-sequence distance02
🟩 Duplicated forms01
🟩 Merge into01
🟫 Spread libraries01
🟧 Untyped errors01
⬜ Assertions per test01

🟦 Dependencies

Red: an unstable dependency, on a brick less stable by more than the threshold. Dashed: new since the base. Dotted amber, no arrow: bricks that change together but don't depend on each other.

graph TD
  b0(["cli"])
  b1["baseline"]
  b2["dependencies"]
  b3["git"]
  b4["github-report"]
  b5["html-report"]
  b6["metrics"]
  b7["parse"]
  b8["text-report"]
  b9["thresholds"]
  b10["workspace"]
  b0 --> b1
  b0 --> b2
  b0 --> b3
  b0 --> b4
  b0 --> b5
  b0 --> b6
  b0 --> b8
  b0 --> b9
  b0 --> b10
  b1 --> b6
  b4 --> b2
  b4 --> b6
  b4 --> b9
  b5 --> b2
  b5 --> b6
  b5 --> b9
  b6 --> b7
  b8 --> b6
  b8 --> b9
  b9 --> b6
  b2 -.- b6
  b4 -.- b5
  linkStyle 20 stroke:#b26b00,stroke-width:2px,stroke-dasharray:2 4
  linkStyle 21 stroke:#b26b00,stroke-width:2px,stroke-dasharray:2 4
BrickAfferent (Ca)Efferent (Ce)InstabilityUnstable dependenciesPositional interfaceCo-change
base cli091.000–0
component baseline110.50000
component dependencies300.00001 ⚠️
component git100.00000
component github-report130.75001 ⚠️
component html-report130.75000
component metrics610.14000
component parse100.00000
component text-report120.67000
component thresholds410.20000
component workspace100.00000
Average21.80.30000.2
What these metrics mean
MetricMeaning
Afferent (Ca)How many bricks depend on this brick's interface. A high count means a change here ripples widely, so the interface should change rarely.
Efferent (Ce)How many interfaces this brick depends on. A high count means this brick is exposed to changes in many others.
InstabilityCe / (Ca + Ce), from 0 (stable: others depend on it and it depends on little) to 1 (unstable: free to change, since nothing depends on it). Bricks should depend only on more stable bricks.
Unstable dependenciesDependencies on a brick less stable than this one: its instability is higher than this brick's by more than the limit. Bricks should depend only on more stable bricks, so that what changes often doesn't ripple into what is meant to change rarely. A small gap is noise, so only a gap past the limit counts. Threshold: error > 0.1.
Positional interfaceInterface functions that other bricks call with more positional parameters than the limit: connascence of position. Every caller depends on the order of the arguments; a map of named options doesn't. Threshold: warning > 4.
Co-changeBricks that keep changing in the same commits but don't depend on each other: coupling the source doesn't show. Counted over the Git history of :since, in pairs that share at least :min-shared commits, leaving out commits that touch more than :max-bricks-per-commit bricks. The value is the share of this brick's commits that also change the other. Threshold: warning > 0.5.
Co-change: 2 warnings
LevelBrickDetailLocation
⚠️ warningcomponent github-reportwith html-report in 16 of its 17 commits (94%), though neither depends on the other (above the maximum of 0.5)
⚠️ warningcomponent dependencieswith metrics in 7 of its 10 commits (70%), though neither depends on the other (above the maximum of 0.5)

🟪 Complexity

BrickFormsFunctionsMean function complexityMean nesting depthComplex functionsDeep functionsLong functionsMany-parameter functions
base cli961212.34.80000
component baseline465112.24.60000
component dependencies3779522.65.906 ⚠️3 ⚠️1 ⚠️
component git313111.13.50000
component github-report2048412.95.605 ⚠️1 ⚠️0
component html-report3174612.66.208 ⚠️1 ⚠️1 ⚠️
component metrics4568812.35.204 ⚠️1 ⚠️0
component parse635222.14.10000
component text-report367102.04.70000
component thresholds2255472.45.105 ⚠️2 ⚠️0
component workspace24281.43.80000
Average1709.733.22.24.902.50.70.2
What these metrics mean
MetricMeaning
FormsEvery form at any depth: collections, symbols, and literals. A measure of size that ignores formatting and comments.
Functionsdefn, defn-, defmacro, and defmethod definitions.
Mean function complexityThe mean cyclomatic complexity of the brick's functions. A rising mean means the brick as a whole is getting harder to follow. Complex functions counts the most complex. Bricks with fewer than 5 functions aren't compared: a mean of so few says little.
Mean nesting depthThe mean nesting depth of the brick's functions. See deep functions. Bricks with fewer than 5 functions aren't compared.
Complex functionsFunctions whose cyclomatic complexity is above the limit: 1 plus a decision point for each if, when, cond clause, and and or argument, catch, and the like. Threshold: error > 10.
Deep functionsFunctions nested deeper than the limit. Each collection inside another adds a level; a binding form's bindings start again at 1, and reader macros such as @ and ' add nothing. Threshold: warning > 8.
Long functionsFunctions of more forms than the limit, counting every form in them. Threshold: warning > 150.
Many-parameter functionsFunctions with more positional parameters than the limit, in their longest arity, not counting & rest parameters. Threshold: warning > 4.
Functions: 31 warnings
LevelBrickDetailLocation
⚠️ warningcomponent html-reportsection-table: depth 12 > 8 (line 587), forms 283 > 150, params 5 > 4components/html-report/src/systems/thoughtfull/assay/html_report/core.clj:555
⚠️ warningcomponent github-reportsection-table: depth 12 > 8 (line 373), forms 256 > 150components/github-report/src/systems/thoughtfull/assay/github_report/core.clj:341
⚠️ warningcomponent metricsprivate?: depth 12 > 8 (line 899)components/metrics/src/systems/thoughtfull/assay/metrics/core.clj:888
⚠️ warningcomponent metricsinterop?: depth 12 > 8 (line 1053)components/metrics/src/systems/thoughtfull/assay/metrics/core.clj:1038
⚠️ warningcomponent dependenciesanalyze: depth 11 > 8 (line 49)components/dependencies/src/systems/thoughtfull/assay/dependencies/errors.clj:30
⚠️ warningcomponent dependenciesanalyze: depth 11 > 8 (line 40)components/dependencies/src/systems/thoughtfull/assay/dependencies/tests.clj:22
⚠️ warningcomponent metricsmeasure-test-source: depth 11 > 8 (line 1174)components/metrics/src/systems/thoughtfull/assay/metrics/core.clj:1156
⚠️ warningcomponent thresholdsstd-devs-result: depth 11 > 8 (line 172), forms 155 > 150components/thresholds/src/systems/thoughtfull/assay/thresholds/core.clj:157
⚠️ warningcomponent dependenciesanalyze: forms 202 > 150components/dependencies/src/systems/thoughtfull/assay/dependencies/libraries.clj:82
⚠️ warningcomponent metricsmeasure-brick: depth 10 > 8 (line 1214), forms 192 > 150components/metrics/src/systems/thoughtfull/assay/metrics/core.clj:1193
⚠️ warningcomponent dependenciesmermaid: depth 9 > 8 (line 274), forms 191 > 150components/dependencies/src/systems/thoughtfull/assay/dependencies/core.clj:260
⚠️ warningcomponent dependenciesduplicates: depth 10 > 8 (line 89)components/dependencies/src/systems/thoughtfull/assay/dependencies/connascence.clj:70
⚠️ warningcomponent dependenciesanalyze: depth 10 > 8 (line 87), forms 180 > 150components/dependencies/src/systems/thoughtfull/assay/dependencies/core.clj:60
⚠️ warningcomponent dependenciesdependency-metrics: params 5 > 4components/dependencies/src/systems/thoughtfull/assay/dependencies/core.clj:46
⚠️ warningcomponent html-reporttable: depth 10 > 8 (line 213)components/html-report/src/systems/thoughtfull/assay/html_report/core.clj:202
⚠️ warningcomponent html-reportmetric-headers: depth 10 > 8 (line 222)components/html-report/src/systems/thoughtfull/assay/html_report/core.clj:215
⚠️ warningcomponent html-reportlegend: depth 10 > 8 (line 627)components/html-report/src/systems/thoughtfull/assay/html_report/core.clj:617
⚠️ warningcomponent thresholdscounts: depth 10 > 8 (line 302)components/thresholds/src/systems/thoughtfull/assay/thresholds/core.clj:282
⚠️ warningcomponent thresholdsworst-first: depth 10 > 8 (line 401)components/thresholds/src/systems/thoughtfull/assay/thresholds/core.clj:396
⚠️ warningcomponent dependenciesanalyze: depth 9 > 8 (line 73)components/dependencies/src/systems/thoughtfull/assay/dependencies/cohesion.clj:53
11 more
LevelBrickDetailLocation
⚠️ warningcomponent github-reportlevel-counts: depth 9 > 8 (line 249)components/github-report/src/systems/thoughtfull/assay/github_report/core.clj:245
⚠️ warningcomponent github-reportlegend: depth 9 > 8 (line 299)components/github-report/src/systems/thoughtfull/assay/github_report/core.clj:290
⚠️ warningcomponent github-reportshown-bricks: depth 9 > 8 (line 327)components/github-report/src/systems/thoughtfull/assay/github_report/core.clj:319
⚠️ warningcomponent github-reportshared-libraries-table: depth 9 > 8 (line 421)components/github-report/src/systems/thoughtfull/assay/github_report/core.clj:412
⚠️ warningcomponent html-reportlevel-counts: depth 9 > 8 (line 360)components/html-report/src/systems/thoughtfull/assay/html_report/core.clj:354
⚠️ warningcomponent html-reportmetric-link: depth 9 > 8 (line 408)components/html-report/src/systems/thoughtfull/assay/html_report/core.clj:404
⚠️ warningcomponent html-reportshown-bricks: depth 9 > 8 (line 550)components/html-report/src/systems/thoughtfull/assay/html_report/core.clj:542
⚠️ warningcomponent html-reportshared-libraries-table: depth 9 > 8 (line 783)components/html-report/src/systems/thoughtfull/assay/html_report/core.clj:771
⚠️ warningcomponent thresholdsmerge-config: depth 9 > 8 (line 104)components/thresholds/src/systems/thoughtfull/assay/thresholds/core.clj:97
⚠️ warningcomponent thresholdsviolations :count: depth 9 > 8 (line 265)components/thresholds/src/systems/thoughtfull/assay/thresholds/core.clj:249
⚠️ warningcomponent thresholdscheck-settings: forms 154 > 150components/thresholds/src/systems/thoughtfull/assay/thresholds/core.clj:48

🟩 Modularity

BrickAbstractnessMain-sequence distanceCohesionShared keywordsDuplicated formsMerge into
base cli–––00–
component baseline0.820.320.8700–
component dependencies0.930.071.0000–
component git0.640.361.0000–
component github-report0.950.70 ⚠️0.70049 ⚠️–
component html-report0.980.73 ⚠️0.74049 ⚠️–
component metrics0.820.030.7600–
component parse0.700.301.0000metrics (14%) ⚠️
component text-report0.900.570.7100–
component thresholds0.810.010.8600–
component workspace0.780.221.0000–
Average0.830.330.8608.914%
What these metrics mean
MetricMeaning
Abstractness1 - public interface definitions / all definitions, counting def, defn, defmethod, and the like. A small interface over a large implementation scores near 1. Private definitions in an interface namespace aren't interface. Bases have no interface, so no abstractness. Main-sequence distance weighs it against instability.
Main-sequence distance\|abstractness + instability - 1\|. A stable component (low instability) should be abstract, hiding its implementation behind a small interface, and an unstable one needn't be. Near 0 is balanced. Near 1 is either stable and concrete, hard to change though much depends on it, or abstract and unstable, an interface little uses. Threshold: warning > 0.7.
Cohesionown references / workspace references: how much the component's code refers to its own namespaces rather than to other bricks. References to libraries don't count. A low value means the component is mostly glue between other bricks. Bases are glue by design, so they have none. Components with fewer than 10 workspace references aren't checked: there is too little to go on. Threshold: warning < 0.5.
Shared keywordsQualified keywords this brick uses that another brick also uses, such as :patient/id: map keys and values that both must agree on (connascence of meaning). Renaming one means changing every brick that shares it. Unqualified keywords, such as :id or HoneySQL's :select, are too generic to say which bricks agree on what.
Duplicated formsForms of code that appears in another brick too, in duplicates of more forms than the limit, compared after formatting and comments: connascence of algorithm. A fix to one copy has to be made to the other. Threshold: warning > 30.
Merge intoFor a component used by a single component: that component, and this one's size as a share of its forms. A component that small, with one user, may belong inside it. Below the limit, it's flagged. Threshold: warning < 0.25.
Main-sequence distance: 2 warnings
LevelBrickDetailLocation
⚠️ warningcomponent html-report0.73 is above the maximum of 0.7
⚠️ warningcomponent github-report0.7 is above the maximum of 0.7
Duplicated forms: 1 warning
LevelBrickDetailLocation
⚠️ warningcomponent github-report49 forms in each of github-report, html-report, the same code (more than 30)components/github-report/src/systems/thoughtfull/assay/github_report/core.clj:247
components/html-report/src/systems/thoughtfull/assay/html_report/core.clj:357
Merge into: 1 warning
LevelBrickDetailLocation
⚠️ warningcomponent parseis used only by metrics, and has 14% as many forms; consider merging it into metrics (below the minimum of 0.25)

🟫 I/O and mutability

BrickLibrariesSpread librariesInterop densityMutable state
base cli21 ⚠️1.00
component baseline000.20
component dependencies000.10
component git11 ⚠️3.50
component github-report000.10
component html-report000.10
component metrics21 ⚠️0.10
component parse100.00
component text-report000.00
component thresholds000.30
component workspace11 ⚠️5.00
Average0.60.40.90

Bold: 2 or more standard deviations worse than the mean of the other bricks the metric checks. Only ratios, densities, and means are outlined.

What these metrics mean
MetricMeaning
LibrariesLibraries outside the workspace that the brick requires, named by their namespaces, such as next.jdbc or clojure.java.io. Clojure's own pure namespaces, such as clojure.string, don't count.
Spread librariesLibraries this brick requires that more bricks than the limit require. A library wrapped by one brick can be replaced or upgraded in one place; a library spread across bricks, such as a database driver, means a missing gateway component. Libraries in :allow don't count. Threshold: warning > 3.
Interop densityHost interop forms per 100 forms, so that large and small bricks compare fairly: Java or JavaScript method calls, field access, constructors, static members, and js/ references. A component that wraps a host API is dense by design; interop scattered through domain logic isn't. Threshold: warning > 5.
Mutable stateTop-level atom, ref, agent, and volatile! definitions, ^:dynamic vars, and alter-var-root calls: state hidden from the functions that depend on it, which makes tests interfere with each other. Threshold: warning > 0.

Shared libraries

LibraryBricksSpreadRequired by
clojure.java.io4⚠️ warningcli, git, metrics, workspace
rewrite-clj2 metrics, parse

🟧 Error handling

BrickError surfaceUntyped errorsBroad catches
base cli–10
component baseline0.0000
component dependencies0.0000
component git1.001 ⚠️0
component github-report0.0000
component html-report0.0000
component metrics0.0000
component parse0.0000
component text-report0.0000
component thresholds0.1000
component workspace0.0000
Average0.110.10

Bold: 2 or more standard deviations worse than the mean of the other bricks the metric checks. Only ratios, densities, and means are outlined.

What these metrics mean
MetricMeaning
Error surfaceThe share of a component's public interface definitions that can throw: their body contains throw or throw+, or refers to a definition that can, in this brick or another. Each is a failure every caller must be ready for; the fewer, the simpler the interface. Throws in libraries aren't seen. Bases have no interface.
Untyped errorsThrows that give callers nothing to tell failures apart by: a host exception such as (Exception. msg) or (js/Error. msg), or ex-info whose data map has no :type key (or :cognitect.anomalies/category). Rethrows, and data that isn't a literal map, don't count. Threshold: warning > 0.
Broad catchescatch clauses for Exception, RuntimeException, Throwable, or Object, or ClojureScript's :default, js/Error, or js/Object, that log and carry on, or carry on silently. In a component, a broad catch decides for every caller what a failure means. A catch that rethrows, such as wrapping the failure in an ex-info of the component's own, doesn't count: that translates a failure rather than hiding it. Threshold: warning > 0.
Untyped errors: 1 warning
LevelBrickDetailLocation
⚠️ warningcomponent gitthrows ex-info without a :type in its datacomponents/git/src/systems/thoughtfull/assay/git/core.clj:14

⬜ Tests

BrickTestsAssertions per testForms per testUntested interfaceBoundary crossingsIsolation hazardsTest ratio
base cli84.080.6–000.86
component baseline61.792.80.00001.32
component dependencies222.7104.80.00000.83
component git33.0110.70.00001.37
component github-report172.650.80.00000.51
component html-report193.351.90.00000.37
component metrics244.1 ⚠️84.50.42000.46
component parse62.256.20.14000.56
component text-report41.022.50.00000.59
component thresholds122.9111.60.20000.64
component workspace21.569.50.00000.71
Average11.22.575.50.08000.75

Bold: 2 or more standard deviations worse than the mean of the other bricks the metric checks. Only ratios, densities, and means are outlined.

What these metrics mean
MetricMeaning
Testsdeftest forms in the brick's test directory.
Assertions per testThe mean number of is and are assertions per deftest. A test with many assertions checks many things, so a failure says less about what broke. Bricks with fewer than 10 tests aren't compared. Threshold: warning > mean + 2σ.
Forms per testThe mean size of a deftest, in forms. Large tests usually set up a lot of state or check many behaviors at once. Bricks with fewer than 10 tests aren't compared. Threshold: warning > mean + 2σ.
Untested interfaceThe share of a component's public interface definitions that no test anywhere in the workspace mentions: API with no test at all. Components with fewer than 10 definitions aren't checked. Bases have no interface. Threshold: warning > 0.5.
Boundary crossingsRequires, in this brick's tests, of another brick's source namespaces other than its interface. Tests that reach into an implementation break when it changes, though its interface didn't. Another brick's test namespaces, such as shared generators, don't count. Threshold: warning > 0.
Isolation hazardsThings in tests that let tests affect each other or depend on timing: with-redefs, Thread/sleep, alter-var-root, and top-level atoms, refs, agents, volatiles, and dynamic vars.
Test ratioTest forms per source form. A crude measure of how much testing a brick has; compare it with other bricks rather than aim for a number.
Assertions per test: 1 warning
LevelBrickDetailLocation
⚠️ warningcomponent metrics4.08 is 4.0 standard deviations above the mean of 4 other components (2.9 ± 0.3), over the limit of 2

Can you improve this documentation?Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close