Public report of barrel-db/barrel, published 15 November 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 15 November 2026, 07:52 UTC · Survey ID cd_91db4c7ec93e4ab8b3b87b0a70e4af55

barrel-db/barrel

Measured 15 November 2026, 07:43 UTC, at code version 794415d

Code coverage is not measured: JavaScript/TypeScript suite (CouldNotMeasureNoCollector).

Dependency hygiene is not measured: Python distributions read, dependency currency not.

CAI score 53out of 100 At risk Up 1 since the last survey

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A medium codebase: 84,956 lines of product code in 17 projects, tests not counted · Estimated rebuild effort: about 1.0 person-years · Weakest lens: Event-Driven, 35

Findings by how serious they are

61 critical 491 serious 50 minor

20 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
15 November 2026, 07:43 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that implements it, and today the Canine Code Analyzer is the only one that does.

A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.

The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

56of 56 dimensions measured by tools.
575of 602 findings point to an exact file and line, so you can open each one in the code. The other 27 concern the repository as a whole, such as missing documentation.
56dimensions across 8 lenses, read from 84,956 lines of product code in 17 projects.
Chapters

Executive summary

barrel-db/barrel is rated At risk because critical security findings are open, most of them in the build pipeline. It scores 53 out of 100, which the At risk rating leaves unchanged.

Event-Driven, at 35, is the weakest lens and counts most in the score. The best first step is stopping the event handlers from waiting on other services, worth about 15 points. Raising Event-Driven to 70 would lift the score to about 67.

Fifty-one pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Five known security holes in the packages the code depends on can be used by attackers, and three secrets can leak from the build pipeline. Pinning each tool to an exact version, updating the vulnerable packages and limiting each secret to its own step would close these risks. The two pipeline steps that run downloads without checking them need each download checked against a known checksum first.

The product code is 84,956 lines, about €140,000 to rebuild.

A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Event-Driven 35 · counts for 45%Security and Compliance 62 · counts for 25%Production Readiness 68 · counts for 14%Code Health 70 · counts for 8%Maturity 74 · counts for 4%Architecture 98 · counts for 2%Event Sourcing 100 · counts for 1%Performance 100 · counts for 1%

If Event-Driven rose from 35 to 70, the lowest score rated Strong, the score would rise from 53 to about 67.

Code composition: what the lines of code are
Product code 59%Tests 41%
New since the last survey: 227 findings

These 227 critical or serious findings weren't in the previous survey, on 30 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.

  • Cyclomatic Complexity · barrel_db_server.handle_call_rw (cyclomatic 49) apps/barrel_docdb/src/barrel_db_server.erl
  • Cyclomatic Complexity · barrel_db_server.do_write_state (cyclomatic 31) apps/barrel_docdb/src/barrel_db_server.erl
  • Cyclomatic Complexity · barrel_changes.get_changes_filtered_chunked (cyclomatic 16) apps/barrel_docdb/src/barrel_changes.erl
  • Cyclomatic Complexity · barrel_db_server.build_write_ops (cyclomatic 16) apps/barrel_docdb/src/barrel_db_server.erl
  • Cognitive Complexity · barrel_db_server.do_write_state (cognitive 38) apps/barrel_docdb/src/barrel_db_server.erl
  • Cognitive Complexity · barrel_db_server.do_repair_bodies (cognitive 27) apps/barrel_docdb/src/barrel_db_server.erl
  • Cognitive Complexity · puller.pull (cognitive 25) clients/barrel-lite/src/sync/puller.ts
  • Cognitive Complexity · barrel_db_server.handle_call_rw (cognitive 21) apps/barrel_docdb/src/barrel_db_server.erl
  • Cognitive Complexity · pusher.push (cognitive 19) clients/barrel-lite/src/sync/pusher.ts
  • Cognitive Complexity · barrel_db_server.do_resolve_conflict (cognitive 18) apps/barrel_docdb/src/barrel_db_server.erl
  • Cognitive Complexity · barrel_rep.finish_one_shot (cognitive 16) apps/barrel_docdb/src/barrel_rep.erl
  • Cognitive Complexity · barrel_rep_att.reconcile_loop (cognitive 16) apps/barrel_docdb/src/barrel_rep_att.erl
  • Cognitive Complexity · barrel_store_rocksdb.encode_entity (cognitive 16) apps/barrel_docdb/src/barrel_store_rocksdb.erl
  • God Classes · TooManyFunctions: barrel_server_auth apps/barrel_server/src/barrel_server_auth.erl
  • God Classes · FileTooLong: src/barrel_session.erl apps/barrel_spaces/src/barrel_session.erl
  • God Classes · TooManyFunctions: barrel_att_feed apps/barrel_docdb/src/barrel_att_feed.erl
  • God Classes · TooManyFunctions: barrel_live apps/barrel_docdb/src/barrel_live.erl
  • God Classes · FileTooLong: src/barrel_rep.erl apps/barrel_docdb/src/barrel_rep.erl
  • God Classes · TooManyFunctions: barrel_rep_att apps/barrel_docdb/src/barrel_rep_att.erl
  • Code Duplication · Edited copy of a member (132 corresponding lines) apps/barrel_docdb/src/barrel_db_server.erl
  • Code Duplication · Edited copy of a member (104 corresponding lines) apps/barrel_docdb/src/barrel_query.erl
  • Code Duplication · Edited copy of a member (34 corresponding lines) apps/barrel_server/src/barrel_server_mcp_agent.erl
  • Code Duplication · Edited copy of a member (25 corresponding lines) apps/barrel_docdb/src/barrel_ars_index.erl
  • Code Duplication · Edited copy of a member (32 corresponding lines) apps/barrel_docdb/src/barrel_parallel.erl
  • Code Duplication · Edited copy of a member (32 corresponding lines) apps/barrel_docdb/src/barrel_changes.erl
  • Code Duplication · Edited copy of a member (48 corresponding lines) apps/barrel_docdb/src/barrel_query.erl
  • Code Duplication · Edited copy of a member (41 corresponding lines) apps/barrel_docdb/src/barrel_docdb_codec_cbor.erl
  • Code Duplication · Edited copy of a member (35 corresponding lines) apps/barrel_docdb/src/barrel_query.erl
  • Code Duplication · Edited copy of a member (17 corresponding lines) apps/barrel_docdb/src/barrel_history.erl
  • Code Duplication · Edited copy of a member (38 corresponding lines) apps/barrel_docdb/src/barrel_rep_att.erl
  • Code Duplication · Edited copy of a member (26 corresponding lines) apps/barrel_docdb/src/barrel_query.erl
  • Code Duplication · Edited copy of a member (35 corresponding lines) apps/barrel_docdb/src/barrel_query.erl
  • Code Duplication · Edited copy of a member (23 corresponding lines) apps/barrel_spaces/src/barrel_session.erl
  • Code Duplication · Edited copy of a member (20 corresponding lines) apps/barrel_docdb/src/barrel_ars_index.erl
  • Code Duplication · Edited copy of a member (33 corresponding lines) apps/barrel_docdb/src/barrel_changes.erl
  • Code Duplication · Edited copy of a member (23 corresponding lines) apps/barrel_embed/src/barrel_embed_cohere.erl
  • Code Duplication · Edited copy of a member (25 corresponding lines) apps/barrel_docdb/src/barrel_db_server.erl
  • Code Duplication · Edited copy of a member (27 corresponding lines) apps/barrel_docdb/src/barrel_docdb_app.erl
  • Code Duplication · Edited copies of one member (3 members, 23+ corresponding lines) apps/barrel_docdb/src/barrel_query.erl
  • Code Duplication · Edited copy of a member (14 corresponding lines) apps/barrel/src/barrel_record_backfill.erl
  • Code Duplication · Edited copies of one member (6 members, 21+ corresponding lines) apps/barrel_docdb/src/barrel_ars_index.erl
  • Code Duplication · Edited copy of a member (14 corresponding lines) apps/barrel_spaces/src/barrel_handoff.erl
  • Code Duplication · Edited copy of a member (32 corresponding lines) apps/barrel_docdb/src/barrel_query.erl
  • Code Duplication · Edited copy of a member (14 corresponding lines) apps/barrel_ngram/src/barrel_ngram_query.erl
  • Code Duplication · Edited copy of a member (17 corresponding lines) apps/barrel_server/src/barrel_server_mcp_agent.erl
  • Code Duplication · Edited copy of a member (23 corresponding lines) apps/barrel_docdb/src/barrel_bql_exec.erl
  • Code Duplication · Edited copy of a member (15 corresponding lines) apps/barrel_docdb/src/barrel_query.erl
  • Code Duplication · Edited copy of a member (29 corresponding lines) apps/barrel_ngram/src/barrel_ngram_sup.erl
  • Code Duplication · Edited copy of a member (20 corresponding lines) apps/barrel_att_s3/src/barrel_att_s3_store.erl
  • Code Duplication · Edited copy of a member (14 corresponding lines) apps/barrel_server/src/barrel_server_mcp_agent.erl
  • Code Duplication · Edited copies of one member (5 members, 17+ corresponding lines) apps/barrel_docdb/src/barrel_query.erl
  • Code Duplication · Edited copy of a member (15 corresponding lines) apps/barrel_att_s3/src/barrel_att_s3_store.erl
  • Code Duplication · Edited copy of a member (17 corresponding lines) apps/barrel_ngram/src/barrel_ngram_segment.erl
  • Code Duplication · Edited copy of a member (21 corresponding lines) apps/barrel_server/src/barrel_server_sync.erl
  • Code Duplication · Edited copy of a member (16 corresponding lines) apps/barrel/src/barrel_record_backfill.erl
  • Code Duplication · Edited copy of a member (19 corresponding lines) apps/barrel_ngram/src/barrel_ngram_query.erl
  • Code Duplication · Edited copy of a member (10 corresponding lines) apps/barrel_docdb/src/barrel_sync_sig.erl
  • Code Duplication · Edited copy of a member (14 corresponding lines) apps/barrel_ngram/src/barrel_ngram_query.erl
  • Code Duplication · Edited copy of a member (11 corresponding lines) apps/barrel_server/src/barrel_server_mcp_agent.erl
  • Code Duplication · Edited copy of a member (11 corresponding lines) apps/barrel_docdb/src/barrel_rep_transport_http.erl
  • Code Duplication · Edited copy of a member (18 corresponding lines) apps/barrel_docdb/src/barrel_ars_index.erl
  • Code Duplication · Edited copy of a member (13 corresponding lines) apps/barrel_embed/src/barrel_embed_venv.erl
  • Code Duplication · Edited copy of a member (22 corresponding lines) apps/barrel_embed/priv/barrel_embed/providers/clip.py
  • Code Duplication · Edited copy of a member (12 corresponding lines) apps/barrel_att_s3/src/barrel_att_s3_store.erl
  • Code Duplication · Edited copy of a member (19 corresponding lines) apps/barrel_ngram/src/barrel_ngram_corpus_config.erl
  • Code Duplication · Edited copy of a member (17 corresponding lines) apps/barrel_docdb/src/barrel_ars_index.erl
  • Code Duplication · Edited copy of a member (26 corresponding lines) apps/barrel_docdb/src/barrel_query.erl
  • Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) apps/barrel/src/barrel_ctx_shape.erl
  • Code Duplication · Edited copy of a member (15 corresponding lines) apps/barrel_embed/priv/barrel_embed/providers/clip.py
  • Code Duplication · Edited copy of a member (10 corresponding lines) apps/barrel/src/barrel.erl
  • Code Duplication · Edited copy of a member (17 corresponding lines) apps/barrel_docdb/src/barrel_query_sub.erl
  • Code Duplication · Edited copies of one member (4 members, 14+ corresponding lines) apps/barrel_docdb/src/barrel_ars_index.erl
  • Code Duplication · Edited copy of a member (12 corresponding lines) apps/barrel_docdb/src/barrel_rep_tasks.erl
  • Code Duplication · Edited copy of a member (18 corresponding lines) apps/barrel_embed/src/barrel_embed.erl
  • Code Duplication · Edited copy of a member (10 corresponding lines) apps/barrel_docdb/src/barrel_ars_index.erl
  • Code Duplication · Edited copy of a member (8 corresponding lines) apps/barrel_docdb/src/barrel_parallel.erl
  • Code Duplication · Edited copy of a member (16 corresponding lines) apps/barrel_docdb/src/barrel_timeline.erl
  • Code Duplication · Edited copy of a member (13 corresponding lines) apps/barrel_docdb/src/barrel_store_rocksdb.erl
  • Code Duplication · Edited copy of a member (17 corresponding lines) apps/barrel_embed/priv/barrel_embed/providers/clip.py
  • Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) apps/barrel_docdb/src/barrel_query.erl
  • Code Duplication · Edited copy of a member (13 corresponding lines) apps/barrel_ngram/src/barrel_ngram_segment.erl
  • Code Duplication · Edited copy of a member (8 corresponding lines) apps/barrel_docdb/src/barrel_att_feed.erl
  • Code Duplication · Edited copy of a member (18 corresponding lines) apps/barrel_docdb/src/barrel_rep.erl
  • Code Duplication · Edited copy of a member (16 corresponding lines) apps/barrel_server/src/barrel_server_spaces.erl
  • Code Duplication · Edited copies of one member (3 members, 7+ corresponding lines) apps/barrel_docdb/src/barrel_sync_sig.erl
  • Code Duplication · Edited copy of a member (9 corresponding lines) apps/barrel_embed/src/barrel_embed_bedrock.erl
  • Code Duplication · Edited copy of a member (7 corresponding lines) apps/barrel_docdb/src/barrel_doc.erl
  • Code Duplication · Edited copy of a member (10 corresponding lines) apps/barrel_docdb/src/barrel_store_rocksdb.erl
  • Code Duplication · Edited copy of a member (13 corresponding lines) apps/barrel_docdb/src/barrel_store_rocksdb.erl
  • Code Duplication · Edited copy of a member (13 corresponding lines) apps/barrel_server/src/barrel_server_mcp_agent.erl
  • Code Duplication · Edited copy of a member (21 corresponding lines) apps/barrel/src/barrel_sup.erl
  • Code Duplication · Edited copy of a member (8 corresponding lines) apps/barrel_docdb/src/barrel_ars_index.erl
  • Code Duplication · Edited copy of a member (13 corresponding lines) apps/barrel_docdb/src/barrel_att_store_blob.erl
  • Code Duplication · Edited copy of a member (9 corresponding lines) apps/barrel_ngram/src/barrel_ngram_query.erl
  • Code Duplication · Edited copy of a member (9 corresponding lines) apps/barrel_ngram/src/barrel_ngram_postings.erl
  • Code Duplication · Edited copy of a member (7 corresponding lines) apps/barrel_docdb/src/barrel_parallel.erl
  • Code Duplication · Edited copies of one member (7 members, 10+ corresponding lines) apps/barrel_docdb/src/barrel_store_rocksdb.erl
  • Code Duplication · Edited copy of a member (12 corresponding lines) apps/barrel_docdb/src/barrel_att_feed.erl
  • Code Duplication · Edited copy of a member (15 corresponding lines) apps/barrel_embed/src/barrel_embed_venv.erl
  • Code Duplication · Edited copy of a member (13 corresponding lines) apps/barrel_docdb/src/barrel_query_cursor.erl

We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.

Fixed since the last survey: 75 findings

These 75 critical or serious findings were in the previous survey, on 30 October 2026, and are gone from this one.

  • Cyclomatic Complexity · barrel_db_server.apply_remote_current (cyclomatic 17) apps/barrel_docdb/src/barrel_db_server.erl
  • Cyclomatic Complexity · barrel_rep_tasks.run_task_loop (cyclomatic 17) apps/barrel_docdb/src/barrel_rep_tasks.erl
  • Cyclomatic Complexity · check_doc_snippets.main (cyclomatic 17) scripts/check_doc_snippets.py
  • Cognitive Complexity · check_doc_snippets.main (cognitive 48) scripts/check_doc_snippets.py
  • Cognitive Complexity · check_doc_snippets.arity_of (cognitive 20) scripts/check_doc_snippets.py
  • Cognitive Complexity · barrel_att_store_blob.finish_stream (cognitive 17) apps/barrel_docdb/src/barrel_att_store_blob.erl
  • Cognitive Complexity · barrel_changes.get_changes_by_channel (cognitive 16) apps/barrel_docdb/src/barrel_changes.erl
  • Cognitive Complexity · barrel_rep.replicate_one_shot (cognitive 16) apps/barrel_docdb/src/barrel_rep.erl
  • God Classes · TooManyFunctions: barrel_session apps/barrel_spaces/src/barrel_session.erl
  • Code Duplication · Edited copy of a member (18 corresponding lines) apps/barrel_embed/src/barrel_embed_port_server.erl
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) apps/barrel_docdb/src/barrel_db_server.erl
  • Code Duplication · Duplicated block (34–37 lines × 2) apps/barrel_docdb/src/barrel_db_server.erl
  • Code Duplication · Duplicated block (18–26 lines × 2) apps/barrel_docdb/src/barrel_db_server.erl
  • Code Duplication · Duplicated block (16–22 lines × 2) apps/barrel_docdb/src/barrel_db_server.erl
  • Code Duplication · Duplicated block (8–16 lines × 3) apps/barrel_docdb/src/barrel_db_server.erl
  • Code Duplication · Duplicated block (13 lines × 5) apps/barrel_docdb/src/barrel_ars_index.erl
  • Code Duplication · Duplicated block (13 lines × 2) apps/barrel_docdb/src/barrel_db_server.erl
  • Code Duplication · Duplicated block (10–11 lines × 7) apps/barrel_docdb/src/barrel_ars_index.erl
  • Code Duplication · Duplicated block (11 lines × 3) apps/barrel_docdb/src/barrel_db_server.erl
  • Code Duplication · Duplicated block (11 lines × 2) apps/barrel_docdb/src/barrel_db_server.erl
  • Code Duplication · Duplicated block (9–11 lines × 2) apps/barrel_server/src/barrel_server_http.erl
  • Code Duplication · Duplicated block (8–10 lines × 2) apps/barrel_docdb/src/barrel_db_server.erl
  • Code Duplication · Duplicated block (9 lines × 4) apps/barrel_docdb/src/barrel_db_server.erl
  • Code Duplication · Duplicated block (6 lines × 2) apps/barrel_spaces/src/barrel_session.erl
  • Churn × Complexity Hotspots · Hotspot: apps/barrel_server/src/barrel_server_http.erl apps/barrel_server/src/barrel_server_http.erl
  • Churn × Complexity Hotspots · Hotspot: apps/barrel_ngram/src/barrel_ngram_shard.erl apps/barrel_ngram/src/barrel_ngram_shard.erl
  • Churn × Complexity Hotspots · Hotspot: apps/barrel_ngram/src/barrel_ngram_segment.erl apps/barrel_ngram/src/barrel_ngram_segment.erl
  • Supply-chain Provenance & Signing · Workflow token permissions not restricted REDACTED
  • Supply-chain Provenance & Signing · Workflow token permissions not restricted REDACTED
  • Cyclomatic Complexity · Complex function dispatch (cyclomatic 24, cognitive 11) clients/barrel-lite/src/db.ts
  • Large Files · clients/barrel-lite/src/db.ts: 689 lines of code clients/barrel-lite/src/db.ts
  • Large Files · clients/barrel-lite/src/wire/transport.ts: 601 lines of code clients/barrel-lite/src/wire/transport.ts
  • Handler temporal coupling · Handler temporal coupling: barrel_rep_tasks clause `handle_loop_error/3#666` apps/barrel_docdb/src/barrel_rep_tasks.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel_ngram/src/barrel_ngram_manifest.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel_ngram/src/barrel_ngram_regex.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel_ngram/src/barrel_ngram_shard.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel_ngram/src/barrel_ngram_shard.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel_ngram/src/barrel_ngram_shard.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel_embed/src/barrel_embed_port_server.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel_embed/src/barrel_embed_provider.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel_docdb/src/barrel_att_store_blob.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel_docdb/src/barrel_att_store_blob.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel_docdb/src/barrel_db_server.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel_docdb/src/barrel_db_server.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel_docdb/src/barrel_docdb.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel_docdb/src/barrel_docdb.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel_docdb/src/barrel_lib.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel_docdb/src/barrel_rep.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel_docdb/src/barrel_rep_alg.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel_docdb/src/barrel_rep_att.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel_docdb/src/barrel_rep_transport_http.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel_docdb/src/barrel_rep_transport_http.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel_docdb/src/barrel_rep_transport_http.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel_docdb/src/barrel_store_rocksdb.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel_docdb/src/barrel_sync_sig.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel_crypto/src/barrel_crypto.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel_crypto/src/barrel_crypto.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel_crypto/src/barrel_crypto_file.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel_att_s3/src/barrel_att_s3_multipart_gc.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel_att_s3/src/barrel_att_s3_store.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel/src/barrel_bql_live.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel/src/barrel_bql_live.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel/src/barrel_ctx_export.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel/src/barrel_ctx_manifest.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel/src/barrel_ctx_query.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel/src/barrel_ctx_remote.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel/src/barrel_ctx_remote.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel/src/barrel_ctx_remote.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel/src/barrel_dbs.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel/src/barrel_dbs.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel/src/barrel_dbs.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel/src/barrel_dbs.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel/src/barrel_dbs.erl
  • Exception handling · Swallowed exception (caught, then discarded) apps/barrel/src/barrel_dbs.erl
  • Async & latency hygiene · Sync-over-async blocking clients/barrel-lite/test/integration/global-setup.ts
Rebuild cost: about €140,000 · Estimate
Cost to rebuild€46,000 to €230,000, for 771 to 2,445 hours of work, about 1.0 person-years for 1 to 2 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 53. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeMedium: 84,956 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

Top priorities

The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.

1
Remove synchronous peer round-trips (gen_server:call / hand-rolled receive) and blocking sleeps from OTP message handlers — cast a follow-up or resolve state locally, so processes stay temporally decoupled and deadlock-free.
Raises the score by about 15 points · Medium effort · Handler temporal coupling
2
Resolve the 6 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (6).
Raises the score by about 1 point · Low effort · Static Analysis (SAST)
3
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with rebar.config.
Raises the score by about 1 point · Low effort · ADR Quality

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

Where the investment is most exposed · Value at risk
This code would cost about €140,000 to build again, about 1.0 person-years of work. Its weakest lens is Event-Driven, at 35 (Weak). Event-Driven is about whether the parts of the system can rely on the messages they send each other. Because the weakest lens counts most in the score, work on Event-Driven also moves the score most.
Based on: the rebuild estimate · the Event-Driven grade · how much each lens counts
What to do: Start with the Event-Driven actions in Top priorities.
If you do one thing first · First action
Remove synchronous peer round-trips (gen_server:call / hand-rolled receive) and blocking sleeps from OTP message handlers — cast a follow-up or resolve state locally, so processes stay temporally decoupled and deadlock-free. Of all the actions in this report, it raises the score most for the work it takes: about 15 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.

arch barrel barrel barrel_crypto barrel_crypto barrel->barrel_crypto barrel_docdb barrel_docdb barrel->barrel_docdb barrel_embed (OTP) barrel_embed (OTP) barrel->barrel_embed (OTP) barrel_vectordb barrel_vectordb barrel->barrel_vectordb barrel-lite barrel-lite barrel_att_s3 barrel_att_s3 barrel_docdb->barrel_crypto barrel_embed (Python) barrel_embed (Python) barrel_faiss (CMake) barrel_faiss (CMake) barrel_faiss (OTP) barrel_faiss (OTP) barrel_ngram barrel_ngram barrel_ngram->barrel_docdb barrel_ngram_fs_nif barrel_ngram_fs_nif barrel_ngram_nif barrel_ngram_nif barrel_rerank barrel_rerank barrel_server barrel_server barrel_spaces barrel_spaces barrel_spaces->barrel barrel_spaces->barrel_crypto barrel_spaces->barrel_docdb barrel_vectordb->barrel_crypto barrel_vectordb->barrel_embed (OTP) barrel_vectordb_nif barrel_vectordb_nif

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

88 modules, with 74 dependencies between them. Every module uses only modules listed above it, so there are no loops.

The table shows the 40 modules with the most connections; 48 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 apps.barrel_embed.priv.barrel_embed.server2 clients.barrel-lite.src3 clients.barrel-lite.src.attachments.att4 clients.barrel-lite.src.attachments.att-sync5 clients.barrel-lite.src.bql.ast6 clients.barrel-lite.src.bql.eval7 clients.barrel-lite.src.codec.base648 clients.barrel-lite.src.codec.hlc9 clients.barrel-lite.src.json10 clients.barrel-lite.src.store.types11 clients.barrel-lite.src.sync.status12 clients.barrel-lite.src.tabs.leader13 clients.barrel-lite.src.wire.filters14 apps.barrel_embed.priv.barrel_embed.providers.clip15 apps.barrel_embed.priv.barrel_embed.providers.colbert16 apps.barrel_embed.priv.barrel_embed.providers.fastembed17 apps.barrel_embed.priv.barrel_embed.providers.sentence_transformers18 apps.barrel_embed.priv.barrel_embed.providers.splade19 clients.barrel-lite.src.bql.lexer20 clients.barrel-lite.src.bql.lower21 clients.barrel-lite.src.codec.version22 clients.barrel-lite.src.store.localstore23 clients.barrel-lite.src.store.opfs24 clients.barrel-lite.src.sync.puller25 clients.barrel-lite.src.sync.types26 clients.barrel-lite.src.tabs.channel27 clients.barrel-lite.src.wire.transport28 clients.barrel-lite.src.bql.parser29 clients.barrel-lite.src.bql.query30 clients.barrel-lite.src.codec.live31 clients.barrel-lite.src.store.blobstore32 clients.barrel-lite.src.sync33 clients.barrel-lite.src.tabs.coordinator34 clients.barrel-lite.src.vectors35 clients.barrel-lite.src.wire36 clients.barrel-lite.src.attachments37 clients.barrel-lite.src.bql38 clients.barrel-lite.src.codec39 clients.barrel-lite.src.db40 clients.barrel-lite.src.store
1 apps.barrel_embed.priv.barrel_embed.server
2 clients.barrel-lite.src
3 clients.barrel-lite.src.attachments.att
4 clients.barrel-lite.src.attachments.att-sync
5 clients.barrel-lite.src.bql.ast
6 clients.barrel-lite.src.bql.eval
7 clients.barrel-lite.src.codec.base64
8 clients.barrel-lite.src.codec.hlc
9 clients.barrel-lite.src.json
10 clients.barrel-lite.src.store.types
11 clients.barrel-lite.src.sync.status
12 clients.barrel-lite.src.tabs.leader
13 clients.barrel-lite.src.wire.filters
14 apps.barrel_embed.priv.barrel_embed.providers.clip1
15 apps.barrel_embed.priv.barrel_embed.providers.colbert1
16 apps.barrel_embed.priv.barrel_embed.providers.fastembed1
17 apps.barrel_embed.priv.barrel_embed.providers.sentence_transformers1
18 apps.barrel_embed.priv.barrel_embed.providers.splade1
19 clients.barrel-lite.src.bql.lexer1
20 clients.barrel-lite.src.bql.lower1
21 clients.barrel-lite.src.codec.version1
22 clients.barrel-lite.src.store.localstore14
23 clients.barrel-lite.src.store.opfs3
24 clients.barrel-lite.src.sync.puller1
25 clients.barrel-lite.src.sync.types1
26 clients.barrel-lite.src.tabs.channel1
27 clients.barrel-lite.src.wire.transport211
28 clients.barrel-lite.src.bql.parser111
29 clients.barrel-lite.src.bql.query1
30 clients.barrel-lite.src.codec.live12
31 clients.barrel-lite.src.store.blobstore2
32 clients.barrel-lite.src.sync213124
33 clients.barrel-lite.src.tabs.coordinator1224
34 clients.barrel-lite.src.vectors11
35 clients.barrel-lite.src.wire212
36 clients.barrel-lite.src.attachments12212
37 clients.barrel-lite.src.bql10211121
38 clients.barrel-lite.src.codec1133
39 clients.barrel-lite.src.db11221112111
40 clients.barrel-lite.src.store111
Uses a module listed above itPart of a loopThe module itself
1 apps.barrel_embed.priv.barrel_embed.server2 clients.barrel-lite.src3 clients.barrel-lite.src.attachments.att4 clients.barrel-lite.src.attachments.att-sync5 clients.barrel-lite.src.bql.ast6 clients.barrel-lite.src.bql.eval7 clients.barrel-lite.src.codec.base648 clients.barrel-lite.src.codec.hlc9 clients.barrel-lite.src.json10 clients.barrel-lite.src.store.types11 clients.barrel-lite.src.sync.status12 clients.barrel-lite.src.tabs.leader13 clients.barrel-lite.src.wire.filters14 apps.barrel_embed.priv.barrel_embed.providers.clip15 apps.barrel_embed.priv.barrel_embed.providers.colbert16 apps.barrel_embed.priv.barrel_embed.providers.fastembed17 apps.barrel_embed.priv.barrel_embed.providers.sentence_transformers18 apps.barrel_embed.priv.barrel_embed.providers.splade19 clients.barrel-lite.src.bql.lexer20 clients.barrel-lite.src.bql.lower21 clients.barrel-lite.src.codec.version22 clients.barrel-lite.src.store.localstore23 clients.barrel-lite.src.store.opfs24 clients.barrel-lite.src.sync.puller25 clients.barrel-lite.src.sync.types26 clients.barrel-lite.src.tabs.channel27 clients.barrel-lite.src.wire.transport28 clients.barrel-lite.src.bql.parser29 clients.barrel-lite.src.bql.query30 clients.barrel-lite.src.codec.live31 clients.barrel-lite.src.store.blobstore32 clients.barrel-lite.src.sync33 clients.barrel-lite.src.tabs.coordinator34 clients.barrel-lite.src.vectors35 clients.barrel-lite.src.wire36 clients.barrel-lite.src.attachments37 clients.barrel-lite.src.bql38 clients.barrel-lite.src.codec39 clients.barrel-lite.src.db40 clients.barrel-lite.src.storeapps.barrel_embed.priv.barrel_embed.server1clients.barrel-lite.src2clients.barrel-lite.src.attachments.att3clients.barrel-lite.src.attachments.att-sync4clients.barrel-lite.src.bql.ast5clients.barrel-lite.src.bql.eval6clients.barrel-lite.src.codec.base647clients.barrel-lite.src.codec.hlc8clients.barrel-lite.src.json9clients.barrel-lite.src.store.types10clients.barrel-lite.src.sync.status11clients.barrel-lite.src.tabs.leader12clients.barrel-lite.src.wire.filters13apps.barrel_embed.priv.barrel_embed.providers.clip14apps.barrel_embed.priv.barrel_embed.providers.colbert15apps.barrel_embed.priv.barrel_embed.providers.fastembed16apps.barrel_embed.priv.barrel_embed.providers.sentence_transformers17apps.barrel_embed.priv.barrel_embed.providers.splade18clients.barrel-lite.src.bql.lexer19clients.barrel-lite.src.bql.lower20clients.barrel-lite.src.codec.version21clients.barrel-lite.src.store.localstore22clients.barrel-lite.src.store.opfs23clients.barrel-lite.src.sync.puller24clients.barrel-lite.src.sync.types25clients.barrel-lite.src.tabs.channel26clients.barrel-lite.src.wire.transport27clients.barrel-lite.src.bql.parser28clients.barrel-lite.src.bql.query29clients.barrel-lite.src.codec.live30clients.barrel-lite.src.store.blobstore31clients.barrel-lite.src.sync32clients.barrel-lite.src.tabs.coordinator33clients.barrel-lite.src.vectors34clients.barrel-lite.src.wire35clients.barrel-lite.src.attachments36clients.barrel-lite.src.bql37clients.barrel-lite.src.codec38clients.barrel-lite.src.db39clients.barrel-lite.src.store401111111114311121111111222131241224112121221210211121113311221112111111+48 more modules (most-connected shown)

At a glance — Code Health · 70% · Strong ·

At a glance — Architecture · 98% · Exemplary ·

At a glance — Maturity · 74% · Adequate · gated by M2 ·

At a glance — Readiness · 68% · Adequate ·

At a glance — Security · 62% · Checked 5 of 11 · gated by D29, D36 ·

At a glance — Event-Driven · 35% · Weak · gated by ED1 ·

At a glance — Event Sourcing · 100% · Exemplary ·

At a glance — Performance · 100% · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).

OWASP categoryFindingsSeverity
A05:2025 — Injection58High / Critical
A03:2025 — Software Supply Chain Failures19High / Critical
A02:2025 — Security Misconfiguration4Medium

Roadmap

Top priorities: Remove synchronous peer round-trips (gen_server:call / hand-rolled receive) and blocking sleeps from OTP message handlers — cast a follow-up or resolve state locally, so processes stay temporally decoupled and deadlock-free; Resolve the 6 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (6); Resolve the 1 No ADRs found finding(s) in ADR Quality — start with rebar.config.

Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.

Do thisHelpsEffortDimension
Remove synchronous peer round-trips (gen_server:call / hand-rolled receive) and blocking sleeps from OTP message handlers — cast a follow-up or resolve state locally, so processes stay temporally decoupled and deadlock-free.+15.3 ptsMediumHandler temporal coupling
Resolve the 6 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (6).+1.4 ptsLowStatic Analysis (SAST)
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with rebar.config.+1.1 ptsLowADR Quality
Resolve the 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED (2).+0.9 ptsLowSupply-chain Provenance & Signing
Resolve the 6 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2), REDACTED (2), REDACTED (2).+0.9 ptsLowDependency Vulnerabilities
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2).+0.7 ptsLowStatic Analysis (SAST)
Resolve the 1 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED.+0.7 ptsLowDependency Vulnerabilities
Resolve the 4 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (4).+0.7 ptsLowDependency Vulnerabilities

File quality

Per-file score 0–10 — a quality signature. Of 110 files carrying findings, judged against the Production bar: 5% slop · 65% mixed · 30% near-clean.

FileScoreBandWorst signal
REDACTED1.6SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.5SlopStatic Analysis (SAST): High: REDACTED
REDACTED4.1MixedDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED6.9MixedDependency Vulnerabilities: Medium CVE: REDACTED
REDACTED6.9MixedIaC & Container Security: Medium IaC: REDACTED
REDACTED6.9MixedIaC & Container Security: Medium IaC: REDACTED
apps/barrel_docdb/src/barrel_db_server.erl7.0MixedCyclomatic Complexity: barrel_db_server.handle_call_rw (cyclomatic 49)
apps/barrel_docdb/src/barrel_query.erl7.0MixedCyclomatic Complexity: barrel_query.match_condition (cyclomatic 42)
apps/barrel_att_s3/src/barrel_att_s3_store.erl7.0MixedCyclomatic Complexity: barrel_att_s3_store.finish_stream (cyclomatic 22)
apps/barrel_server/src/barrel_server_mcp_agent.erl7.0MixedCognitive Complexity: barrel_server_mcp_agent.handoff_create (cognitive 20)
apps/barrel_docdb/src/barrel_store_rocksdb.erl7.0MixedCognitive Complexity: barrel_store_rocksdb.encode_entity (cognitive 16)
apps/barrel_docdb/src/barrel_ars_index.erl7.0MixedGod Classes: FileTooLong: src/barrel_ars_index.erl
apps/barrel_ngram/src/barrel_ngram_query.erl7.0MixedGod Classes: TooManyFunctions: barrel_ngram_query
apps/barrel_docdb/src/barrel_query_sub.erl7.0MixedCyclomatic Complexity: barrel_query_sub.match_condition (cyclomatic 41)
apps/barrel_docdb/src/barrel_changes.erl7.0MixedCyclomatic Complexity: barrel_changes.get_changes_filtered_chunked (cyclomatic 16)
apps/barrel_docdb/src/barrel_att_feed.erl7.0MixedGod Classes: TooManyFunctions: barrel_att_feed

How the grades work

Every finding carries one of four grades. Three say how serious it is. The fourth says this survey could not settle it — and it is a grade, not a gap.

Critical — 61

A definite problem that already costs you something and drags the score down: a missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here tends to cause failures elsewhere.

Serious — 491

Likely wrong, but not failing yet. It degrades the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to carry for two years either.

Minor — 50

Recorded, with no effect on how the codebase functions. Present so the survey is complete, not because it needs doing.

Could not be resolved — 20

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 56 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.

Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.

What we checked — 56 dimensions across the health lenses
D1D2D3D4D5D6D10D13D14D15D17D19D20D24D26D27D28D29D30D31D34D35D36D43D44AX10AX3AX4AX9ED1ES1M1M2M3M4P1P10P2P3P4P5P6PF3R1R10R2R3R4R5R6R7R8R9X25X3X5

Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.

How to trust any code-health report — three questions
  1. Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 575 of 602 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

This report answers yes to all three. That's the bar to hold any assessment to.

Tools & methods

The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Canine Code Analyzer duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic

Every finding is locatable in findings.md. Run 01a1de29-2021-7360-9d9e-cf0fd1675d51.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.

  • D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 205 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 213 test source file(s) (.erl) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT SCORED: this repository's production source includes .erl, and the erlang executor ran against the .erl half and could not be re-run to completion inside our analyzer environment — so reliability was not measured for the repository as a whole. The JavaScript/TypeScript (vitest via `npm ci --ignore-scripts` in clients/barrel-lite/ (187 tests)): measured (0 flaky) suite(s) did re-run, and came back with 0 flaky across 1 measured tier(s) — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — test reliability is excluded from the score rather than counted. The remedy is our analyzer environment, not a runner nobody has built.
  • D12 Dependency Hygiene — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — 4 shipped Python distribution(s) were read, but the outdated signal needs pypi.org, and no declaration here carries an exact pin to ask about — a floor or a range installs the newest release it admits and cannot be behind one, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
  • D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (2 contributor(s) across 348 commit(s) sampled, automation and bot accounts excluded). One of them holds 100% of the history; the other 1 hold 0% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: it declares a published package (apps/barrel_vectordb/src/barrel_vectordb.app.src), but no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
  • D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `clients/barrel-lite/src/attachments/att-sync.ts` produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • AX6 Interface segregation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • C2 Access Controls — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • C3 Audit Trail — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
  • C4 Data Retention — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
  • C5 Data-Subject Rights — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
  • GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Erlang, Python, c, cpp is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Erlang, Python, c, cpp is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X1 Async correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X17 Uncapped recursion over a caller-supplied document — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X2 Cancellation propagation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python and Rust source only, and no C# was loaded, and no named async function in this repository's JavaScript/TypeScript, nor any Go, PHP or Dart function or Kotlin suspend function, makes a request that can be cancelled (fetch, axios, ky, ofetch, got, undici, node:http; net/http, net.Dial; amphp; Dio; Ktor, OkHttp), so there is nothing to judge, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X21 Side-effecting pattern guard — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X29 Per-element action decided by a fixed element — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 48 further occurrence(s) are not listed individually; the score already reflects all 88.
  • X31 Test-only surface in a production module — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 6 further occurrence(s) are not listed individually; the score already reflects all 46.
  • X4 Structured logging — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X7 Silent fallback defaults — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. X7 measured the part of this repository it reads (C#, Python, TypeScript/JavaScript, Rust, Go, Java, Kotlin, Scala, PHP, Ruby, Swift and Dart), and its Erlang source is outside the check's reach, so the card covers only part of the product. That is a gap in this analyzer's language reach — not a finding that the unread source is free of silent defaults.

Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

Limitations & what we did not check

We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned REDACTED, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

D1 · Cyclomatic Complexity7.2 / 10Strong✓ Tool-verified

What it measures: How tangled the control flow is — methods with many branches are hard to test and change.

Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.

Maturity: Documented → Verified → Prevented · effective 7.2 / 10 · rule-coverage 100% · ceiling Prevented

19 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was barrel_db_server.handle_call_rw at 49. A further 23 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being barrel_ctx_error.hint at 41 — they are counted neither in the figure above nor in this dimension's score. 11 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: apps/barrel/src/barrel_ctx_error.erl (barrel_ctx_error.hint at 41), apps/barrel_docdb/src/barrel_bql.erl (barrel_bql.reason_text at 24), apps/barrel_docdb/src/barrel_bql_lower.erl (barrel_bql_lower.lower_cond at 22), apps/barrel_docdb/src/barrel_rep_tasks.erl (barrel_rep_tasks.handle_call at 21), apps/barrel_server/src/barrel_server_auth.erl (barrel_server_auth.sync_right at 21), and 6 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

barrel_db_server.handle_call_rw (cyclomatic 49)apps/barrel_docdb/src/barrel_db_server.erl:693
barrel_query.match_condition (cyclomatic 42)apps/barrel_docdb/src/barrel_query.erl:3401
barrel_query_sub.match_condition (cyclomatic 41)apps/barrel_docdb/src/barrel_query_sub.erl:398
barrel_dbs.do_call (cyclomatic 39)apps/barrel/src/barrel_dbs.erl:290
lexer.tokenize (cyclomatic 37)clients/barrel-lite/src/bql/lexer.ts:36

+ 14 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 19 bodies over 15 down to 15 or less in Cyclomatic Complexity — start with barrel_db_server.handle_call_rw (cyclomatic 49), barrel_query.match_condition (cyclomatic 42), barrel_query_sub.match_condition (cyclomatic 41). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 19 together lifts Cyclomatic Complexity from 7.2 to about 10.0/10, projected with the scoring formula itself and assuming each lands exactly at 15.

Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.

D2 · Cognitive Complexity6.3 / 10Adequate✓ Tool-verified

What it measures: How hard the code is for a person to follow, beyond raw branching.

Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.

Maturity: Documented → Verified → Prevented · effective 6.3 / 10 · rule-coverage 100% · ceiling Prevented

36 method(s) exceeded the cognitive complexity threshold of 15; the worst was lexer.tokenize at 75.

lexer.tokenize (cognitive 75)clients/barrel-lite/src/bql/lexer.ts:36
barrel_db_server.do_write_state (cognitive 38)apps/barrel_docdb/src/barrel_db_server.erl:3509
barrel_db_server.init (cognitive 37)apps/barrel_docdb/src/barrel_db_server.erl:521
barrel_query.match_condition (cognitive 37)apps/barrel_docdb/src/barrel_query.erl:3401
barrel_query.execute_multi_index (cognitive 32)apps/barrel_docdb/src/barrel_query.erl:2729

+ 31 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 1 body over 60 down to 60 or less in Cognitive Complexity — start with lexer.tokenize (cognitive 75). — Refactoring it lifts Cognitive Complexity from 6.3 to about 6.5/10.

Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.

D3 · God Classes7.5 / 10Strong✓ Tool-verified

What it measures: Over-large classes that try to do too much ("god classes").

Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.

Maturity: Documented → Verified → Prevented · effective 7.5 / 10 · rule-coverage 100% · ceiling Prevented

46 god class(es) detected.

TooManyFunctions: barrel_ngram_regex · ×23apps/barrel_ngram/src/barrel_ngram_regex.erl:29
FileTooLong: src/barrel_db_server.erl · ×21apps/barrel_docdb/src/barrel_db_server.erl
TooManyMethods: Databaseclients/barrel-lite/src/db.ts:127
ClassTooLong: Databaseclients/barrel-lite/src/db.ts:127

What to do

  1. Resolve the 23 TooManyFunctions finding(s) in God Classes — start with barrel_ngram_regex.erl, barrel_ctx.erl, barrel_att_store.erl. — One of this dimension's main actionable groups (23 warning-level).
  2. Resolve the 21 FileTooLong finding(s) in God Classes — start with barrel_db_server.erl, barrel_query.erl, barrel_att_s3_store.erl. — One of this dimension's main actionable groups (21 warning-level).
  3. Resolve the 1 TooManyMethods finding(s) in God Classes — start with db.ts. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.

D4 · Code Duplication7.0 / 10Adequate✓ Tool-verified

What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.

Maturity: Documented → Verified → Prevented · effective 7.0 / 10 · rule-coverage 100% · ceiling Verified

106 duplicated block group(s) detected. 7.6 % of the production lines (6,415 of 84,956) are in a reported copy. A further 166 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 7 of the 272 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.

Edited copy of a member (10 corresponding lines) · ×14apps/barrel_docdb/src/barrel_sync_sig.erl:222
Edited copy of a member (6 corresponding lines) · ×12apps/barrel/src/barrel.erl:936
Duplicated block (6 lines × 2) · ×12apps/barrel_docdb/src/barrel_bql_exec.erl:177
Edited copy of a member (7 corresponding lines) · ×10apps/barrel_docdb/src/barrel_doc.erl:471
Duplicated block (5 lines × 2) · ×10apps/barrel_att_s3/src/barrel_att_s3_store.erl:776

+ 105 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 14 Edited copy of a member (10 corresponding lines) finding(s) in Code Duplication — start with barrel_ars_index.erl (2), barrel_sync_sig.erl, barrel.erl. — One of this dimension's main actionable groups (14 warning-level).
  2. Resolve the 12 Edited copy of a member (6 corresponding lines) finding(s) in Code Duplication — start with barrel.erl (2), barrel_ngram_shard_sup.erl, barrel_ctx_manifest.erl. — One of this dimension's main actionable groups (12 warning-level).
  3. Resolve the 12 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with barrel_server_mcp_agent.erl (2), barrel_bql_exec.erl, barrel_doc_body_store.erl. — One of this dimension's main actionable groups (12 warning-level).

Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.

D5 · Coupling8.6 / 10Strong✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 8.6 / 10 · rule-coverage 100% · ceiling Prevented

17 production modules (npm+Python+OTP+CMake), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 3 module(s) off the main sequence, with abstractness counted on 10 of the 17 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

Off the main sequence: barrel_embed (OTP) · ×3

What to do

  1. Resolve the 3 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (3 warning-level).

Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.

D6 · Cohesion (LCOM4)10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether a class's methods are focused on a single responsibility.

Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.

Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 17 classes have LCOM4 above 3.

✓ On the Gold path — maintain.

Detailed fixes: d6_recommendation.md.

D10 · Test Quality9.9 / 10Stronggated by 1 serious finding✓ Tool-verified

What it measures: Whether the tests truly assert behaviour rather than just running the code.

Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Prevented

0 skipped, 1 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 205 tests. Measured on the JavaScript/TypeScript suite only — at least 213 test source file(s) (.erl) went unread, so its test quality is unmeasured and is not in these counts.

No assertions: a live pull propagates a server doc to the leader tabclients/barrel-lite/test/browser/smoke.spec.ts:151

What to do

  1. Resolve the 1 No assertions finding(s) in Test Quality — start with smoke.spec.ts. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.

D13 · Secret Scanning10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.

Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the licenses of third-party packages are compatible with your policy.

Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 14 shipped Hex package(s) use a banned license. Licences were resolved from hex.pm over the packages a consumer installs — this repository's rebar.lock, which is already the transitive closure a consumer installs. rebar3 writes that lock for the DEFAULT profile ONLY, so a dependency declared inside `{profiles, [{test, [{deps, […]}]}]}` has no entry in it and is excluded here for the reason the Mix arm excludes an `only: [:dev, :test]` declaration: it is not installed by anything that depends on this repository. Each licence is the one hex.pm publishes for the package's current release. This repository publishes itself under Apache-2.0, which is its own choice and is not judged here.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots9.8 / 10Stronggated by 5 serious findings✓ Tool-verified

What it measures: Files that change often and are also complex — the riskiest hotspots.

Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.

Maturity: Documented → Verified → Prevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: apps/barrel_docdb/src/barrel_db_server.erl (23×49=1127); apps/barrel_vectordb/src/barrel_vectordb_server.erl (7×40=280); apps/barrel_att_s3/src/barrel_att_s3_store.erl (7×22=154)

Hotspot: apps/barrel_docdb/src/barrel_db_server.erl · ×5apps/barrel_docdb/src/barrel_db_server.erl:693

What to do

  1. Resolve the 5 Hotspot finding(s) in Churn × Complexity Hotspots — start with barrel_db_server.erl, barrel_vectordb_server.erl, barrel_att_s3_store.erl. — One of this dimension's main actionable groups (5 warning-level).

Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.

D17 · Explicit Debt10.0 / 10Exemplary○ Nothing flagged

What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.

Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

0 deducted task-comment markers across 84956 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

✓ On the Gold path — maintain.

Detailed fixes: d17_recommendation.md.

D19 · Documentation Quality10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

1 of 1 documentation facets pass in full. 85 document(s) read across 2 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality0.0 / 10Critical✓ Tool-verified

What it measures: Whether architecture decisions are recorded well (context, decision, consequences).

Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

No architecture decision records were found.

No ADRs foundrebar.config:112

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality — start with rebar.config. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.

D24 · Comment Value10.0 9.8 / 10Exemplary○ Nothing flagged

What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).

Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.

Maturity: Documented → Verified → Prevented · effective 9.8 / 10 · rule-coverage 98% · ceiling Documented

0 of 157 judged comments only repeat the code they sit on (0.0 %). 4 comment(s) in another language or script were not judged.

✓ On the Gold path — maintain.

Detailed fixes: d24_recommendation.md.

D26 · Project Cohesion10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 of 14 build units (Python, npm, rebar3) flagged as possibly oversized/incoherent.

✓ On the Gold path — maintain.

Detailed fixes: d26_recommendation.md.

D27 · Navigability10.0 / 10Exemplary✓ Tool-verified

What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.

Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.

Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 % of calls cross a namespace and 0 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.

✓ On the Gold path — maintain.

Detailed fixes: d27_recommendation.md.

D28 · Secrets (history)10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.

Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

gitleaks scanned the full history AND the current working tree and found no secrets.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)1.3 / 10Critical✓ Tool-verified

What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.

Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.

Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).

Maturity: Documented → Verified → Prevented · effective 1.3 / 10 · rule-coverage 100% · ceiling Documented

58 finding(s): 0 critical, 56 high, 2 medium, 0 low. 45 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 14 file(s) — `apps/barrel_docdb/bench/writer_compare.sh` (line 24), `apps/barrel_ngram/c_src/croaring/include/roaring/bitset/bitset.h` (line 29, line 146, line 147, …), `apps/barrel_ngram/c_src/croaring/include/roaring/containers/array.h` (line 74, line 212, line 221), `apps/barrel_ngram/c_src/croaring/include/roaring/containers/bitset.h` (line 238), `apps/barrel_ngram/c_src/croaring/include/roaring/containers/run.h` (line 484, line 493), … (+9 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 5 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

+ 2 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 6 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (6). — One of this dimension's main actionable groups (6 issue-level).
  2. Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
  3. No action in Static Analysis (SAST) — all 45 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (45 issue-level, 0 of them charged here).

Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.

D30 · Dependency Vulnerabilities5.5 / 10Adequate✓ Tool-verified

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

Maturity: Documented → Verified → Prevented · effective 5.5 / 10 · rule-coverage 100% · ceiling Documented

11 finding(s): 1 critical, 4 high, 6 medium, 0 low.

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 6 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (6 warning-level).
  2. Resolve the 4 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (4). — One of this dimension's main actionable groups (4 issue-level).
  3. Resolve the 1 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.

D31 · IaC & Container Security9.6 / 10Stronggated by 4 serious findings✓ Tool-verified

What it measures: Whether Dockerfiles / Terraform / Kubernetes config follow security best practices.

Method: IaC/container misconfiguration scan via trivy config (REDACTED/Terraform/K8s/Helm/CloudFormation); severity rules to 0-10 moderate normalizer. NotApplicable without manifests. Exhaustive, deterministic.

Maturity: Documented → Verified → Prevented · effective 9.6 / 10 · rule-coverage 100% · ceiling Documented

4 finding(s): 0 critical, 0 high, 4 medium, 0 low.

REDACTED

What to do

  1. Resolve the 4 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (4). — One of this dimension's main actionable groups (4 warning-level).

Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.

D34 · Knowledge Freshness10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

Every significant source file has living knowledge — recently and meaningfully worked. Counted over 219 of the 283 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

D35 · Change Coupling10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.

Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_recommendation.md.

D36 · Supply-chain Provenance & Signing0.0 / 10Critical✓ Tool-verified

What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.

Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

0/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

+ 2 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 0 platform declaration(s) and 4 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

R = React/JS · M = Maturity · P = Readiness.

AX10 · Code composition9.5 / 10Exemplary✓ Tool-verified

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).

Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

AX9 · CQS / query purity10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.

Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.

Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.

ED1 · Handler temporal coupling3.5 / 10Weak✓ Tool-verified

Other · Event-Driven — Whether event handlers stay asynchronous (no blocking remote HTTP/gRPC calls awaited inside a handler).

Method: Roslyn semantic scan (event-driven gated): event-handler bodies scanned for HTTP/gRPC invocations by resolved symbol type, not substring. Deterministic, semantic-resolved.

  • `barrel_rep_tasks` clause `handle_loop_error/3#834` blocks the process on a synchronous `timer:sleep` while handling a message — the process is blocked (holding its mailbox) until a peer replies or the sleep elapses. That couples this handler in real time to another process being up and fast, and a mutual call can DEADLOCK. To decouple, move the delay off the hot path (a `state_timeout`/`send_after` self-message, or do the settle in a spawned worker). — apps/barrel_docdb/src/barrel_rep_tasks.erl:863

What to do

  • Remove synchronous peer round-trips (gen_server:call / hand-rolled receive) and blocking sleeps from OTP message handlers — cast a follow-up or resolve state locally, so processes stay temporally decoupled and deadlock-free.
ES1 · Fold determinism10.0 / 10Exemplary✓ Tool-verified

Other · Event Sourcing — Whether the event-sourcing replay fold reconstructs state purely from the event (no wall clock, UUID or randomness) so replay is reproducible.

Method: Roslyn syntax scan (event-sourcing gated): Apply/When folds checked for forbidden tokens (DateTime.Now, Guid.NewGuid, Random, IO), stripped of comments/strings. Deterministic, hard fact per fold.

M1 · Documentation (README)10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.

Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.

M2 · Architecture documentation2.0 / 10Critical✓ Tool-verified

Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.

Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.

Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.

M4 · Documentation accuracy10.0 / 10Exemplary○ Nothing flagged

Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.

Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.

P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether an automated pipeline builds and tests every change.

Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.

P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

P2 · Observability10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

P3 · Security & performance tooling4.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).

Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.

  • `clients/barrel-lite/package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — clients/barrel-lite/package.json:30

What to do

  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback10.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.

Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.

P5 · DR & Backup4.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.

Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.

What to do

  • Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
  • Enable purge protection / soft-delete (and prevent_destroy on critical resources) so data stores can't be lost to an accidental or malicious delete.
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

R1 · Type Safety9.9 / 10Exemplary✓ Tool-verified

React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.

Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.

R10 · Code Duplication8.5 / 10Strong✓ Tool-verified

React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.

Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.

  • clients/barrel-lite/src/store/blobstore.ts:77 · clients/barrel-lite/src/store/opfs.ts:68 — the two spans are one implementation copied and then locally edited — 150 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — clients/barrel-lite/src/store/blobstore.ts:77
  • clients/barrel-lite/src/wire/transport.ts:514 · clients/barrel-lite/src/wire/transport.ts:542 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — clients/barrel-lite/src/wire/transport.ts:514
  • REDACTED:382 · REDACTED:394 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:382
  • clients/barrel-lite/src/wire/transport.ts:501 · clients/barrel-lite/src/wire/transport.ts:528 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — clients/barrel-lite/src/wire/transport.ts:501
  • clients/barrel-lite/src/bql/parser.ts:89 · clients/barrel-lite/src/bql/parser.ts:345 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — clients/barrel-lite/src/bql/parser.ts:89
  • clients/barrel-lite/src/bql/parser.ts:136 · clients/barrel-lite/src/bql/parser.ts:241 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — clients/barrel-lite/src/bql/parser.ts:136
  • clients/barrel-lite/src/sync/pusher.ts:34 · clients/barrel-lite/src/sync/pusher.ts:79 — the two spans are one implementation copied and then locally edited — 55 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — clients/barrel-lite/src/sync/pusher.ts:34
  • clients/barrel-lite/src/bql/parser.ts:240 · clients/barrel-lite/src/bql/parser.ts:343 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — clients/barrel-lite/src/bql/parser.ts:240
  • clients/barrel-lite/src/wire/transport.ts:484 · clients/barrel-lite/src/wire/transport.ts:519 · clients/barrel-lite/src/wire/transport.ts:547 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. — clients/barrel-lite/src/wire/transport.ts:484
  • clients/barrel-lite/src/wire/transport.ts:182 · clients/barrel-lite/src/wire/transport.ts:383 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — clients/barrel-lite/src/wire/transport.ts:182
  • clients/barrel-lite/src/db.ts:307 · clients/barrel-lite/src/db.ts:497 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — clients/barrel-lite/src/db.ts:307

What to do

  • Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
R2 · Cyclomatic Complexity7.7 / 10Strong✓ Tool-verified

React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.

Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.

  • tokenize has cyclomatic complexity 35 and cognitive complexity 71; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — clients/barrel-lite/src/bql/lexer.ts:36
  • dispatch has cyclomatic complexity 26 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — clients/barrel-lite/src/db.ts:669
  • evalCond has cyclomatic complexity 21 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — clients/barrel-lite/src/bql/eval.ts:71
  • (anonymous) has cyclomatic complexity 18 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — clients/barrel-lite/test/fake-server.ts:115
  • route has cyclomatic complexity 17 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — clients/barrel-lite/test/fake-server.ts:250
  • lowerCond has cyclomatic complexity 17 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:455
  • canonExpr has cyclomatic complexity 17 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:170
  • checkIdUse has cyclomatic complexity 16 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:413
  • (anonymous) has cyclomatic complexity 15 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — clients/barrel-lite/src/sync/changes-stream.ts:54
  • pushNot has cyclomatic complexity 15 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:238
  • pull has cyclomatic complexity 14 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — clients/barrel-lite/src/sync/puller.ts:32
  • checkPath has cyclomatic complexity 14 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:338
  • applyState has cyclomatic complexity 14 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — clients/barrel-lite/src/sync/apply.ts:111
  • pullAttachments has cyclomatic complexity 13 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — clients/barrel-lite/src/attachments/att-sync.ts:30
  • bulkGetEmbeddings has cyclomatic complexity 13 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — clients/barrel-lite/src/wire/transport.ts:264
  • searchLocal has cyclomatic complexity 12 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — clients/barrel-lite/src/db.ts:479
  • open has cyclomatic complexity 12 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — clients/barrel-lite/src/db.ts:162
  • parseFrame has cyclomatic complexity 12 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — clients/barrel-lite/src/sync/sse.ts:37
  • pushAttachments has cyclomatic complexity 11 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — clients/barrel-lite/src/attachments/att-sync.ts:94
  • vvCompare has cyclomatic complexity 11 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — clients/barrel-lite/src/codec/vv.ts:60
R3 · Large Files7.2 / 10Strong✓ Tool-verified

React / JS · Code Health — How many source files exceed the large-file threshold.

Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.

  • clients/barrel-lite/src/db.ts has 716 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — clients/barrel-lite/src/db.ts:1
  • clients/barrel-lite/src/wire/transport.ts has 644 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — clients/barrel-lite/src/wire/transport.ts:1
  • REDACTED has 502 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage10.0 / 10Exemplary✓ Tool-verified

React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.

Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.

R5 · Dependency Freshness9.6 / 10Exemplary✓ Tool-verified

React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).

Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.

R6 · Tooling6.7 / 10Adequate✓ Tool-verified

React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.

Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.

  • test ✓ · lint ✗ · typecheck ✓ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.

What to do

  • Add eslint as package.json scripts and run them in CI.
R7 · Dead Code10.0 / 10Exemplary✓ Tool-verified

React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).

Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.

R8 · Dependency Hygiene10.0 / 10Exemplary✓ Tool-verified

React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.

Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.

R9 · Circular Imports10.0 / 10Exemplary✓ Tool-verified

React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.

Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.

X25 · Inert configuration knob6.3 / 10Adequate✓ Tool-verified

Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.

Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.

  • `barrel_rerank` takes `timeout in Config` from the caller and stores it in `#state.timeout` on line 182, defaulting to `?DEFAULT_TIMEOUT` when none is supplied — but `#state.timeout` is never read anywhere in the type, and line 137 spells `?DEFAULT_TIMEOUT` out again where that field's value belongs. Every caller that passes `timeout in Config` therefore gets `?DEFAULT_TIMEOUT` regardless, and nothing in the type reports that its argument was ignored. Read `#state.timeout` at line 137 — or, if the value genuinely is fixed, delete `timeout in Config` and `#state.timeout` together so the signature stops advertising a knob that does nothing. — apps/barrel_rerank/src/barrel_rerank.erl:137

What to do

  • Each finding names the spans that disagree — the knob the caller supplies and the site that ignores it, whether by re-spelling its default, by falling back under the wrong key, by parsing with no format provider at all, or by printing under whatever culture the host supplies. Confirm from those spans, then decide which of the two the type meant: read the knob at the named site, or drop the knob so the signature stops advertising something the type cannot feel. Leaving both is the one option that cannot be right.
X3 · Exception handling4.5 / 10Weak✓ Tool-verified

Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.

Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.

  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×3) — clients/barrel-lite/src/wire/transport.ts:570, clients/barrel-lite/src/store/blobstore.ts:93, clients/barrel-lite/src/store/opfs.ts:91
  • `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included. — clients/barrel-lite/src/wire/transport.ts:659
  • `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. — clients/barrel-lite/src/tabs/leader.ts:50
  • `catch _:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×32) — apps/barrel_vectordb/src/barrel_vectordb_diskann.erl:2283, apps/barrel_vectordb/src/barrel_vectordb_diskann_file.erl:661, apps/barrel_vectordb/src/barrel_vectordb_diskann_file.erl:744, …
  • `catch error:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×3) — apps/barrel_server/src/barrel_server_mcp_agent.erl:447, apps/barrel_server/src/barrel_server_spaces.erl:426, apps/barrel_server/src/barrel_server_sync.erl:879

What to do

  • Swallowed exception (empty catch)
X5 · Nullable reference types9.4 / 10Exemplary✓ Tool-verified

Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

  • ~1.5 `!` null assertions per 1k TypeScript source lines — 9 assertion(s) across the 6124 source line(s) of the 43 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: clients/barrel-lite/src/codec/live.ts (6), clients/barrel-lite/src/store/localstore.ts (3). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.

What to do

  • The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).

Reference — by lens

The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.

LensScoreRatingImpact
Code Health70%StrongSolid.
Architecture98%ExemplarySolid.
Maturity74%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness68%AdequateAcceptable, with room to improve.
Security62%Checked 5 of 11Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Event-Driven35%Weak — gated by ED1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Event Sourcing100%ExemplaryStrongest area.
Performance100%ExemplarySolid.
Unscored — 5 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • AXH1 Runtime security headers — 11 observation(s) recorded · Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility (rendered) — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • P12 CI test-gate honesty — 1 observation(s) recorded · Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • X10 Duplicated predicate — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X31 Test-only surface in a production module — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 control(s) we could not find positive evidence for

These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.

  • C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
Not included — 72 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — Not applicable: the BEAM has no dependency-injection container — state lives in processes, and no process is handed an instance whose lifetime another one scopes; this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. Erlang processes share no mutable memory — state lives in a process's own mailbox — so there is no shared object to race on. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — AX6 reached only 8% of this repository's production lines — erlang (62,839 lines), python (745 lines), c (228 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AXA1 Runtime unauthenticated reachability — This run crawled public routes only — it had no logged-in session, so there is no authenticated surface to compare anonymous access against and nothing was measured. This is a statement about this run, not about your application: nothing here says access control is missing, and nothing here says it is present.
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXI1 Runtime container hardening — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXO1 Runtime API surface — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXS1 Runtime exposed surface — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D11 Test Reliability — Test reliability not scored — polyglot repository, one half's runner produced no measurement
  • D12 Dependency Hygiene — Not scored — 4 shipped Python distribution(s) were read, but the outdated signal needs pypi.org, and no declaration here carries an exact pin to ask about — a floor or a range installs the newest release it admits and cannot be behind one, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
  • D16 Bus Factor — single-maintainer repository — bus factor is not applicable
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D21 Naming Consistency — Naming consistency does not read html yet; not measured.
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D25 ADR Conformance — no ADRs to check
  • D32 Data Compliance (PII/GDPR) — 1 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — clients/barrel-lite/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
  • DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (51 value object(s))
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES2 Immutable events — not applicable — the code was read and holds no persisted event, so there is nothing for this check to judge
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the Erlang, JavaScript/TypeScript, Python source, so there is no service whose uptime a failing dependency could take down
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `erlperf:run`/`compare`/`benchmark`/`time` calls, a common_test `benchmark_data` event, `bench_*` functions in a `bench_*.erl` module where rebar.config installs rebar3_bench, or erlperf or rebar3_bench in a rebar.config, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X1 Async correctness — X1 reached only 9% of this repository's production lines — erlang (62,839 lines), c (228 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X12 Unreachable branch — X12 reached only 9% of this repository's production lines — erlang (62,839 lines), c (228 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X16 Unfloored truncation loop — X16 reached only 8% of this repository's production lines — erlang (62,839 lines), python (745 lines), c (228 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X17 Uncapped recursion over a caller-supplied document — X17 reached only 9% of this repository's production lines — erlang (62,839 lines), c (228 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X21 Side-effecting pattern guard — X21 reached only 9% of this repository's production lines — erlang (62,839 lines), c (228 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X27 Collection changed while being enumerated — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X28 Index access outside its own emptiness guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X29 Per-element action decided by a fixed element — X29 reached only 8% of this repository's production lines — erlang (62,839 lines), python (745 lines), c (228 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X30 Support guard that admits what it rejects — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — X4 reached only 9% of this repository's production lines — erlang (62,839 lines), c (228 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X7 Silent fallback defaults — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Critical — 61 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 20 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×1
  • REDACTED
Serious — 491 finding(s)
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×36
  • Swallowed exception (caught, then discarded) clients/barrel-lite/src/wire/transport.ts:659 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
  • Swallowed exception (caught, then discarded) apps/barrel_vectordb/src/barrel_vectordb_diskann.erl:2283 — `catch _:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) apps/barrel_vectordb/src/barrel_vectordb_diskann_file.erl:661 — `catch _:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) apps/barrel_vectordb/src/barrel_vectordb_diskann_file.erl:744 — `catch _:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) apps/barrel_vectordb/src/barrel_vectordb_docdb_backend.erl:98 — `catch _:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) apps/barrel_vectordb/src/barrel_vectordb_server.erl:1006 — `catch _:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) apps/barrel_vectordb/src/barrel_vectordb_server.erl:1189 — `catch _:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) apps/barrel_vectordb/src/barrel_vectordb_server.erl:1213 — `catch _:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) apps/barrel_vectordb/src/barrel_vectordb_store.erl:303 — `catch _:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) apps/barrel_spaces/src/barrel_spaces_janitor.erl:92 — `catch _:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) apps/barrel_server/src/barrel_server_app.erl:31 — `catch _:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) apps/barrel_server/src/barrel_server_http.erl:368 — `catch _:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) apps/barrel_server/src/barrel_server_http.erl:375 — `catch _:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) apps/barrel_server/src/barrel_server_http.erl:623 — `catch _:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) apps/barrel_server/src/barrel_server_http.erl:738 — `catch _:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) apps/barrel_server/src/barrel_server_http.erl:790 — `catch _:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) apps/barrel_server/src/barrel_server_http.erl:1220 — `catch _:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) apps/barrel_server/src/barrel_server_http.erl:1326 — `catch _:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) apps/barrel_server/src/barrel_server_mcp.erl:128 — `catch _:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) apps/barrel_server/src/barrel_server_mcp_agent.erl:447 — `catch error:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) apps/barrel_server/src/barrel_server_mcp_tools.erl:315 — `catch _:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) apps/barrel_server/src/barrel_server_mcp_tools.erl:481 — `catch _:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) apps/barrel_server/src/barrel_server_mcp_tools.erl:518 — `catch _:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) apps/barrel_server/src/barrel_server_spaces.erl:426 — `catch error:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) apps/barrel_server/src/barrel_server_sync.erl:535 — `catch _:_` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • + 11 more in this group — see findings.md.
D3 · God Classes · TooManyFunctions · ×23
  • TooManyFunctions: barrel_ngram_regex apps/barrel_ngram/src/barrel_ngram_regex.erl:29 — TooManyFunctions — 54 functions. The bar is 30 functions; this is 24 over it, 1.80× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
  • TooManyFunctions: barrel_ctx apps/barrel/src/barrel_ctx.erl:12 — TooManyFunctions — 50 functions. The bar is 30 functions; this is 20 over it, 1.67× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
  • TooManyFunctions: barrel_att_store apps/barrel_docdb/src/barrel_att_store.erl:31 — TooManyFunctions — 50 functions. The bar is 30 functions; this is 20 over it, 1.67× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
  • TooManyFunctions: barrel_ngram_query apps/barrel_ngram/src/barrel_ngram_query.erl:22 — TooManyFunctions — 49 functions. The bar is 30 functions; this is 19 over it, 1.63× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
  • TooManyFunctions: barrel_dbs apps/barrel/src/barrel_dbs.erl:38 — TooManyFunctions — 46 functions. The bar is 30 functions; this is 16 over it, 1.53× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
  • TooManyFunctions: barrel_ctx_export apps/barrel/src/barrel_ctx_export.erl:25 — TooManyFunctions — 45 functions. The bar is 30 functions; this is 15 over it, 1.50× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
  • TooManyFunctions: barrel_ngram_corpus_lifecycle apps/barrel_ngram/src/barrel_ngram_corpus_lifecycle.erl:38 — TooManyFunctions — 43 functions. The bar is 30 functions; this is 13 over it, 1.43× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
  • TooManyFunctions: barrel_server_auth apps/barrel_server/src/barrel_server_auth.erl:34 — TooManyFunctions — 43 functions. The bar is 30 functions; this is 13 over it, 1.43× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
  • TooManyFunctions: barrel_doc apps/barrel_docdb/src/barrel_doc.erl:14 — TooManyFunctions — 42 functions. The bar is 30 functions; this is 12 over it, 1.40× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
  • TooManyFunctions: barrel_server_mcp_tools apps/barrel_server/src/barrel_server_mcp_tools.erl:15 — TooManyFunctions — 41 functions. The bar is 30 functions; this is 11 over it, 1.37× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
  • TooManyFunctions: barrel_server_spaces apps/barrel_server/src/barrel_server_spaces.erl:14 — TooManyFunctions — 40 functions. The bar is 30 functions; this is 10 over it, 1.33× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
  • TooManyFunctions: barrel_ctx_remote apps/barrel/src/barrel_ctx_remote.erl:8 — TooManyFunctions — 39 functions. The bar is 30 functions; this is 9 over it, 1.30× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
  • TooManyFunctions: barrel_ngram apps/barrel_ngram/src/barrel_ngram.erl:31 — TooManyFunctions — 39 functions. The bar is 30 functions; this is 9 over it, 1.30× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
  • TooManyFunctions: barrel_ngram_shard apps/barrel_ngram/src/barrel_ngram_shard.erl:36 — TooManyFunctions — 39 functions. The bar is 30 functions; this is 9 over it, 1.30× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
  • TooManyFunctions: barrel_spaces apps/barrel_spaces/src/barrel_spaces.erl:21 — TooManyFunctions — 38 functions. The bar is 30 functions; this is 8 over it, 1.27× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
  • TooManyFunctions: barrel_ctx_ws apps/barrel/src/barrel_ctx_ws.erl:12 — TooManyFunctions — 37 functions. The bar is 30 functions; this is 7 over it, 1.23× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
  • TooManyFunctions: barrel_ctx_catalog apps/barrel/src/barrel_ctx_catalog.erl:7 — TooManyFunctions — 36 functions. The bar is 30 functions; this is 6 over it, 1.20× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
  • TooManyFunctions: barrel_att_feed apps/barrel_docdb/src/barrel_att_feed.erl:29 — TooManyFunctions — 34 functions. The bar is 30 functions; this is 4 over it, 1.13× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
  • TooManyFunctions: barrel_live apps/barrel_docdb/src/barrel_live.erl:13 — TooManyFunctions — 34 functions. The bar is 30 functions; this is 4 over it, 1.13× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
  • TooManyFunctions: barrel_server_mcp_contexts apps/barrel_server/src/barrel_server_mcp_contexts.erl:9 — TooManyFunctions — 34 functions. The bar is 30 functions; this is 4 over it, 1.13× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
  • TooManyFunctions: barrel_ctx_slice apps/barrel/src/barrel_ctx_slice.erl:18 — TooManyFunctions — 32 functions. The bar is 30 functions; this is 2 over it, 1.07× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
  • TooManyFunctions: barrel_rep_att apps/barrel_docdb/src/barrel_rep_att.erl:20 — TooManyFunctions — 32 functions. The bar is 30 functions; this is 2 over it, 1.07× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
  • TooManyFunctions: barrel_server_mcp_agent apps/barrel_server/src/barrel_server_mcp_agent.erl:12 — TooManyFunctions — 31 functions. The bar is 30 functions; this is 1 over it, 1.03× the bar. The counted members are a module's functions — a module holds no instance state, so there is no shared data to group them by and no type to move them onto. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no single module carries every responsibility.
D3 · God Classes · FileTooLong · ×21
  • FileTooLong: src/barrel_db_server.erl apps/barrel_docdb/src/barrel_db_server.erl — FileTooLong — 2982 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 252 functions. The bar is 500 significant lines; this is 2482 over it, 5.96× the bar. In this language a module is exactly one source file, so its length cannot be moved into sibling files of the same module. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no one module has to be read whole to change one of them.
  • FileTooLong: src/barrel_query.erl apps/barrel_docdb/src/barrel_query.erl — FileTooLong — 2723 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 168 functions. The bar is 500 significant lines; this is 2223 over it, 5.45× the bar. In this language a module is exactly one source file, so its length cannot be moved into sibling files of the same module. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no one module has to be read whole to change one of them.
  • FileTooLong: src/barrel_att_s3_store.erl apps/barrel_att_s3/src/barrel_att_s3_store.erl — FileTooLong — 1261 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 110 functions. The bar is 500 significant lines; this is 761 over it, 2.52× the bar. In this language a module is exactly one source file, so its length cannot be moved into sibling files of the same module. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no one module has to be read whole to change one of them.
  • FileTooLong: src/barrel_rep_tasks.erl apps/barrel_docdb/src/barrel_rep_tasks.erl — FileTooLong — 1139 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 112 functions. The bar is 500 significant lines; this is 639 over it, 2.28× the bar. In this language a module is exactly one source file, so its length cannot be moved into sibling files of the same module. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no one module has to be read whole to change one of them.
  • FileTooLong: src/barrel_changes.erl apps/barrel_docdb/src/barrel_changes.erl — FileTooLong — 1106 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 67 functions. The bar is 500 significant lines; this is 606 over it, 2.21× the bar. In this language a module is exactly one source file, so its length cannot be moved into sibling files of the same module. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no one module has to be read whole to change one of them.
  • FileTooLong: src/barrel_server_http.erl apps/barrel_server/src/barrel_server_http.erl — FileTooLong — 1102 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 105 functions. The bar is 500 significant lines; this is 602 over it, 2.20× the bar. In this language a module is exactly one source file, so its length cannot be moved into sibling files of the same module. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no one module has to be read whole to change one of them.
  • FileTooLong: src/barrel.erl apps/barrel/src/barrel.erl — FileTooLong — 1053 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 118 functions. The bar is 500 significant lines; this is 553 over it, 2.11× the bar. In this language a module is exactly one source file, so its length cannot be moved into sibling files of the same module. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no one module has to be read whole to change one of them.
  • FileTooLong: src/barrel_att_store_blob.erl apps/barrel_docdb/src/barrel_att_store_blob.erl — FileTooLong — 871 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 89 functions. The bar is 500 significant lines; this is 371 over it, 1.74× the bar. In this language a module is exactly one source file, so its length cannot be moved into sibling files of the same module. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no one module has to be read whole to change one of them.
  • FileTooLong: src/barrel_store_rocksdb.erl apps/barrel_docdb/src/barrel_store_rocksdb.erl — FileTooLong — 865 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 95 functions. The bar is 500 significant lines; this is 365 over it, 1.73× the bar. In this language a module is exactly one source file, so its length cannot be moved into sibling files of the same module. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no one module has to be read whole to change one of them.
  • FileTooLong: src/barrel_docdb_codec_cbor.erl apps/barrel_docdb/src/barrel_docdb_codec_cbor.erl — FileTooLong — 797 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 77 functions. The bar is 500 significant lines; this is 297 over it, 1.59× the bar. In this language a module is exactly one source file, so its length cannot be moved into sibling files of the same module. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no one module has to be read whole to change one of them.
  • FileTooLong: src/barrel_rep_transport_http.erl apps/barrel_docdb/src/barrel_rep_transport_http.erl — FileTooLong — 768 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 76 functions. The bar is 500 significant lines; this is 268 over it, 1.54× the bar. In this language a module is exactly one source file, so its length cannot be moved into sibling files of the same module. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no one module has to be read whole to change one of them.
  • FileTooLong: src/barrel_bql_lower.erl apps/barrel_docdb/src/barrel_bql_lower.erl — FileTooLong — 754 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 67 functions. The bar is 500 significant lines; this is 254 over it, 1.51× the bar. In this language a module is exactly one source file, so its length cannot be moved into sibling files of the same module. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no one module has to be read whole to change one of them.
  • FileTooLong: src/barrel_server_sync.erl apps/barrel_server/src/barrel_server_sync.erl — FileTooLong — 752 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 63 functions. The bar is 500 significant lines; this is 252 over it, 1.50× the bar. In this language a module is exactly one source file, so its length cannot be moved into sibling files of the same module. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no one module has to be read whole to change one of them.
  • FileTooLong: src/barrel_ars_index.erl apps/barrel_docdb/src/barrel_ars_index.erl — FileTooLong — 725 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 64 functions. The bar is 500 significant lines; this is 225 over it, 1.45× the bar. In this language a module is exactly one source file, so its length cannot be moved into sibling files of the same module. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no one module has to be read whole to change one of them.
  • FileTooLong: src/barrel_store_keys.erl apps/barrel_docdb/src/barrel_store_keys.erl — FileTooLong — 632 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 124 functions. The bar is 500 significant lines; this is 132 over it, 1.26× the bar. In this language a module is exactly one source file, so its length cannot be moved into sibling files of the same module. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no one module has to be read whole to change one of them.
  • FileTooLong: src/barrel_ctx_query.erl apps/barrel/src/barrel_ctx_query.erl — FileTooLong — 610 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 68 functions. The bar is 500 significant lines; this is 110 over it, 1.22× the bar. In this language a module is exactly one source file, so its length cannot be moved into sibling files of the same module. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no one module has to be read whole to change one of them.
  • FileTooLong: src/barrel_timeline.erl apps/barrel_docdb/src/barrel_timeline.erl — FileTooLong — 605 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 34 functions. The bar is 500 significant lines; this is 105 over it, 1.21× the bar. In this language a module is exactly one source file, so its length cannot be moved into sibling files of the same module. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no one module has to be read whole to change one of them.
  • FileTooLong: src/barrel_session.erl apps/barrel_spaces/src/barrel_session.erl — FileTooLong — 581 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 67 functions. The bar is 500 significant lines; this is 81 over it, 1.16× the bar. In this language a module is exactly one source file, so its length cannot be moved into sibling files of the same module. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no one module has to be read whole to change one of them.
  • FileTooLong: src/barrel_rep.erl apps/barrel_docdb/src/barrel_rep.erl — FileTooLong — 540 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 37 functions. The bar is 500 significant lines; this is 40 over it, 1.08× the bar. In this language a module is exactly one source file, so its length cannot be moved into sibling files of the same module. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no one module has to be read whole to change one of them.
  • FileTooLong: src/db.ts clients/barrel-lite/src/db.ts — FileTooLong — 534 significant lines (blank, comment-only and punctuation-only lines excluded), about 84% of them inside a single declaration: Database (127-782). The bar is 500 significant lines; this is 34 over it, 1.07× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: src/barrel_ngram_segment.erl apps/barrel_ngram/src/barrel_ngram_segment.erl — FileTooLong — 519 significant lines (blank, comment-only and punctuation-only lines excluded), declaring 42 functions. The bar is 500 significant lines; this is 19 over it, 1.04× the bar. In this language a module is exactly one source file, so its length cannot be moved into sibling files of the same module. To reduce it, extract each cohesive family of functions into a new module of its own and have this one delegate to it, so no one module has to be read whole to change one of them.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×14
  • Edited copy of a member (10 corresponding lines) apps/barrel_docdb/src/barrel_sync_sig.erl:222 — apps/barrel_docdb/src/barrel_sync_sig.erl:222-234 | apps/barrel_docdb/src/barrel_sync_sig.erl:242-251 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) apps/barrel/src/barrel.erl:988 — apps/barrel/src/barrel.erl:988-997 | apps/barrel/src/barrel.erl:1017-1028 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) apps/barrel_docdb/src/barrel_ars_index.erl:875 — apps/barrel_docdb/src/barrel_ars_index.erl:875-884 | apps/barrel_docdb/src/barrel_ars_index.erl:889-900 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) apps/barrel_docdb/src/barrel_store_rocksdb.erl:761 — apps/barrel_docdb/src/barrel_store_rocksdb.erl:761-770 | apps/barrel_docdb/src/barrel_store_rocksdb.erl:784-796 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) apps/barrel_server/src/barrel_server_http.erl:443 — apps/barrel_server/src/barrel_server_http.erl:443-455 | apps/barrel_server/src/barrel_server_http.erl:571-580 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) apps/barrel_docdb/src/barrel_att_store.erl:146 — apps/barrel_docdb/src/barrel_att_store.erl:146-155 | apps/barrel_docdb/src/barrel_att_store.erl:327-336 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) apps/barrel_server/src/barrel_server_mcp_tools.erl:197 — apps/barrel_server/src/barrel_server_mcp_tools.erl:197-206 | apps/barrel_server/src/barrel_server_mcp_tools.erl:554-563 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) apps/barrel_server/src/barrel_server_mcp_resources.erl:89 — apps/barrel_server/src/barrel_server_mcp_resources.erl:89-101 | apps/barrel_server/src/barrel_server_mcp_resources.erl:103-112 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) apps/barrel_docdb/src/barrel_att_feed.erl:131 — apps/barrel_docdb/src/barrel_att_feed.erl:131-140 | apps/barrel_docdb/src/barrel_db_server.erl:3453-3462 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) apps/barrel/src/barrel_record_backfill.erl:171 — apps/barrel/src/barrel_record_backfill.erl:171-180 | apps/barrel/src/barrel_record_indexer.erl:324-333 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) apps/barrel_docdb/src/barrel_ars_index.erl:109 — apps/barrel_docdb/src/barrel_ars_index.erl:109-120 | apps/barrel_docdb/src/barrel_ars_index.erl:134-143 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) apps/barrel_docdb/src/barrel_att_store_blob.erl:738 — apps/barrel_docdb/src/barrel_att_store_blob.erl:738-747 | apps/barrel_docdb/src/barrel_store_rocksdb.erl:596-610 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) apps/barrel_ngram/src/barrel_ngram_corpus_lifecycle.erl:245 — apps/barrel_ngram/src/barrel_ngram_corpus_lifecycle.erl:245-254 | apps/barrel_ngram/src/barrel_ngram_manifest.erl:112-121 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) apps/barrel_ngram/src/barrel_ngram_registry.erl:59 — apps/barrel_ngram/src/barrel_ngram_registry.erl:59-68 | apps/barrel_vectordb/src/barrel_vectordb_registry.erl:59-68 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×12
  • Edited copy of a member (6 corresponding lines) apps/barrel/src/barrel.erl:936 — apps/barrel/src/barrel.erl:936-943 | apps/barrel/src/barrel.erl:947-952 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) apps/barrel_ngram/src/barrel_ngram_shard_sup.erl:44 — apps/barrel_ngram/src/barrel_ngram_shard_sup.erl:44-49 | apps/barrel_ngram/src/barrel_ngram_shard_sup.erl:81-86 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) apps/barrel/src/barrel_ctx_manifest.erl:146 — apps/barrel/src/barrel_ctx_manifest.erl:146-151 | apps/barrel_ngram/src/barrel_ngram_fs.erl:71-76 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) apps/barrel_docdb/src/barrel_docdb_codec_cbor.erl:1019 — apps/barrel_docdb/src/barrel_docdb_codec_cbor.erl:1019-1024 | apps/barrel_docdb/src/barrel_docdb_codec_cbor.erl:1036-1041 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) apps/barrel_ngram/src/barrel_ngram_postings.erl:49 — apps/barrel_ngram/src/barrel_ngram_postings.erl:49-54 | apps/barrel_ngram/src/barrel_ngram_postings_positional.erl:188-193 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) apps/barrel/src/barrel.erl:368 — apps/barrel/src/barrel.erl:368-373 | apps/barrel/src/barrel.erl:478-483 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) apps/barrel_docdb/src/barrel_att_store_blob.erl:592 — apps/barrel_docdb/src/barrel_att_store_blob.erl:592-597 | apps/barrel_docdb/src/barrel_att.erl:55-60 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) apps/barrel_server/src/barrel_server_mcp_contexts.erl:22 — apps/barrel_server/src/barrel_server_mcp_contexts.erl:22-29 | apps/barrel_server/src/barrel_server_mcp_resources.erl:27-32 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) apps/barrel_docdb/src/barrel_db_server.erl:2247 — apps/barrel_docdb/src/barrel_db_server.erl:2247-2252 | apps/barrel_docdb/src/barrel_history.erl:212-218 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) apps/barrel_docdb/src/barrel_rep.erl:767 — apps/barrel_docdb/src/barrel_rep.erl:767-772 | apps/barrel_embed/src/barrel_embed_provider.erl:111-116 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) apps/barrel_att_s3/src/barrel_att_s3_store.erl:496 — apps/barrel_att_s3/src/barrel_att_s3_store.erl:496-501 | apps/barrel_ngram/src/barrel_ngram_corpus_config.erl:77-82 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) apps/barrel_att_s3/src/barrel_att_s3_multipart_gc.erl:81 — apps/barrel_att_s3/src/barrel_att_s3_multipart_gc.erl:81-86 | apps/barrel_spaces/src/barrel_spaces_janitor.erl:47-52 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×12
  • Duplicated block (6 lines × 2) apps/barrel_docdb/src/barrel_bql_exec.erl:177 — apps/barrel_docdb/src/barrel_bql_exec.erl:177-183 | apps/barrel_docdb/src/barrel_bql_exec.erl:210-215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_docdb/src/barrel_bql_exec.erl:177` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) apps/barrel_docdb/src/barrel_doc_body_store.erl:58 — apps/barrel_docdb/src/barrel_doc_body_store.erl:58-63 | apps/barrel_docdb/src/barrel_doc_body_store.erl:79-84 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_docdb/src/barrel_doc_body_store.erl:58` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) apps/barrel_server/src/barrel_server_mcp_agent.erl:419 — apps/barrel_server/src/barrel_server_mcp_agent.erl:419-424 | apps/barrel_server/src/barrel_server_spaces.erl:376-381 — before extracting anything, compare `apps/barrel_server/src/barrel_server_mcp_agent.erl` and `apps/barrel_server/src/barrel_server_spaces.erl` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) apps/barrel_docdb/src/barrel_query_sub.erl:153 — apps/barrel_docdb/src/barrel_query_sub.erl:153-158 | apps/barrel_docdb/src/barrel_sub.erl:145-151 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) apps/barrel_docdb/src/barrel_rep.erl:431 — apps/barrel_docdb/src/barrel_rep.erl:431-436 | apps/barrel_ngram/src/barrel_ngram.erl:356-361 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) apps/barrel_docdb/src/barrel_rep_transport_http.erl:938 — apps/barrel_docdb/src/barrel_rep_transport_http.erl:938-943 | apps/barrel_server/src/barrel_server_sync.erl:609-614 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) apps/barrel_docdb/src/barrel_rocksdb_ro.erl:27 — apps/barrel_docdb/src/barrel_rocksdb_ro.erl:27-32 | apps/barrel_vectordb/src/barrel_vectordb_ro.erl:20-25 — before extracting anything, compare `apps/barrel_docdb/src/barrel_rocksdb_ro.erl` and `apps/barrel_vectordb/src/barrel_vectordb_ro.erl` as WHOLE FILES: 88% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) apps/barrel_embed/src/barrel_embed_venv.erl:292 — apps/barrel_embed/src/barrel_embed_venv.erl:292-297 | apps/barrel_rerank/src/barrel_rerank_venv.erl:232-237 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) apps/barrel_ngram/src/barrel_ngram_postings.erl:67 — apps/barrel_ngram/src/barrel_ngram_postings.erl:67-72 | apps/barrel_ngram/src/barrel_ngram_postings_positional.erl:206-211 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_ngram/src/barrel_ngram_postings.erl:67` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) apps/barrel_server/src/barrel_server_mcp_agent.erl:445 — apps/barrel_server/src/barrel_server_mcp_agent.erl:445-450 | apps/barrel_server/src/barrel_server_spaces.erl:424-429 — before extracting anything, compare `apps/barrel_server/src/barrel_server_mcp_agent.erl` and `apps/barrel_server/src/barrel_server_spaces.erl` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) apps/barrel_embed/src/barrel_embed_port_server.erl:171 — apps/barrel_embed/src/barrel_embed_port_server.erl:171-176 | apps/barrel_rerank/src/barrel_rerank.erl:259-264 — before extracting anything, compare `apps/barrel_embed/src/barrel_embed_port_server.erl` and `apps/barrel_rerank/src/barrel_rerank.erl` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_rerank/src/barrel_rerank.erl:259` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) apps/barrel_docdb/bench/src/workloads/barrel_bench_crud.erl:55 — apps/barrel_docdb/bench/src/workloads/barrel_bench_crud.erl:55-60 | apps/barrel_docdb/bench/src/workloads/barrel_bench_crud.erl:67-72 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_docdb/bench/src/workloads/barrel_bench_crud.erl:55` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
AXH1 · Runtime security headers · Runtime security header not set · ×11
  • Runtime security header not set: content-security-policy — The live app's responses did not include content-security-policy (restricts the sources a page may load — mitigates XSS/injection). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: cross-origin-embedder-policy — The live app's responses did not include cross-origin-embedder-policy (recommended by the OWASP Secure Headers Project (value: require-corp)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: cross-origin-opener-policy — The live app's responses did not include cross-origin-opener-policy (recommended by the OWASP Secure Headers Project (value: same-origin)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: cross-origin-resource-policy — The live app's responses did not include cross-origin-resource-policy (recommended by the OWASP Secure Headers Project (value: same-origin)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: permissions-policy — The live app's responses did not include permissions-policy (restricts powerful browser features (camera, geolocation, …)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: referrer-policy — The live app's responses did not include referrer-policy (limits referrer leakage to third parties). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: strict-transport-security — The live app's responses did not include strict-transport-security (forces HTTPS on subsequent requests — mitigates downgrade/MITM). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: x-content-type-options — The live app's responses did not include x-content-type-options (stops MIME-sniffing (expects 'nosniff')). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: x-dns-prefetch-control — The live app's responses did not include x-dns-prefetch-control (recommended by the OWASP Secure Headers Project (value: off)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: x-frame-options — The live app's responses did not include x-frame-options (blocks clickjacking via framing (or use CSP frame-ancestors)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: x-permitted-cross-domain-policies — The live app's responses did not include x-permitted-cross-domain-policies (recommended by the OWASP Secure Headers Project (value: none)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×10
  • Edited copy of a member (7 corresponding lines) apps/barrel_docdb/src/barrel_doc.erl:471 — apps/barrel_docdb/src/barrel_doc.erl:471-477 | apps/barrel_docdb/src/barrel_docdb_codec_cbor.erl:1153-1159 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) apps/barrel_docdb/src/barrel_parallel.erl:142 — apps/barrel_docdb/src/barrel_parallel.erl:142-148 | apps/barrel_docdb/src/barrel_parallel.erl:151-157 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) apps/barrel_ngram/src/barrel_ngram_merge.erl:115 — apps/barrel_ngram/src/barrel_ngram_merge.erl:115-121 | apps/barrel_ngram/src/barrel_ngram_merge.erl:124-132 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) apps/barrel_ngram/src/barrel_ngram_query.erl:436 — apps/barrel_ngram/src/barrel_ngram_query.erl:436-442 | apps/barrel_ngram/src/barrel_ngram_query.erl:705-711 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) apps/barrel_docdb/src/barrel_bql_exec.erl:233 — apps/barrel_docdb/src/barrel_bql_exec.erl:233-239 | apps/barrel/src/barrel_bql_query.erl:202-208 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) apps/barrel_server/src/barrel_server_mcp_agent.erl:175 — apps/barrel_server/src/barrel_server_mcp_agent.erl:175-181 | apps/barrel_server/src/barrel_server_spaces.erl:73-83 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) apps/barrel_server/src/barrel_server_mcp_tools.erl:213 — apps/barrel_server/src/barrel_server_mcp_tools.erl:213-222 | apps/barrel_server/src/barrel_server_mcp_tools.erl:228-234 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) apps/barrel_server/src/barrel_server_mcp_agent.erl:396 — apps/barrel_server/src/barrel_server_mcp_agent.erl:396-402 | apps/barrel_server/src/barrel_server_spaces.erl:359-365 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) apps/barrel_docdb/src/barrel_rep_checkpoint.erl:362 — apps/barrel_docdb/src/barrel_rep_checkpoint.erl:362-368 | apps/barrel_docdb/src/barrel_timeline.erl:275-281 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) apps/barrel_ngram/src/barrel_ngram_shard_sup.erl:130 — apps/barrel_ngram/src/barrel_ngram_shard_sup.erl:130-136 | apps/barrel_rerank/src/barrel_rerank_sup.erl:28-35 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×10
  • Duplicated block (5 lines × 2) apps/barrel_att_s3/src/barrel_att_s3_store.erl:776 — apps/barrel_att_s3/src/barrel_att_s3_store.erl:776-780 | apps/barrel_docdb/src/barrel_att_store_blob.erl:757-761 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_docdb/src/barrel_att_store_blob.erl:757` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) apps/barrel_docdb/src/barrel_ars_index.erl:728 — apps/barrel_docdb/src/barrel_ars_index.erl:728-732 | apps/barrel_docdb/src/barrel_ars_index.erl:750-754 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) apps/barrel_docdb/src/barrel_store_rocksdb.erl:478 — apps/barrel_docdb/src/barrel_store_rocksdb.erl:478-482 | apps/barrel_docdb/src/barrel_store_rocksdb.erl:716-720 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) apps/barrel_docdb/src/barrel_bql_lower.erl:767 — apps/barrel_docdb/src/barrel_bql_lower.erl:767-771 | apps/barrel_docdb/src/barrel_query.erl:718-722 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) apps/barrel_docdb/src/barrel_rocksdb_ro.erl:34 — apps/barrel_docdb/src/barrel_rocksdb_ro.erl:34-38 | apps/barrel_vectordb/src/barrel_vectordb_ro.erl:27-31 — before extracting anything, compare `apps/barrel_docdb/src/barrel_rocksdb_ro.erl` and `apps/barrel_vectordb/src/barrel_vectordb_ro.erl` as WHOLE FILES: 88% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) apps/barrel_ngram/src/barrel_ngram_postings.erl:57 — apps/barrel_ngram/src/barrel_ngram_postings.erl:57-61 | apps/barrel_ngram/src/barrel_ngram_postings_positional.erl:196-200 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) apps/barrel_ngram/src/barrel_ngram_registry.erl:78 — apps/barrel_ngram/src/barrel_ngram_registry.erl:78-82 | apps/barrel_vectordb/src/barrel_vectordb_registry.erl:72-76 — before extracting anything, compare `apps/barrel_ngram/src/barrel_ngram_registry.erl` and `apps/barrel_vectordb/src/barrel_vectordb_registry.erl` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) apps/barrel_ngram/src/barrel_ngram_registry.erl:88 — apps/barrel_ngram/src/barrel_ngram_registry.erl:88-92 | apps/barrel_vectordb/src/barrel_vectordb_registry.erl:82-86 — before extracting anything, compare `apps/barrel_ngram/src/barrel_ngram_registry.erl` and `apps/barrel_vectordb/src/barrel_vectordb_registry.erl` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) apps/barrel/src/barrel.erl:1118 — apps/barrel/src/barrel.erl:1118-1124 | apps/barrel_vectordb/src/barrel_vectordb_docdb_backend.erl:89-93 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) apps/barrel_docdb/bench/src/workloads/barrel_bench_changes.erl:56 — apps/barrel_docdb/bench/src/workloads/barrel_bench_changes.erl:56-60 | apps/barrel_docdb/bench/src/workloads/barrel_bench_query.erl:377-381 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×9
  • Duplicated block (7 lines × 2) apps/barrel_docdb/src/barrel_query.erl:3517 — apps/barrel_docdb/src/barrel_query.erl:3517-3523 | apps/barrel_docdb/src/barrel_query_sub.erl:503-509 — before extracting anything, compare `apps/barrel_docdb/src/barrel_query.erl` and `apps/barrel_docdb/src/barrel_query_sub.erl` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 143 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) apps/barrel_ngram/src/barrel_ngram_query.erl:138 — apps/barrel_ngram/src/barrel_ngram_query.erl:138-144 | apps/barrel_ngram/src/barrel_ngram_query.erl:606-612 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) apps/barrel_server/src/barrel_server_mcp_agent.erl:462 — apps/barrel_server/src/barrel_server_mcp_agent.erl:462-468 | apps/barrel_server/src/barrel_server_mcp_tools.erl:571-577 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) apps/barrel_server/src/barrel_server_mcp_agent.erl:350 — apps/barrel_server/src/barrel_server_mcp_agent.erl:350-356 | apps/barrel_server/src/barrel_server_spaces.erl:327-333 — before extracting anything, compare `apps/barrel_server/src/barrel_server_mcp_agent.erl` and `apps/barrel_server/src/barrel_server_spaces.erl` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_server/src/barrel_server_mcp_agent.erl:350` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) apps/barrel_docdb/src/barrel_ars_index.erl:1052 — apps/barrel_docdb/src/barrel_ars_index.erl:1052-1058 | apps/barrel_docdb/src/barrel_store_keys.erl:1031-1038 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) apps/barrel_docdb/src/barrel_query.erl:1519 — apps/barrel_docdb/src/barrel_query.erl:1519-1525 | apps/barrel_docdb/src/barrel_query_sub.erl:531-537 — before extracting anything, compare `apps/barrel_docdb/src/barrel_query.erl` and `apps/barrel_docdb/src/barrel_query_sub.erl` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 143 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) apps/barrel_server/src/barrel_server_mcp_agent.erl:36 — apps/barrel_server/src/barrel_server_mcp_agent.erl:36-42 | apps/barrel_server/src/barrel_server_mcp_tools.erl:45-53 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) apps/barrel_server/src/barrel_server_mcp_agent.erl:470 — apps/barrel_server/src/barrel_server_mcp_agent.erl:470-476 | apps/barrel_server/src/barrel_server_mcp_tools.erl:579-585 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_server/src/barrel_server_mcp_agent.erl:470` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) apps/barrel_embed/priv/barrel_embed/providers/clip.py:102 — apps/barrel_embed/priv/barrel_embed/providers/clip.py:102-108 | apps/barrel_embed/priv/barrel_embed/providers/clip.py:129-135 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×8
  • Edited copy of a member (9 corresponding lines) apps/barrel_embed/src/barrel_embed_bedrock.erl:137 — apps/barrel_embed/src/barrel_embed_bedrock.erl:137-157 | apps/barrel_embed/src/barrel_embed_ollama.erl:178-186 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) apps/barrel_ngram/src/barrel_ngram_query.erl:757 — apps/barrel_ngram/src/barrel_ngram_query.erl:757-765 | apps/barrel_ngram/src/barrel_ngram_verify.erl:83-91 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) apps/barrel_ngram/src/barrel_ngram_postings.erl:151 — apps/barrel_ngram/src/barrel_ngram_postings.erl:151-159 | apps/barrel_ngram/src/barrel_ngram_segment.erl:450-459 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) apps/barrel/src/barrel_ctx_query.erl:533 — apps/barrel/src/barrel_ctx_query.erl:533-541 | apps/barrel_server/src/barrel_server_http.erl:732-741 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) apps/barrel_docdb/src/barrel_trace.erl:87 — apps/barrel_docdb/src/barrel_trace.erl:87-95 | apps/barrel_docdb/src/barrel_trace.erl:107-115 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) apps/barrel_ngram/src/barrel_ngram_fs.erl:61 — apps/barrel_ngram/src/barrel_ngram_fs.erl:61-69 | apps/barrel/src/barrel_ctx_manifest.erl:136-144 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) apps/barrel_embed/priv/barrel_embed/server.py:89 — apps/barrel_embed/priv/barrel_embed/server.py:89-98 | apps/barrel_rerank/priv/rerank_server.py:152-160 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) apps/barrel_embed/src/barrel_embed_port_server.erl:228 — apps/barrel_embed/src/barrel_embed_port_server.erl:228-238 | apps/barrel_rerank/src/barrel_rerank.erl:324-332 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×8
  • Edited copy of a member (4 corresponding lines) apps/barrel/src/barrel_ctx_error.erl:438 — apps/barrel/src/barrel_ctx_error.erl:438-441 | apps/barrel/src/barrel_ctx_explain.erl:229-232 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) apps/barrel_docdb/bench/src/barrel_bench.erl:418 — apps/barrel_docdb/bench/src/barrel_bench.erl:418-421 | apps/barrel_docdb/src/barrel_rep_checkpoint.erl:337-342 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) apps/barrel_docdb/src/barrel_rep.erl:807 — apps/barrel_docdb/src/barrel_rep.erl:807-810 | apps/barrel_docdb/src/barrel_rep_alg.erl:256-259 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) apps/barrel_server/src/barrel_server_http.erl:1293 — apps/barrel_server/src/barrel_server_http.erl:1293-1296 | apps/barrel_server/src/barrel_server_mcp_tools.erl:394-397 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) apps/barrel_docdb/src/barrel_att_feed.erl:406 — apps/barrel_docdb/src/barrel_att_feed.erl:406-409 | apps/barrel_docdb/src/barrel_store_keys.erl:274-278 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) apps/barrel_docdb/src/barrel_att_feed.erl:411 — apps/barrel_docdb/src/barrel_att_feed.erl:411-414 | apps/barrel_docdb/src/barrel_store_keys.erl:480-483 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) apps/barrel_docdb/src/barrel_query_sub.erl:160 — apps/barrel_docdb/src/barrel_query_sub.erl:160-163 | apps/barrel_docdb/src/barrel_sub.erl:153-156 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) apps/barrel_docdb/src/barrel_ars_index.erl:960 — apps/barrel_docdb/src/barrel_ars_index.erl:960-963 | apps/barrel_docdb/src/barrel_query.erl:3043-3046 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×7
  • Edited copy of a member (13 corresponding lines) apps/barrel_embed/src/barrel_embed_venv.erl:299 — apps/barrel_embed/src/barrel_embed_venv.erl:299-312 | apps/barrel_rerank/src/barrel_rerank_venv.erl:239-251 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) apps/barrel_docdb/src/barrel_store_rocksdb.erl:613 — apps/barrel_docdb/src/barrel_store_rocksdb.erl:613-625 | apps/barrel_docdb/src/barrel_store_rocksdb.erl:628-640 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) apps/barrel_ngram/src/barrel_ngram_segment.erl:650 — apps/barrel_ngram/src/barrel_ngram_segment.erl:650-663 | apps/barrel_ngram/src/barrel_ngram_segment.erl:671-683 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) apps/barrel_docdb/src/barrel_store_rocksdb.erl:984 — apps/barrel_docdb/src/barrel_store_rocksdb.erl:984-996 | apps/barrel_docdb/src/barrel_store_rocksdb.erl:998-1010 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) apps/barrel_server/src/barrel_server_mcp_agent.erl:215 — apps/barrel_server/src/barrel_server_mcp_agent.erl:215-227 | apps/barrel_server/src/barrel_server_spaces.erl:136-148 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) apps/barrel_docdb/src/barrel_att_store_blob.erl:634 — apps/barrel_docdb/src/barrel_att_store_blob.erl:634-646 | apps/barrel_docdb/src/barrel_store_rocksdb.erl:327-339 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) apps/barrel_docdb/src/barrel_query_cursor.erl:68 — apps/barrel_docdb/src/barrel_query_cursor.erl:68-85 | apps/barrel_docdb/src/barrel_query_cursor.erl:89-101 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D30 · Dependency Vulnerabilities · Medium CVE · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×6
  • Edited copy of a member (17 corresponding lines) apps/barrel_docdb/src/barrel_history.erl:96 — apps/barrel_docdb/src/barrel_history.erl:96-120 | apps/barrel_docdb/src/barrel_outbox.erl:89-105 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) apps/barrel_server/src/barrel_server_mcp_agent.erl:233 — apps/barrel_server/src/barrel_server_mcp_agent.erl:233-251 | apps/barrel_server/src/barrel_server_spaces.erl:435-451 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) apps/barrel_ngram/src/barrel_ngram_segment.erl:357 — apps/barrel_ngram/src/barrel_ngram_segment.erl:357-373 | apps/barrel_ngram/src/barrel_ngram_segment.erl:395-411 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) apps/barrel_docdb/src/barrel_ars_index.erl:169 — apps/barrel_docdb/src/barrel_ars_index.erl:169-185 | apps/barrel_docdb/src/barrel_ars_index.erl:907-935 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) apps/barrel_docdb/src/barrel_query_sub.erl:552 — apps/barrel_docdb/src/barrel_query_sub.erl:552-568 | apps/barrel_docdb/src/barrel_sub.erl:325-343 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) apps/barrel_embed/priv/barrel_embed/providers/clip.py:22 — apps/barrel_embed/priv/barrel_embed/providers/clip.py:22-40 | apps/barrel_embed/priv/barrel_embed/providers/splade.py:19-35 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×6
  • Edited copy of a member (14 corresponding lines) apps/barrel/src/barrel_record_backfill.erl:128 — apps/barrel/src/barrel_record_backfill.erl:128-141 | apps/barrel/src/barrel_record_indexer.erl:288-303 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) apps/barrel_spaces/src/barrel_handoff.erl:99 — apps/barrel_spaces/src/barrel_handoff.erl:99-112 | apps/barrel_spaces/src/barrel_session.erl:667-680 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) apps/barrel_ngram/src/barrel_ngram_query.erl:453 — apps/barrel_ngram/src/barrel_ngram_query.erl:453-466 | apps/barrel_ngram/src/barrel_ngram_query.erl:721-736 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) apps/barrel_server/src/barrel_server_mcp_agent.erl:419 — apps/barrel_server/src/barrel_server_mcp_agent.erl:419-432 | apps/barrel_server/src/barrel_server_spaces.erl:376-390 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) apps/barrel_ngram/src/barrel_ngram_query.erl:488 — apps/barrel_ngram/src/barrel_ngram_query.erl:488-501 | apps/barrel_ngram/src/barrel_ngram_query.erl:742-755 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) apps/barrel_att_s3/src/barrel_att_s3_sup.erl:17 — apps/barrel_att_s3/src/barrel_att_s3_sup.erl:17-30 | apps/barrel_spaces/src/barrel_spaces_sup.erl:19-32 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×6
  • Edited copy of a member (8 corresponding lines) apps/barrel_docdb/src/barrel_parallel.erl:160 — apps/barrel_docdb/src/barrel_parallel.erl:160-167 | apps/barrel_docdb/src/barrel_parallel.erl:170-177 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) apps/barrel_docdb/src/barrel_att_feed.erl:433 — apps/barrel_docdb/src/barrel_att_feed.erl:433-441 | apps/barrel_docdb/src/barrel_att_feed.erl:462-469 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) apps/barrel_docdb/src/barrel_ars_index.erl:727 — apps/barrel_docdb/src/barrel_ars_index.erl:727-734 | apps/barrel_docdb/src/barrel_ars_index.erl:749-756 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) apps/barrel_ngram/src/barrel_ngram_query.erl:349 — apps/barrel_ngram/src/barrel_ngram_query.erl:349-356 | apps/barrel_ngram/src/barrel_ngram_query.erl:358-365 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) apps/barrel_server/src/barrel_server_sync.erl:263 — apps/barrel_server/src/barrel_server_sync.erl:263-272 | apps/barrel_server/src/barrel_server_sync.erl:274-281 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) apps/barrel_docdb/src/barrel_db_server.erl:1127 — apps/barrel_docdb/src/barrel_db_server.erl:1127-1134 | apps/barrel_vectordb/src/barrel_vectordb_crypto.erl:77-84 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×6
  • Edited copy of a member (5 corresponding lines) apps/barrel_ngram/src/barrel_ngram_corpus_lifecycle.erl:418 — apps/barrel_ngram/src/barrel_ngram_corpus_lifecycle.erl:418-426 | apps/barrel_ngram/src/barrel_ngram_shard.erl:709-713 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) apps/barrel_ngram/src/barrel_ngram_regex.erl:439 — apps/barrel_ngram/src/barrel_ngram_regex.erl:439-443 | apps/barrel_ngram/src/barrel_ngram_selector_dense.erl:22-26 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) apps/barrel_server/src/barrel_server_contexts.erl:53 — apps/barrel_server/src/barrel_server_contexts.erl:53-57 | apps/barrel_server/src/barrel_server_worksets.erl:43-47 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) apps/barrel/src/barrel_ctx_catalog.erl:111 — apps/barrel/src/barrel_ctx_catalog.erl:111-115 | apps/barrel_docdb/src/barrel_channel.erl:145-150 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) apps/barrel_docdb/src/barrel_store_keys.erl:564 — apps/barrel_docdb/src/barrel_store_keys.erl:564-569 | apps/barrel_embed/src/barrel_embed_azure.erl:200-204 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) bench/ctx_ranking/ctx_ranking.erl:249 — bench/ctx_ranking/ctx_ranking.erl:249-253 | bench/ctx_ranking/ctx_ranking.erl:260-264 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D15 · Churn × Complexity Hotspots · Hotspot · ×5
  • Hotspot: apps/barrel_docdb/src/barrel_db_server.erl apps/barrel_docdb/src/barrel_db_server.erl:693 — apps/barrel_docdb/src/barrel_db_server.erl changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in barrel_db_server.handle_call_rw at line 693. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 17:52:02 +01:00' --until='2026-11-14 17:52:02 +01:00' --full-history --no-merges -- apps/barrel_docdb/src/barrel_db_server.erl`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: apps/barrel_vectordb/src/barrel_vectordb_server.erl apps/barrel_vectordb/src/barrel_vectordb_server.erl:463 — apps/barrel_vectordb/src/barrel_vectordb_server.erl changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in barrel_vectordb_server.handle_read at line 463. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 17:52:02 +01:00' --until='2026-11-14 17:52:02 +01:00' --full-history --no-merges -- apps/barrel_vectordb/src/barrel_vectordb_server.erl`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: apps/barrel_att_s3/src/barrel_att_s3_store.erl apps/barrel_att_s3/src/barrel_att_s3_store.erl:1575 — apps/barrel_att_s3/src/barrel_att_s3_store.erl changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in barrel_att_s3_store.finish_stream at line 1575. 1 of those changes was a fix/bug commit, and the other 6 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 17:52:02 +01:00' --until='2026-11-14 17:52:02 +01:00' --full-history --no-merges -- apps/barrel_att_s3/src/barrel_att_s3_store.erl`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: apps/barrel/src/barrel_dbs.erl apps/barrel/src/barrel_dbs.erl:290 — apps/barrel/src/barrel_dbs.erl changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in barrel_dbs.do_call at line 290. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 17:52:02 +01:00' --until='2026-11-14 17:52:02 +01:00' --full-history --no-merges -- apps/barrel/src/barrel_dbs.erl`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: apps/barrel_docdb/src/barrel_changes.erl apps/barrel_docdb/src/barrel_changes.erl:588 — apps/barrel_docdb/src/barrel_changes.erl changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in barrel_changes.get_changes_filtered_chunked at line 588. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 17:52:02 +01:00' --until='2026-11-14 17:52:02 +01:00' --full-history --no-merges -- apps/barrel_docdb/src/barrel_changes.erl`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×5
  • Edited copy of a member (15 corresponding lines) apps/barrel_docdb/src/barrel_query.erl:1016 — apps/barrel_docdb/src/barrel_query.erl:1016-1030 | apps/barrel_docdb/src/barrel_query.erl:1145-1161 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) apps/barrel_att_s3/src/barrel_att_s3_store.erl:775 — apps/barrel_att_s3/src/barrel_att_s3_store.erl:775-793 | apps/barrel_docdb/src/barrel_att_store_blob.erl:756-770 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) apps/barrel_embed/priv/barrel_embed/providers/clip.py:70 — apps/barrel_embed/priv/barrel_embed/providers/clip.py:70-84 | apps/barrel_embed/priv/barrel_embed/server.py:101-115 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) apps/barrel_embed/src/barrel_embed_venv.erl:84 — apps/barrel_embed/src/barrel_embed_venv.erl:84-102 | apps/barrel_rerank/src/barrel_rerank_venv.erl:94-108 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) apps/barrel_embed/src/barrel_embed_bedrock.erl:89 — apps/barrel_embed/src/barrel_embed_bedrock.erl:89-103 | apps/barrel_embed/src/barrel_embed_cohere.erl:78-93 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×5
  • Duplicated block (10 lines × 2) apps/barrel_docdb/src/barrel_changes.erl:136 — apps/barrel_docdb/src/barrel_changes.erl:136-145 | apps/barrel_docdb/src/barrel_changes.erl:173-182 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_docdb/src/barrel_changes.erl:136` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) apps/barrel_ngram/src/barrel_ngram_registry.erl:35 — apps/barrel_ngram/src/barrel_ngram_registry.erl:35-44 | apps/barrel_vectordb/src/barrel_vectordb_registry.erl:35-44 — before extracting anything, compare `apps/barrel_ngram/src/barrel_ngram_registry.erl` and `apps/barrel_vectordb/src/barrel_vectordb_registry.erl` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) apps/barrel_server/src/barrel_server_mcp_agent.erl:434 — apps/barrel_server/src/barrel_server_mcp_agent.erl:434-443 | apps/barrel_server/src/barrel_server_spaces.erl:394-403 — before extracting anything, compare `apps/barrel_server/src/barrel_server_mcp_agent.erl` and `apps/barrel_server/src/barrel_server_spaces.erl` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) apps/barrel_docdb/src/barrel_history.erl:111 — apps/barrel_docdb/src/barrel_history.erl:111-120 | apps/barrel_docdb/src/barrel_outbox.erl:96-105 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) apps/barrel_docdb/bench/src/workloads/barrel_bench_changes.erl:19 — apps/barrel_docdb/bench/src/workloads/barrel_bench_changes.erl:19-29 | apps/barrel_docdb/bench/src/workloads/barrel_bench_query.erl:17-26 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_docdb/bench/src/workloads/barrel_bench_changes.erl:19` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D31 · IaC & Container Security · Medium IaC · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×4
  • Edited copy of a member (11 corresponding lines) apps/barrel_server/src/barrel_server_mcp_agent.erl:349 — apps/barrel_server/src/barrel_server_mcp_agent.erl:349-359 | apps/barrel_server/src/barrel_server_spaces.erl:323-340 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) apps/barrel_docdb/src/barrel_rep_transport_http.erl:161 — apps/barrel_docdb/src/barrel_rep_transport_http.erl:161-174 | apps/barrel_docdb/src/barrel_rep_transport_http.erl:211-221 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) apps/barrel_docdb/src/barrel_docdb_reader.erl:356 — apps/barrel_docdb/src/barrel_docdb_reader.erl:356-369 | apps/barrel_docdb/src/barrel_docdb_reader.erl:372-382 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) apps/barrel_docdb/src/barrel_ars_index.erl:224 — apps/barrel_docdb/src/barrel_ars_index.erl:224-235 | apps/barrel_docdb/src/barrel_ars_index.erl:242-252 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×4
  • Edited copy of a member (12 corresponding lines) apps/barrel_att_s3/src/barrel_att_s3_store.erl:746 — apps/barrel_att_s3/src/barrel_att_s3_store.erl:746-757 | apps/barrel_docdb/src/barrel_att_store_blob.erl:775-787 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) apps/barrel_docdb/src/barrel_rep_tasks.erl:1313 — apps/barrel_docdb/src/barrel_rep_tasks.erl:1313-1324 | apps/barrel_docdb/src/barrel_rep_tasks.erl:1327-1339 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) apps/barrel_docdb/src/barrel_att_feed.erl:444 — apps/barrel_docdb/src/barrel_att_feed.erl:444-459 | apps/barrel_docdb/src/barrel_att_feed.erl:472-483 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) apps/barrel_docdb/src/barrel_att_feed.erl:193 — apps/barrel_docdb/src/barrel_att_feed.erl:193-205 | apps/barrel_docdb/src/barrel_db_server.erl:2354-2365 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×4
  • Duplicated block (15 lines × 2) apps/barrel_docdb/src/barrel_ars_index.erl:392 — apps/barrel_docdb/src/barrel_ars_index.erl:392-406 | apps/barrel_docdb/src/barrel_ars_index.erl:551-565 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) apps/barrel_docdb/src/barrel_ars_index.erl:603 — apps/barrel_docdb/src/barrel_ars_index.erl:603-617 | apps/barrel_docdb/src/barrel_ars_index.erl:627-641 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) apps/barrel_embed/src/barrel_embed_jina.erl:73 — apps/barrel_embed/src/barrel_embed_jina.erl:73-87 | apps/barrel_embed/src/barrel_embed_voyage.erl:72-86 — before extracting anything, compare `apps/barrel_embed/src/barrel_embed_jina.erl` and `apps/barrel_embed/src/barrel_embed_voyage.erl` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 133 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_embed/src/barrel_embed_jina.erl:73` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) apps/barrel_embed/src/barrel_embed_venv.erl:275 — apps/barrel_embed/src/barrel_embed_venv.erl:275-289 | apps/barrel_rerank/src/barrel_rerank_venv.erl:215-229 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×4
  • Duplicated block (11 lines × 2) apps/barrel_docdb/src/barrel_store_rocksdb.erl:329 — apps/barrel_docdb/src/barrel_store_rocksdb.erl:329-339 | apps/barrel_docdb/src/barrel_store_rocksdb.erl:344-354 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) apps/barrel_docdb/src/barrel_store_rocksdb.erl:986 — apps/barrel_docdb/src/barrel_store_rocksdb.erl:986-996 | apps/barrel_docdb/src/barrel_store_rocksdb.erl:1000-1010 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) apps/barrel_ngram/src/barrel_ngram_fs.erl:86 — apps/barrel_ngram/src/barrel_ngram_fs.erl:86-96 | apps/barrel_ngram/src/barrel_ngram_roaring.erl:43-53 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) apps/barrel_docdb/src/barrel_query.erl:3545 — apps/barrel_docdb/src/barrel_query.erl:3545-3555 | apps/barrel_docdb/src/barrel_query_sub.erl:540-550 — before extracting anything, compare `apps/barrel_docdb/src/barrel_query.erl` and `apps/barrel_docdb/src/barrel_query_sub.erl` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 143 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×4
  • Duplicated block (9 lines × 2) apps/barrel_att_s3/src/barrel_att_s3_store.erl:679 — apps/barrel_att_s3/src/barrel_att_s3_store.erl:679-687 | apps/barrel_att_s3/src/barrel_att_s3_store.erl:1588-1596 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) apps/barrel_docdb/src/barrel_parallel.erl:202 — apps/barrel_docdb/src/barrel_parallel.erl:202-210 | apps/barrel_docdb/src/barrel_parallel.erl:242-250 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) apps/barrel_docdb/src/barrel_query.erl:2367 — apps/barrel_docdb/src/barrel_query.erl:2367-2375 | apps/barrel_docdb/src/barrel_query.erl:2555-2563 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) apps/barrel_docdb/src/barrel_query.erl:3391 — apps/barrel_docdb/src/barrel_query.erl:3391-3399 | apps/barrel_docdb/src/barrel_query_sub.erl:388-396 — before extracting anything, compare `apps/barrel_docdb/src/barrel_query.erl` and `apps/barrel_docdb/src/barrel_query_sub.erl` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 143 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×4
  • Duplicated block (8 lines × 2) apps/barrel_docdb/src/barrel_ars_index.erl:876 — apps/barrel_docdb/src/barrel_ars_index.erl:876-883 | apps/barrel_docdb/src/barrel_ars_index.erl:890-897 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) apps/barrel_docdb/src/barrel_store_rocksdb.erl:389 — apps/barrel_docdb/src/barrel_store_rocksdb.erl:389-396 | apps/barrel_docdb/src/barrel_store_rocksdb.erl:405-412 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) apps/barrel_docdb/src/barrel_store_rocksdb.erl:736 — apps/barrel_docdb/src/barrel_store_rocksdb.erl:736-743 | apps/barrel_docdb/src/barrel_store_rocksdb.erl:752-759 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_docdb/src/barrel_store_rocksdb.erl:736` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) apps/barrel_docdb/src/barrel_ars_index.erl:1042 — apps/barrel_docdb/src/barrel_ars_index.erl:1042-1049 | apps/barrel_docdb/src/barrel_store_keys.erl:1057-1064 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_docdb/src/barrel_ars_index.erl:1042` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
X3 · Exception handling · Swallowed exception (empty catch) · ×4
  • Swallowed exception (empty catch) clients/barrel-lite/src/wire/transport.ts:570 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) clients/barrel-lite/src/tabs/leader.ts:50 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) clients/barrel-lite/src/store/blobstore.ts:93 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) clients/barrel-lite/src/store/opfs.ts:91 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (5 members, 50+ identical tokens) apps/barrel_embed/src/barrel_embed_azure.erl:213 — apps/barrel_embed/src/barrel_embed_azure.erl:213-233 | apps/barrel_embed/src/barrel_embed_jina.erl:181-201 | apps/barrel_embed/src/barrel_embed_mistral.erl:167-187 | apps/barrel_embed/src/barrel_embed_openai.erl:161-181 | apps/barrel_embed/src/barrel_embed_voyage.erl:179-199 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) apps/barrel_embed/src/barrel_embed_clip.erl:91 — apps/barrel_embed/src/barrel_embed_clip.erl:91-135 | apps/barrel_embed/src/barrel_embed_colbert.erl:95-139 | apps/barrel_embed/src/barrel_embed_fastembed.erl:67-104 | apps/barrel_embed/src/barrel_embed_local.erl:72-106 | apps/barrel_embed/src/barrel_embed_splade.erl:91-135 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) apps/barrel_embed/src/barrel_embed_cohere.erl:97 — apps/barrel_embed/src/barrel_embed_cohere.erl:97-122 | apps/barrel_embed/src/barrel_embed_jina.erl:91-114 | apps/barrel_embed/src/barrel_embed_mistral.erl:83-106 | apps/barrel_embed/src/barrel_embed_openai.erl:97-116 | apps/barrel_embed/src/barrel_embed_voyage.erl:90-113 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×3
  • Edited copy of a member (32 corresponding lines) apps/barrel_docdb/src/barrel_parallel.erl:194 — apps/barrel_docdb/src/barrel_parallel.erl:194-225 | apps/barrel_docdb/src/barrel_parallel.erl:228-265 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) apps/barrel_docdb/src/barrel_changes.erl:118 — apps/barrel_docdb/src/barrel_changes.erl:118-149 | apps/barrel_docdb/src/barrel_changes.erl:152-192 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) apps/barrel_docdb/src/barrel_query.erl:2326 — apps/barrel_docdb/src/barrel_query.erl:2326-2357 | apps/barrel_docdb/src/barrel_query.erl:2383-2414 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×3
  • Edited copy of a member (23 corresponding lines) apps/barrel_spaces/src/barrel_session.erl:182 — apps/barrel_spaces/src/barrel_session.erl:182-207 | apps/barrel_spaces/src/barrel_session.erl:218-240 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) apps/barrel_embed/src/barrel_embed_cohere.erl:137 — apps/barrel_embed/src/barrel_embed_cohere.erl:137-163 | apps/barrel_embed/src/barrel_embed_ollama.erl:153-175 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) apps/barrel_docdb/src/barrel_bql_exec.erl:176 — apps/barrel_docdb/src/barrel_bql_exec.erl:176-198 | apps/barrel_docdb/src/barrel_bql_exec.erl:209-231 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×3
  • Edited copy of a member (16 corresponding lines) apps/barrel/src/barrel_record_backfill.erl:111 — apps/barrel/src/barrel_record_backfill.erl:111-126 | apps/barrel/src/barrel_record_indexer.erl:231-247 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) apps/barrel_docdb/src/barrel_timeline.erl:58 — apps/barrel_docdb/src/barrel_timeline.erl:58-80 | apps/barrel_docdb/src/barrel_timeline.erl:191-206 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) apps/barrel_server/src/barrel_server_spaces.erl:112 — apps/barrel_server/src/barrel_server_spaces.erl:112-128 | apps/barrel_server/src/barrel_server_spaces.erl:198-213 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×3
  • Edited copy of a member (18 corresponding lines) apps/barrel_docdb/src/barrel_ars_index.erl:482 — apps/barrel_docdb/src/barrel_ars_index.erl:482-499 | apps/barrel_docdb/src/barrel_ars_index.erl:626-644 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) apps/barrel_embed/src/barrel_embed.erl:271 — apps/barrel_embed/src/barrel_embed.erl:271-289 | apps/barrel_embed/src/barrel_embed.erl:292-309 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) apps/barrel_docdb/src/barrel_rep.erl:777 — apps/barrel_docdb/src/barrel_rep.erl:777-794 | apps/barrel_docdb/src/barrel_rep_att.erl:478-500 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×3
  • Edited copy of a member (3 corresponding lines) apps/barrel/src/barrel_ctx_remote.erl:428 — apps/barrel/src/barrel_ctx_remote.erl:428-430 | apps/barrel_embed/src/barrel_embed_provider.erl:129-132 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) apps/barrel_docdb/src/barrel_bql_lower.erl:773 — apps/barrel_docdb/src/barrel_bql_lower.erl:773-775 | apps/barrel_docdb/src/barrel_query.erl:724-726 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (3 corresponding lines) apps/barrel_docdb/src/barrel_db_server.erl:1122 — apps/barrel_docdb/src/barrel_db_server.erl:1122-1124 | apps/barrel_vectordb/src/barrel_vectordb_crypto.erl:73-75 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 4+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 4+ corresponding lines) apps/barrel_embed/src/barrel_embed_clip.erl:155 — apps/barrel_embed/src/barrel_embed_clip.erl:155-158 | apps/barrel_embed/src/barrel_embed_fastembed.erl:123-126 | apps/barrel_embed/src/barrel_embed_local.erl:133-136 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 4+ corresponding lines) apps/barrel_docdb/src/barrel_db_watch.erl:66 — apps/barrel_docdb/src/barrel_db_watch.erl:66-69 | apps/barrel_docdb/src/barrel_query_sub.erl:124-127 | apps/barrel_docdb/src/barrel_sub.erl:109-112 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 4+ corresponding lines) apps/barrel_docdb/src/barrel_parallel.erl:277 — apps/barrel_docdb/src/barrel_parallel.erl:277-280 | apps/barrel_docdb/src/barrel_query.erl:3296-3299 | apps/barrel_embed/src/barrel_embed.erl:336-339 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×3
  • Duplicated block (13 lines × 2) apps/barrel_docdb/src/barrel_docdb_codec_cbor.erl:478 — apps/barrel_docdb/src/barrel_docdb_codec_cbor.erl:478-490 | apps/barrel_docdb/src/barrel_docdb_codec_cbor.erl:558-570 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_docdb/src/barrel_docdb_codec_cbor.erl:478` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) apps/barrel_docdb/src/barrel_query.erl:2345 — apps/barrel_docdb/src/barrel_query.erl:2345-2357 | apps/barrel_docdb/src/barrel_query.erl:2402-2414 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) apps/barrel_docdb/src/barrel_rocksdb_ro.erl:40 — apps/barrel_docdb/src/barrel_rocksdb_ro.erl:40-52 | apps/barrel_vectordb/src/barrel_vectordb_ro.erl:33-45 — before extracting anything, compare `apps/barrel_docdb/src/barrel_rocksdb_ro.erl` and `apps/barrel_vectordb/src/barrel_vectordb_ro.erl` as WHOLE FILES: 88% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×3
  • Duplicated block (12 lines × 2) apps/barrel_docdb/src/barrel_query.erl:2180 — apps/barrel_docdb/src/barrel_query.erl:2180-2193 | apps/barrel_docdb/src/barrel_query.erl:2264-2275 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) apps/barrel_embed/src/barrel_embed_cohere.erl:190 — apps/barrel_embed/src/barrel_embed_cohere.erl:190-201 | apps/barrel_embed/src/barrel_embed_ollama.erl:227-238 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (12 lines × 2) apps/barrel_server/src/barrel_server_mcp_agent.erl:235 — apps/barrel_server/src/barrel_server_mcp_agent.erl:235-246 | apps/barrel_server/src/barrel_server_spaces.erl:436-447 — before extracting anything, compare `apps/barrel_server/src/barrel_server_mcp_agent.erl` and `apps/barrel_server/src/barrel_server_spaces.erl` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D5 · Coupling · Off the main sequence · ×3
  • Off the main sequence: barrel_embed (OTP) — barrel_embed (OTP): abstractness 0.04, instability 0.00, distance 0.96 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
  • Off the main sequence: barrel_crypto — barrel_crypto: abstractness 0.25, instability 0.00, distance 0.75 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
  • Off the main sequence: barrel_docdb — barrel_docdb: abstractness 0.05, instability 0.25, distance 0.70 — an application entry point, so it is concrete by design — the distance is expected; what is worth checking is that other projects depend on it at all, since a host should be a leaf of the graph.
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×2
  • Edited copy of a member (25 corresponding lines) apps/barrel_docdb/src/barrel_ars_index.erl:1012 — apps/barrel_docdb/src/barrel_ars_index.erl:1012-1036 | apps/barrel_docdb/src/barrel_store_keys.erl:1067-1091 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) apps/barrel_docdb/src/barrel_db_server.erl:1094 — apps/barrel_docdb/src/barrel_db_server.erl:1094-1118 | apps/barrel_vectordb/src/barrel_vectordb_crypto.erl:43-70 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (35 corresponding lines) · ×2
  • Edited copy of a member (35 corresponding lines) apps/barrel_docdb/src/barrel_query.erl:2179 — apps/barrel_docdb/src/barrel_query.erl:2179-2215 | apps/barrel_docdb/src/barrel_query.erl:2263-2297 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) apps/barrel_docdb/src/barrel_query.erl:2418 — apps/barrel_docdb/src/barrel_query.erl:2418-2461 | apps/barrel_docdb/src/barrel_query.erl:2489-2523 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×2
  • Edited copy of a member (26 corresponding lines) apps/barrel_docdb/src/barrel_query.erl:1570 — apps/barrel_docdb/src/barrel_query.erl:1570-1596 | apps/barrel_docdb/src/barrel_query.erl:3666-3691 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) apps/barrel_docdb/src/barrel_query.erl:3130 — apps/barrel_docdb/src/barrel_query.erl:3130-3155 | apps/barrel_docdb/src/barrel_query.erl:3160-3190 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×2
  • Edited copy of a member (20 corresponding lines) apps/barrel_docdb/src/barrel_ars_index.erl:647 — apps/barrel_docdb/src/barrel_ars_index.erl:647-666 | apps/barrel_docdb/src/barrel_query.erl:833-852 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) apps/barrel_att_s3/src/barrel_att_s3_store.erl:827 — apps/barrel_att_s3/src/barrel_att_s3_store.erl:827-846 | apps/barrel_att_s3/src/barrel_att_s3_store.erl:966-987 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×2
  • Edited copy of a member (21 corresponding lines) apps/barrel_server/src/barrel_server_sync.erl:103 — apps/barrel_server/src/barrel_server_sync.erl:103-123 | apps/barrel_server/src/barrel_server_sync.erl:287-313 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) apps/barrel/src/barrel_sup.erl:24 — apps/barrel/src/barrel_sup.erl:24-50 | apps/barrel_vectordb/src/barrel_vectordb_sup.erl:35-55 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×2
  • Edited copy of a member (19 corresponding lines) apps/barrel_ngram/src/barrel_ngram_query.erl:115 — apps/barrel_ngram/src/barrel_ngram_query.erl:115-133 | apps/barrel_ngram/src/barrel_ngram_query.erl:583-601 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) apps/barrel_ngram/src/barrel_ngram_corpus_config.erl:55 — apps/barrel_ngram/src/barrel_ngram_corpus_config.erl:55-73 | apps/barrel_ngram/src/barrel_ngram_manifest.erl:57-75 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 12+ corresponding lines) apps/barrel/src/barrel_ctx_shape.erl:143 — apps/barrel/src/barrel_ctx_shape.erl:143-154 | apps/barrel_docdb/src/barrel_bql_exec.erl:321-335 | apps/barrel_docdb/src/barrel_doc.erl:455-468 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) apps/barrel_docdb/src/barrel_query.erl:2464 — apps/barrel_docdb/src/barrel_query.erl:2464-2485 | apps/barrel_docdb/src/barrel_query.erl:2528-2545 | apps/barrel_docdb/src/barrel_query.erl:2820-2831 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 8+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 8+ corresponding lines) apps/barrel_server/src/barrel_server_http.erl:412 — apps/barrel_server/src/barrel_server_http.erl:412-422 | apps/barrel_server/src/barrel_server_http.erl:424-432 | apps/barrel_server/src/barrel_server_http.erl:434-441 | apps/barrel_server/src/barrel_server_http.erl:561-569 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 8+ corresponding lines) apps/barrel_docdb/src/barrel_ars_index.erl:207 — apps/barrel_docdb/src/barrel_ars_index.erl:207-217 | apps/barrel_docdb/src/barrel_ars_index.erl:769-776 | apps/barrel_docdb/src/barrel_db_server.erl:3730-3738 | apps/barrel_docdb/src/barrel_db_server.erl:3741-3750 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 3+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 3+ corresponding lines) apps/barrel/src/barrel_ctx_manifest.erl:157 — apps/barrel/src/barrel_ctx_manifest.erl:157-161 | bench/ctx_ranking/ctx_ranking.erl:192-194 | bench/ctx_remote/barrel_ctx_bench.erl:84-88 | bench/rocksdb_readonly/rocksdb_ro_bench.erl:392-394 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 3+ corresponding lines) apps/barrel_server/src/barrel_server_mcp_agent.erl:44 — apps/barrel_server/src/barrel_server_mcp_agent.erl:44-47 | apps/barrel_server/src/barrel_server_mcp_contexts.erl:31-33 | apps/barrel_server/src/barrel_server_mcp_resources.erl:34-39 | apps/barrel_server/src/barrel_server_mcp_tools.erl:55-58 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 6+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 6+ corresponding lines) apps/barrel_docdb/src/barrel_store_rocksdb.erl:1180 — apps/barrel_docdb/src/barrel_store_rocksdb.erl:1180-1186 | apps/barrel_docdb/src/barrel_store_rocksdb.erl:1191-1196 | apps/barrel_docdb/src/barrel_store_rocksdb.erl:1201-1207 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 6+ corresponding lines) apps/barrel/src/barrel_ctx_remote.erl:420 — apps/barrel/src/barrel_ctx_remote.erl:420-426 | apps/barrel_docdb/src/barrel_docdb_reader.erl:125-130 | apps/barrel_docdb/src/barrel_rep_transport_http.erl:141-146 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (2 corresponding lines) · ×2
  • Edited copy of a member (2 corresponding lines) apps/barrel_embed/src/barrel_embed_bedrock.erl:348 — apps/barrel_embed/src/barrel_embed_bedrock.erl:348-350 | apps/barrel_vectordb/bench/barrel_vectordb_bench.erl:491-492 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (2 corresponding lines) apps/barrel_server/src/barrel_server_http.erl:1300 — apps/barrel_server/src/barrel_server_http.erl:1300-1301 | apps/barrel_server/src/barrel_server_mcp_tools.erl:400-401 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×2
  • Duplicated block (17 lines × 2) apps/barrel_att_s3/src/barrel_att_s3_store.erl:695 — apps/barrel_att_s3/src/barrel_att_s3_store.erl:695-711 | apps/barrel_att_s3/src/barrel_att_s3_store.erl:1600-1616 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) apps/barrel_docdb/src/barrel_query.erl:3526 — apps/barrel_docdb/src/barrel_query.erl:3526-3542 | apps/barrel_docdb/src/barrel_query_sub.erl:512-528 — before extracting anything, compare `apps/barrel_docdb/src/barrel_query.erl` and `apps/barrel_docdb/src/barrel_query_sub.erl` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 143 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×2
  • Duplicated block (14 lines × 2) apps/barrel_docdb/src/barrel_parallel.erl:212 — apps/barrel_docdb/src/barrel_parallel.erl:212-225 | apps/barrel_docdb/src/barrel_parallel.erl:252-265 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_docdb/src/barrel_parallel.erl:212` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) apps/barrel_embed/src/barrel_embed_jina.erl:132 — apps/barrel_embed/src/barrel_embed_jina.erl:132-145 | apps/barrel_embed/src/barrel_embed_voyage.erl:131-144 — before extracting anything, compare `apps/barrel_embed/src/barrel_embed_jina.erl` and `apps/barrel_embed/src/barrel_embed_voyage.erl` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 133 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_embed/src/barrel_embed_jina.erl:132` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×2
  • Duplicated block (12–13 lines × 2) apps/barrel_docdb/src/barrel_ars_index.erl:583 — apps/barrel_docdb/src/barrel_ars_index.erl:583-595 | apps/barrel_docdb/src/barrel_ars_index.erl:608-619 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12–13 lines × 2) apps/barrel_server/src/barrel_server_mcp_agent.erl:313 — apps/barrel_server/src/barrel_server_mcp_agent.erl:313-325 | apps/barrel_server/src/barrel_server_spaces.erl:495-506 — before extracting anything, compare `apps/barrel_server/src/barrel_server_mcp_agent.erl` and `apps/barrel_server/src/barrel_server_spaces.erl` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_server/src/barrel_server_mcp_agent.erl:313` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×2
  • Duplicated block (8 lines × 5) apps/barrel_embed/src/barrel_embed_azure.erl:157 — apps/barrel_embed/src/barrel_embed_azure.erl:157-164 | apps/barrel_embed/src/barrel_embed_jina.erl:145-152 | apps/barrel_embed/src/barrel_embed_mistral.erl:138-145 | apps/barrel_embed/src/barrel_embed_vertex.erl:136-143 | apps/barrel_embed/src/barrel_embed_voyage.erl:144-151 — before extracting anything, compare `apps/barrel_embed/src/barrel_embed_azure.erl` and `apps/barrel_embed/src/barrel_embed_jina.erl` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_embed/src/barrel_embed_azure.erl:157` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 5) apps/barrel_embed/src/barrel_embed_clip.erl:217 — apps/barrel_embed/src/barrel_embed_clip.erl:217-224 | apps/barrel_embed/src/barrel_embed_colbert.erl:258-265 | apps/barrel_embed/src/barrel_embed_fastembed.erl:169-176 | apps/barrel_embed/src/barrel_embed_local.erl:150-157 | apps/barrel_embed/src/barrel_embed_splade.erl:247-254 — before extracting anything, compare `apps/barrel_embed/src/barrel_embed_clip.erl` and `apps/barrel_embed/src/barrel_embed_colbert.erl` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (6–7 lines × 2) · ×2
  • Duplicated block (6–7 lines × 2) apps/barrel_docdb/src/barrel_docdb_reader.erl:74 — apps/barrel_docdb/src/barrel_docdb_reader.erl:74-79 | apps/barrel_docdb/src/barrel_docdb_reader.erl:272-278 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6–7 lines × 2) apps/barrel_embed/src/barrel_embed_port_server.erl:211 — apps/barrel_embed/src/barrel_embed_port_server.erl:211-217 | apps/barrel_rerank/src/barrel_rerank.erl:296-301 — before extracting anything, compare `apps/barrel_embed/src/barrel_embed_port_server.erl` and `apps/barrel_rerank/src/barrel_rerank.erl` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×2
  • Duplicated block (5 lines × 4) apps/barrel_embed/src/barrel_embed_port_server.erl:251 — apps/barrel_embed/src/barrel_embed_port_server.erl:251-255 | apps/barrel_embed/src/barrel_embed_venv.erl:185-189 | apps/barrel_rerank/src/barrel_rerank.erl:341-345 | apps/barrel_rerank/src/barrel_rerank_venv.erl:196-200 — before extracting anything, compare `apps/barrel_embed/src/barrel_embed_port_server.erl` and `apps/barrel_rerank/src/barrel_rerank.erl` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 4) apps/barrel_embed/src/barrel_embed_cohere.erl:107 — apps/barrel_embed/src/barrel_embed_cohere.erl:107-111 | apps/barrel_embed/src/barrel_embed_jina.erl:101-106 | apps/barrel_embed/src/barrel_embed_mistral.erl:93-98 | apps/barrel_embed/src/barrel_embed_voyage.erl:100-105 — before extracting anything, compare `apps/barrel_embed/src/barrel_embed_cohere.erl` and `apps/barrel_embed/src/barrel_embed_jina.erl` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_embed/src/barrel_embed_jina.erl:101` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
R10 · Code Duplication · Duplicated block (11 lines × 2 locations) · ×2
  • Duplicated block (11 lines × 2 locations) REDACTED:382 — REDACTED:382 · REDACTED:394 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (11 lines × 2 locations) clients/barrel-lite/src/wire/transport.ts:501 — clients/barrel-lite/src/wire/transport.ts:501 · clients/barrel-lite/src/wire/transport.ts:528 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
AXR1 · Runtime accessibility (rendered) · WCAG 2.4.2 reproducibly failed in a rendered surface · ×1
  • WCAG 2.4.2 reproducibly failed in a rendered surface — axe-core rule(s) document-title failed on: html. Runtime evidence (advisory — not scored); fix and re-scan to verify it clears.
AXR1 · Runtime accessibility (rendered) · WCAG 3.1.1 reproducibly failed in a rendered surface · ×1
  • WCAG 3.1.1 reproducibly failed in a rendered surface — axe-core rule(s) html-has-lang failed on: html. Runtime evidence (advisory — not scored); fix and re-scan to verify it clears.
D1 · Cyclomatic Complexity · barrel_db_server.handle_call_rw (cyclomatic 49) · ×1
  • barrel_db_server.handle_call_rw (cyclomatic 49) apps/barrel_docdb/src/barrel_db_server.erl:693 — barrel_db_server.handle_call_rw has cyclomatic complexity 49 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · barrel_query.match_condition (cyclomatic 42) · ×1
  • barrel_query.match_condition (cyclomatic 42) apps/barrel_docdb/src/barrel_query.erl:3401 — barrel_query.match_condition has cyclomatic complexity 42 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · barrel_query_sub.match_condition (cyclomatic 41) · ×1
  • barrel_query_sub.match_condition (cyclomatic 41) apps/barrel_docdb/src/barrel_query_sub.erl:398 — barrel_query_sub.match_condition has cyclomatic complexity 41 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · barrel_dbs.do_call (cyclomatic 39) · ×1
  • barrel_dbs.do_call (cyclomatic 39) apps/barrel/src/barrel_dbs.erl:290 — barrel_dbs.do_call has cyclomatic complexity 39 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · lexer.tokenize (cyclomatic 37) · ×1
  • lexer.tokenize (cyclomatic 37) clients/barrel-lite/src/bql/lexer.ts:36 — lexer.tokenize has cyclomatic complexity 37 (threshold 15). Of this number, 35 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · barrel_db_server.do_write_state (cyclomatic 31) · ×1
  • barrel_db_server.do_write_state (cyclomatic 31) apps/barrel_docdb/src/barrel_db_server.erl:3509 — barrel_db_server.do_write_state has cyclomatic complexity 31 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · barrel_att_s3_store.finish_stream (cyclomatic 22) · ×1
  • barrel_att_s3_store.finish_stream (cyclomatic 22) apps/barrel_att_s3/src/barrel_att_s3_store.erl:1575 — barrel_att_s3_store.finish_stream has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · barrel_bql_exec.eval_cond (cyclomatic 21) · ×1
  • barrel_bql_exec.eval_cond (cyclomatic 21) apps/barrel_docdb/src/barrel_bql_exec.erl:245 — barrel_bql_exec.eval_cond has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · barrel_dbs.handle_info (cyclomatic 19) · ×1
  • barrel_dbs.handle_info (cyclomatic 19) apps/barrel/src/barrel_dbs.erl:232 — barrel_dbs.handle_info has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · barrel_query.execute_multi_index (cyclomatic 19) · ×1
  • barrel_query.execute_multi_index (cyclomatic 19) apps/barrel_docdb/src/barrel_query.erl:2729 — barrel_query.execute_multi_index has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · barrel_db_server.build_prepared_ops (cyclomatic 18) · ×1
  • barrel_db_server.build_prepared_ops (cyclomatic 18) apps/barrel_docdb/src/barrel_db_server.erl:2764 — barrel_db_server.build_prepared_ops has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · changes-stream.openChangesStream (cyclomatic 18) · ×1
  • changes-stream.openChangesStream (cyclomatic 18) clients/barrel-lite/src/sync/changes-stream.ts:40 — changes-stream.openChangesStream has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 54). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · barrel_ngram_regex.simplify (cyclomatic 17) · ×1
  • barrel_ngram_regex.simplify (cyclomatic 17) apps/barrel_ngram/src/barrel_ngram_regex.erl:578 — barrel_ngram_regex.simplify has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: barrel_ngram_regex.escape_atom (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · barrel_ngram_shard.handle_call (cyclomatic 17) · ×1
  • barrel_ngram_shard.handle_call (cyclomatic 17) apps/barrel_ngram/src/barrel_ngram_shard.erl:228 — barrel_ngram_shard.handle_call has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · lower.canonExpr (cyclomatic 17) · ×1
  • lower.canonExpr (cyclomatic 17) REDACTED:170 — lower.canonExpr has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · lower.lowerCond (cyclomatic 17) · ×1
  • lower.lowerCond (cyclomatic 17) REDACTED:455 — lower.lowerCond has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · barrel_changes.get_changes_filtered_chunked (cyclomatic 16) · ×1
  • barrel_changes.get_changes_filtered_chunked (cyclomatic 16) apps/barrel_docdb/src/barrel_changes.erl:588 — barrel_changes.get_changes_filtered_chunked has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · barrel_db_server.build_write_ops (cyclomatic 16) · ×1
  • barrel_db_server.build_write_ops (cyclomatic 16) apps/barrel_docdb/src/barrel_db_server.erl:2572 — barrel_db_server.build_write_ops has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: barrel_db_server.write_request (cyclomatic 17) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · lower.checkIdUse (cyclomatic 16) · ×1
  • lower.checkIdUse (cyclomatic 16) REDACTED:413 — lower.checkIdUse has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D10 · Test Quality · No assertions · ×1
  • No assertions: a live pull propagates a server doc to the leader tab clients/barrel-lite/test/browser/smoke.spec.ts:151 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
D12 · Dependency Hygiene · Unbounded dependency requirement · ×1
  • Unbounded dependency requirement: barrel_docdb — Runtime dependency `barrel_docdb` is declared `">= 2.4.0"` in apps/barrel_att_s3/rebar.config, which has no upper bound — every future MAJOR release of `barrel_docdb` satisfies it, so the next unlocked resolve can pull a breaking change. Use `~>` (e.g. `"~> 1.0"`) to bound the requirement to a compatible range.
D2 · Cognitive Complexity · lexer.tokenize (cognitive 75) · ×1
  • lexer.tokenize (cognitive 75) clients/barrel-lite/src/bql/lexer.ts:36 — lexer.tokenize has cognitive complexity 75 (threshold 15). Drivers by points: if/else 18 (41 pts), loops 8 (23 pts), boolean chains 11 (nesting depth added 38). Of this number, 71 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · barrel_db_server.do_write_state (cognitive 38) · ×1
  • barrel_db_server.do_write_state (cognitive 38) apps/barrel_docdb/src/barrel_db_server.erl:3509 — barrel_db_server.do_write_state has cognitive complexity 38 (threshold 15). Drivers by points: match/switch 22 (26 pts), boolean chains 5, if/else 2 (4 pts), loops 3 (nesting depth added 6). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · barrel_db_server.init (cognitive 37) · ×1
  • barrel_db_server.init (cognitive 37) apps/barrel_docdb/src/barrel_db_server.erl:521 — barrel_db_server.init has cognitive complexity 37 (threshold 15). Drivers by points: match/switch 15 (30 pts), if/else 1 (4 pts), loops 1 (3 pts) (nesting depth added 20). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · barrel_query.match_condition (cognitive 37) · ×1
  • barrel_query.match_condition (cognitive 37) apps/barrel_docdb/src/barrel_query.erl:3401 — barrel_query.match_condition has cognitive complexity 37 (threshold 15). Drivers by points: match/switch 25 (37 pts) (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · barrel_query.execute_multi_index (cognitive 32) · ×1
  • barrel_query.execute_multi_index (cognitive 32) apps/barrel_docdb/src/barrel_query.erl:2729 — barrel_query.execute_multi_index has cognitive complexity 32 (threshold 15). Drivers by points: match/switch 10 (21 pts), boolean chains 6, loops 1 (5 pts) (nesting depth added 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · barrel_query_sub.match_condition (cognitive 31) · ×1
  • barrel_query_sub.match_condition (cognitive 31) apps/barrel_docdb/src/barrel_query_sub.erl:398 — barrel_query_sub.match_condition has cognitive complexity 31 (threshold 15). Drivers by points: match/switch 22 (31 pts) (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · att-sync.pullAttachments (cognitive 30) · ×1
  • att-sync.pullAttachments (cognitive 30) clients/barrel-lite/src/attachments/att-sync.ts:30 — att-sync.pullAttachments has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 2 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · changes-stream.openChangesStream (cognitive 29) · ×1
  • changes-stream.openChangesStream (cognitive 29) clients/barrel-lite/src/sync/changes-stream.ts:40 — changes-stream.openChangesStream has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 2 (3 pts), error handling 2, boolean chains 1 (nesting depth added 12). Most of this is not in the body itself: 3 of the 29 points are its own statements and the rest belongs to one function literal inside it that branches (line 54). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · barrel_db_server.do_repair_bodies (cognitive 27) · ×1
  • barrel_db_server.do_repair_bodies (cognitive 27) apps/barrel_docdb/src/barrel_db_server.erl:3147 — barrel_db_server.do_repair_bodies has cognitive complexity 27 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 3 (8 pts), match/switch 4 (5 pts) (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · barrel_query_sub.do_unsubscribe (cognitive 27) · ×1
  • barrel_query_sub.do_unsubscribe (cognitive 27) apps/barrel_docdb/src/barrel_query_sub.erl:236 — barrel_query_sub.do_unsubscribe has cognitive complexity 27 (threshold 15). Drivers by points: match/switch 15 (27 pts) (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · barrel_server_spaces.handoff_opts (cognitive 27) · ×1
  • barrel_server_spaces.handoff_opts (cognitive 27) apps/barrel_server/src/barrel_server_spaces.erl:479 — barrel_server_spaces.handoff_opts has cognitive complexity 27 (threshold 15). Drivers by points: loops 4 (10 pts), match/switch 6 (9 pts), if/else 2 (8 pts) (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · puller.pull (cognitive 25) · ×1
  • puller.pull (cognitive 25) clients/barrel-lite/src/sync/puller.ts:32 — puller.pull has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (14 pts), ternaries 2 (7 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · barrel_att_s3_store.finish_stream (cognitive 24) · ×1
  • barrel_att_s3_store.finish_stream (cognitive 24) apps/barrel_att_s3/src/barrel_att_s3_store.erl:1575 — barrel_att_s3_store.finish_stream has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 11 (24 pts) (nesting depth added 13). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · barrel_db_server.handle_call_rw (cognitive 21) · ×1
  • barrel_db_server.handle_call_rw (cognitive 21) apps/barrel_docdb/src/barrel_db_server.erl:693 — barrel_db_server.handle_call_rw has cognitive complexity 21 (threshold 15). Drivers by points: error handling 10 (12 pts), match/switch 8 (9 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · barrel_dbs.do_call (cognitive 20) · ×1
  • barrel_dbs.do_call (cognitive 20) apps/barrel/src/barrel_dbs.erl:290 — barrel_dbs.do_call has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 8 (11 pts), if/else 2 (4 pts), error handling 2 (3 pts), loops 2 (nesting depth added 6). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · barrel_ngram_regex.simplify (cognitive 20) · ×1
  • barrel_ngram_regex.simplify (cognitive 20) apps/barrel_ngram/src/barrel_ngram_regex.erl:578 — barrel_ngram_regex.simplify has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 6 (8 pts), if/else 2 (6 pts), loops 4 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · barrel_server_mcp_agent.handoff_create (cognitive 20) · ×1
  • barrel_server_mcp_agent.handoff_create (cognitive 20) apps/barrel_server/src/barrel_server_mcp_agent.erl:300 — barrel_server_mcp_agent.handoff_create has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 7 (8 pts), if/else 2 (6 pts), loops 4 (6 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · barrel_changes.get_changes_filtered_chunked (cognitive 19) · ×1
  • barrel_changes.get_changes_filtered_chunked (cognitive 19) apps/barrel_docdb/src/barrel_changes.erl:588 — barrel_changes.get_changes_filtered_chunked has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 15 (19 pts) (nesting depth added 4). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · barrel_channel.write_ops_compiled (cognitive 19) · ×1
  • barrel_channel.write_ops_compiled (cognitive 19) apps/barrel_docdb/src/barrel_channel.erl:186 — barrel_channel.write_ops_compiled has cognitive complexity 19 (threshold 15). Drivers by points: loops 4 (12 pts), match/switch 5 (7 pts) (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · pusher.push (cognitive 19) · ×1
  • pusher.push (cognitive 19) clients/barrel-lite/src/sync/pusher.ts:21 — pusher.push has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (7 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · barrel_db_server.do_resolve_conflict (cognitive 18) · ×1
  • barrel_db_server.do_resolve_conflict (cognitive 18) apps/barrel_docdb/src/barrel_db_server.erl:3890 — barrel_db_server.do_resolve_conflict has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 6 (8 pts), loops 2 (6 pts), if/else 1 (4 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · att-sync.pushAttachments (cognitive 18) · ×1
  • att-sync.pushAttachments (cognitive 18) clients/barrel-lite/src/attachments/att-sync.ts:94 — att-sync.pushAttachments has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · barrel_embedding_policy.normalize (cognitive 17) · ×1
  • barrel_embedding_policy.normalize (cognitive 17) apps/barrel/src/barrel_embedding_policy.erl:114 — barrel_embedding_policy.normalize has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 13 (14 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 2). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · barrel_query.find_most_selective_condition (cognitive 17) · ×1
  • barrel_query.find_most_selective_condition (cognitive 17) apps/barrel_docdb/src/barrel_query.erl:968 — barrel_query.find_most_selective_condition has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 11 (17 pts) (nesting depth added 6). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · barrel_rep_tasks.run_task_loop (cognitive 17) · ×1
  • barrel_rep_tasks.run_task_loop (cognitive 17) apps/barrel_docdb/src/barrel_rep_tasks.erl:602 — barrel_rep_tasks.run_task_loop has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 6 (17 pts) (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · lower.checkPath (cognitive 17) · ×1
  • lower.checkPath (cognitive 17) REDACTED:338 — lower.checkPath has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · barrel_bql_query.run_table_fn1 (cognitive 16) · ×1
  • barrel_bql_query.run_table_fn1 (cognitive 16) apps/barrel/src/barrel_bql_query.erl:118 — barrel_bql_query.run_table_fn1 has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 2 (6 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · barrel_dbs.handle_info (cognitive 16) · ×1
  • barrel_dbs.handle_info (cognitive 16) apps/barrel/src/barrel_dbs.erl:232 — barrel_dbs.handle_info has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (9 pts), match/switch 4 (5 pts), if/else 1 (2 pts) (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · barrel_bql_exec.collect_frames_loop (cognitive 16) · ×1
  • barrel_bql_exec.collect_frames_loop (cognitive 16) apps/barrel_docdb/src/barrel_bql_exec.erl:176 — barrel_bql_exec.collect_frames_loop has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (6 pts), loops 2 (5 pts), if/else 1 (4 pts), boolean chains 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · barrel_bql_lower.lower (cognitive 16) · ×1
  • barrel_bql_lower.lower (cognitive 16) apps/barrel_docdb/src/barrel_bql_lower.erl:605 — barrel_bql_lower.lower has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 8 (13 pts), boolean chains 2, error handling 1 (nesting depth added 5). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · barrel_db_server.do_set_doc_embedding (cognitive 16) · ×1
  • barrel_db_server.do_set_doc_embedding (cognitive 16) apps/barrel_docdb/src/barrel_db_server.erl:2900 — barrel_db_server.do_set_doc_embedding has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (8 pts), match/switch 4 (5 pts), loops 1 (3 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · barrel_rep.finish_one_shot (cognitive 16) · ×1
  • barrel_rep.finish_one_shot (cognitive 16) apps/barrel_docdb/src/barrel_rep.erl:322 — barrel_rep.finish_one_shot has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 10 (16 pts) (nesting depth added 6). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · barrel_rep_att.reconcile_loop (cognitive 16) · ×1
  • barrel_rep_att.reconcile_loop (cognitive 16) apps/barrel_docdb/src/barrel_rep_att.erl:157 — barrel_rep_att.reconcile_loop has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 7 (13 pts), loops 1 (3 pts) (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · barrel_store_rocksdb.encode_entity (cognitive 16) · ×1
  • barrel_store_rocksdb.encode_entity (cognitive 16) apps/barrel_docdb/src/barrel_store_rocksdb.erl:1053 — barrel_store_rocksdb.encode_entity has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 8, if/else 3 (6 pts), loops 1 (2 pts) (nesting depth added 4). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · barrel_embed_ollama.parse_embedding_response (cognitive 16) · ×1
  • barrel_embed_ollama.parse_embedding_response (cognitive 16) apps/barrel_embed/src/barrel_embed_ollama.erl:193 — barrel_embed_ollama.parse_embedding_response has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 7 (15 pts), error handling 1 (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · barrel_server_spaces.list_handoffs (cognitive 16) · ×1
  • barrel_server_spaces.list_handoffs (cognitive 16) apps/barrel_server/src/barrel_server_spaces.erl:283 — barrel_server_spaces.list_handoffs has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (8 pts), match/switch 4 (5 pts), if/else 1 (3 pts) (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D3 · God Classes · TooManyMethods · ×1
  • TooManyMethods: Database clients/barrel-lite/src/db.ts:127 — TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D3 · God Classes · ClassTooLong · ×1
  • ClassTooLong: Database clients/barrel-lite/src/db.ts:127 — ClassTooLong — 451 significant lines (blank, comment-only and punctuation-only lines excluded), 42 methods. The bar is 400 significant lines; this is 51 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (6 members, 50+ identical tokens) apps/barrel_embed/src/barrel_embed_azure.erl:141 — apps/barrel_embed/src/barrel_embed_azure.erl:141-164 | apps/barrel_embed/src/barrel_embed_jina.erl:129-152 | apps/barrel_embed/src/barrel_embed_mistral.erl:121-145 | apps/barrel_embed/src/barrel_embed_openai.erl:131-154 | apps/barrel_embed/src/barrel_embed_vertex.erl:126-143 | apps/barrel_embed/src/barrel_embed_voyage.erl:128-151 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (4 members, 50+ identical tokens) apps/barrel_docdb/src/barrel_query.erl:447 — apps/barrel_docdb/src/barrel_query.erl:447-517 | apps/barrel_docdb/src/barrel_query.erl:520-574 | apps/barrel_docdb/src/barrel_query.erl:577-638 | apps/barrel_docdb/src/barrel_query.erl:777-830 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Edited copy of a member (132 corresponding lines) · ×1
  • Edited copy of a member (132 corresponding lines) apps/barrel_docdb/src/barrel_db_server.erl:2572 — apps/barrel_docdb/src/barrel_db_server.erl:2572-2709 | apps/barrel_docdb/src/barrel_db_server.erl:2764-2895 — These two members are one piece of code written twice and then edited apart: 132 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (104 corresponding lines) · ×1
  • Edited copy of a member (104 corresponding lines) apps/barrel_docdb/src/barrel_query.erl:3401 — apps/barrel_docdb/src/barrel_query.erl:3401-3515 | apps/barrel_docdb/src/barrel_query_sub.erl:398-501 — These two members are one piece of code written twice and then edited apart: 104 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (34 corresponding lines) · ×1
  • Edited copy of a member (34 corresponding lines) apps/barrel_server/src/barrel_server_mcp_agent.erl:300 — apps/barrel_server/src/barrel_server_mcp_agent.erl:300-337 | apps/barrel_server/src/barrel_server_spaces.erl:479-512 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (48 corresponding lines) · ×1
  • Edited copy of a member (48 corresponding lines) apps/barrel_docdb/src/barrel_query.erl:1776 — apps/barrel_docdb/src/barrel_query.erl:1776-1823 | apps/barrel_docdb/src/barrel_query.erl:1946-2015 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (41 corresponding lines) · ×1
  • Edited copy of a member (41 corresponding lines) apps/barrel_docdb/src/barrel_docdb_codec_cbor.erl:450 — apps/barrel_docdb/src/barrel_docdb_codec_cbor.erl:450-490 | apps/barrel_docdb/src/barrel_docdb_codec_cbor.erl:520-570 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (38 corresponding lines) · ×1
  • Edited copy of a member (38 corresponding lines) apps/barrel_docdb/src/barrel_rep_att.erl:157 — apps/barrel_docdb/src/barrel_rep_att.erl:157-194 | apps/barrel_docdb/src/barrel_rep_att.erl:267-306 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×1
  • Edited copy of a member (33 corresponding lines) apps/barrel_docdb/src/barrel_changes.erl:1413 — apps/barrel_docdb/src/barrel_changes.erl:1413-1445 | apps/barrel_docdb/src/barrel_changes.erl:1451-1484 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×1
  • Edited copy of a member (27 corresponding lines) apps/barrel_docdb/src/barrel_docdb_app.erl:77 — apps/barrel_docdb/src/barrel_docdb_app.erl:77-103 | apps/barrel_docdb/src/barrel_docdb_app.erl:114-144 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 23+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 23+ corresponding lines) apps/barrel_docdb/src/barrel_query.erl:2629 — apps/barrel_docdb/src/barrel_query.erl:2629-2651 | apps/barrel_docdb/src/barrel_query.erl:2703-2725 | apps/barrel_docdb/src/barrel_query.erl:3057-3079 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 21+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 21+ corresponding lines) apps/barrel_docdb/src/barrel_ars_index.erl:351 — apps/barrel_docdb/src/barrel_ars_index.erl:351-373 | apps/barrel_docdb/src/barrel_ars_index.erl:385-406 | apps/barrel_docdb/src/barrel_ars_index.erl:512-532 | apps/barrel_docdb/src/barrel_ars_index.erl:545-565 | apps/barrel_docdb/src/barrel_ars_index.erl:574-595 | apps/barrel_docdb/src/barrel_ars_index.erl:681-706 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×1
  • Edited copy of a member (29 corresponding lines) apps/barrel_ngram/src/barrel_ngram_sup.erl:33 — apps/barrel_ngram/src/barrel_ngram_sup.erl:33-67 | apps/barrel_server/src/barrel_server_sup.erl:25-53 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 17+ corresponding lines) apps/barrel_docdb/src/barrel_query.erl:739 — apps/barrel_docdb/src/barrel_query.erl:739-755 | apps/barrel_docdb/src/barrel_query.erl:758-774 | apps/barrel_docdb/src/barrel_query.erl:855-871 | apps/barrel_docdb/src/barrel_query.erl:2360-2378 | apps/barrel_docdb/src/barrel_query.erl:2548-2566 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×1
  • Edited copy of a member (22 corresponding lines) apps/barrel_embed/priv/barrel_embed/providers/clip.py:87 — apps/barrel_embed/priv/barrel_embed/providers/clip.py:87-108 | apps/barrel_embed/priv/barrel_embed/providers/clip.py:111-135 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 14+ corresponding lines) apps/barrel_docdb/src/barrel_ars_index.erl:188 — apps/barrel_docdb/src/barrel_ars_index.erl:188-201 | apps/barrel_docdb/src/barrel_ars_index.erl:940-956 | apps/barrel_docdb/src/barrel_ars_index.erl:968-984 | apps/barrel_docdb/src/barrel_ars_index.erl:987-1000 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 7+ corresponding lines) apps/barrel_docdb/src/barrel_sync_sig.erl:143 — apps/barrel_docdb/src/barrel_sync_sig.erl:143-149 | apps/barrel_docdb/src/barrel_sync_sig.erl:163-170 | apps/barrel_docdb/src/barrel_sync_sig.erl:183-191 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 10+ corresponding lines) apps/barrel_docdb/src/barrel_store_rocksdb.erl:388 — apps/barrel_docdb/src/barrel_store_rocksdb.erl:388-400 | apps/barrel_docdb/src/barrel_store_rocksdb.erl:404-416 | apps/barrel_docdb/src/barrel_store_rocksdb.erl:460-470 | apps/barrel_docdb/src/barrel_store_rocksdb.erl:477-488 | apps/barrel_docdb/src/barrel_store_rocksdb.erl:528-537 | apps/barrel_docdb/src/barrel_store_rocksdb.erl:715-726 | apps/barrel_docdb/src/barrel_store_rocksdb.erl:748-759 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 9+ corresponding lines) apps/barrel_docdb/src/barrel_store_rocksdb.erl:367 — apps/barrel_docdb/src/barrel_store_rocksdb.erl:367-378 | apps/barrel_docdb/src/barrel_store_rocksdb.erl:494-505 | apps/barrel_docdb/src/barrel_store_rocksdb.erl:686-694 | apps/barrel_docdb/src/barrel_store_rocksdb.erl:701-711 | apps/barrel_docdb/src/barrel_store_rocksdb.erl:733-743 | apps/barrel_docdb/src/barrel_store_rocksdb.erl:774-782 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 7+ corresponding lines) apps/barrel/src/barrel_bql_live_sup.erl:16 — apps/barrel/src/barrel_bql_live_sup.erl:16-28 | apps/barrel/src/barrel_record_sup.erl:36-48 | apps/barrel_docdb/src/barrel_db_sup.erl:59-77 | apps/barrel_embed/src/barrel_embed_pool_sup.erl:23-29 | apps/barrel_ngram/src/barrel_ngram_corpus_lifecycle_sup.erl:30-46 | apps/barrel_vectordb/src/barrel_vectordb_store_sup.erl:37-49 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 9+ corresponding lines) apps/barrel_docdb/src/barrel_doc_body_store.erl:32 — apps/barrel_docdb/src/barrel_doc_body_store.erl:32-40 | apps/barrel_docdb/src/barrel_doc_body_store.erl:57-65 | apps/barrel_docdb/src/barrel_doc_body_store.erl:78-86 | apps/barrel_docdb/src/barrel_doc_body_store.erl:95-103 | apps/barrel_docdb/src/barrel_doc_body_store.erl:109-118 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 3+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 3+ corresponding lines) apps/barrel_ngram/src/barrel_ngram_corpus_config.erl:112 — apps/barrel_ngram/src/barrel_ngram_corpus_config.erl:112-114 | apps/barrel_ngram/src/barrel_ngram_corpus_lifecycle.erl:515-517 | apps/barrel_ngram/src/barrel_ngram_shard.erl:719-721 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 11+ corresponding lines) apps/barrel_embed/src/barrel_embed_clip.erl:192 — apps/barrel_embed/src/barrel_embed_clip.erl:192-202 | apps/barrel_embed/src/barrel_embed_colbert.erl:207-217 | apps/barrel_embed/src/barrel_embed_fastembed.erl:140-152 | apps/barrel_embed/src/barrel_embed_splade.erl:203-213 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 2+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 2+ corresponding lines) apps/barrel_server/src/barrel_server_http.erl:1278 — apps/barrel_server/src/barrel_server_http.erl:1278-1279 | apps/barrel_server/src/barrel_server_mcp_live.erl:366-369 | apps/barrel_server/src/barrel_server_mcp_resources.erl:120-123 | apps/barrel_server/src/barrel_server_sync.erl:894-896 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 5+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 5+ corresponding lines) apps/barrel_embed/priv/barrel_embed/providers/clip.py:15 — apps/barrel_embed/priv/barrel_embed/providers/clip.py:15-19 | apps/barrel_embed/priv/barrel_embed/providers/colbert.py:12-17 | apps/barrel_embed/priv/barrel_embed/providers/splade.py:12-16 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (91–92 lines × 2) · ×1
  • Duplicated block (91–92 lines × 2) apps/barrel_docdb/src/barrel_query.erl:3421 — apps/barrel_docdb/src/barrel_query.erl:3421-3512 | apps/barrel_docdb/src/barrel_query_sub.erl:408-498 — before extracting anything, compare `apps/barrel_docdb/src/barrel_query.erl` and `apps/barrel_docdb/src/barrel_query_sub.erl` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 143 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (57–60 lines × 2) · ×1
  • Duplicated block (57–60 lines × 2) apps/barrel_docdb/src/barrel_db_server.erl:2574 — apps/barrel_docdb/src/barrel_db_server.erl:2574-2633 | apps/barrel_docdb/src/barrel_db_server.erl:2769-2825 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_docdb/src/barrel_db_server.erl:2769` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (27–30 lines × 2) · ×1
  • Duplicated block (27–30 lines × 2) apps/barrel_docdb/src/barrel_db_server.erl:2672 — apps/barrel_docdb/src/barrel_db_server.erl:2672-2701 | apps/barrel_docdb/src/barrel_db_server.erl:2863-2889 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_docdb/src/barrel_db_server.erl:2672` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (24 lines × 3) · ×1
  • Duplicated block (24 lines × 3) apps/barrel_embed/src/barrel_embed_jina.erl:91 — apps/barrel_embed/src/barrel_embed_jina.erl:91-114 | apps/barrel_embed/src/barrel_embed_mistral.erl:83-106 | apps/barrel_embed/src/barrel_embed_voyage.erl:90-113 — before extracting anything, compare `apps/barrel_embed/src/barrel_embed_jina.erl` and `apps/barrel_embed/src/barrel_embed_mistral.erl` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_embed/src/barrel_embed_jina.erl:91` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×1
  • Duplicated block (23 lines × 2) apps/barrel_embed/src/barrel_embed_port_server.erl:178 — apps/barrel_embed/src/barrel_embed_port_server.erl:178-200 | apps/barrel_rerank/src/barrel_rerank.erl:267-289 — before extracting anything, compare `apps/barrel_embed/src/barrel_embed_port_server.erl` and `apps/barrel_rerank/src/barrel_rerank.erl` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_rerank/src/barrel_rerank.erl:267` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×1
  • Duplicated block (22 lines × 2) apps/barrel_embed/src/barrel_embed_clip.erl:114 — apps/barrel_embed/src/barrel_embed_clip.erl:114-135 | apps/barrel_embed/src/barrel_embed_colbert.erl:118-139 — before extracting anything, compare `apps/barrel_embed/src/barrel_embed_clip.erl` and `apps/barrel_embed/src/barrel_embed_colbert.erl` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_embed/src/barrel_embed_clip.erl:114` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21 lines × 5) · ×1
  • Duplicated block (21 lines × 5) apps/barrel_embed/src/barrel_embed_azure.erl:213 — apps/barrel_embed/src/barrel_embed_azure.erl:213-233 | apps/barrel_embed/src/barrel_embed_jina.erl:181-201 | apps/barrel_embed/src/barrel_embed_mistral.erl:167-187 | apps/barrel_embed/src/barrel_embed_openai.erl:161-181 | apps/barrel_embed/src/barrel_embed_voyage.erl:179-199 — before extracting anything, compare `apps/barrel_embed/src/barrel_embed_azure.erl` and `apps/barrel_embed/src/barrel_embed_jina.erl` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) apps/barrel_docdb/src/barrel_query.erl:2195 — apps/barrel_docdb/src/barrel_query.erl:2195-2215 | apps/barrel_docdb/src/barrel_query.erl:2278-2297 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (19–21 lines × 2) · ×1
  • Duplicated block (19–21 lines × 2) apps/barrel_ngram/src/barrel_ngram_registry.erl:94 — apps/barrel_ngram/src/barrel_ngram_registry.erl:94-112 | apps/barrel_vectordb/src/barrel_vectordb_registry.erl:88-108 — before extracting anything, compare `apps/barrel_ngram/src/barrel_ngram_registry.erl` and `apps/barrel_vectordb/src/barrel_vectordb_registry.erl` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×1
  • Duplicated block (19–20 lines × 2) apps/barrel_docdb/src/barrel_query_sub.erl:253 — apps/barrel_docdb/src/barrel_query_sub.erl:253-271 | apps/barrel_docdb/src/barrel_sub.erl:240-259 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (16–19 lines × 2) · ×1
  • Duplicated block (16–19 lines × 2) apps/barrel_docdb/src/barrel_changes.erl:119 — apps/barrel_docdb/src/barrel_changes.erl:119-134 | apps/barrel_docdb/src/barrel_changes.erl:153-171 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (15–18 lines × 4) · ×1
  • Duplicated block (15–18 lines × 4) apps/barrel_docdb/src/barrel_query.erl:493 — apps/barrel_docdb/src/barrel_query.erl:493-510 | apps/barrel_docdb/src/barrel_query.erl:554-568 | apps/barrel_docdb/src/barrel_query.erl:618-632 | apps/barrel_docdb/src/barrel_query.erl:810-824 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (14–17 lines × 2) · ×1
  • Duplicated block (14–17 lines × 2) apps/barrel_docdb/src/barrel_rep_att.erl:158 — apps/barrel_docdb/src/barrel_rep_att.erl:158-171 | apps/barrel_docdb/src/barrel_rep_att.erl:268-284 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_docdb/src/barrel_rep_att.erl:158` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 4) · ×1
  • Duplicated block (15 lines × 4) apps/barrel_embed/src/barrel_embed_clip.erl:107 — apps/barrel_embed/src/barrel_embed_clip.erl:107-121 | apps/barrel_embed/src/barrel_embed_colbert.erl:111-125 | apps/barrel_embed/src/barrel_embed_fastembed.erl:83-97 | apps/barrel_embed/src/barrel_embed_local.erl:85-99 — before extracting anything, compare `apps/barrel_embed/src/barrel_embed_clip.erl` and `apps/barrel_embed/src/barrel_embed_colbert.erl` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_embed/src/barrel_embed_clip.erl:107` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–14 lines × 2) · ×1
  • Duplicated block (12–14 lines × 2) apps/barrel_ngram/src/barrel_ngram_registry.erl:118 — apps/barrel_ngram/src/barrel_ngram_registry.erl:118-129 | apps/barrel_vectordb/src/barrel_vectordb_registry.erl:114-127 — before extracting anything, compare `apps/barrel_ngram/src/barrel_ngram_registry.erl` and `apps/barrel_vectordb/src/barrel_vectordb_registry.erl` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_ngram/src/barrel_ngram_registry.erl:118` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 5) · ×1
  • Duplicated block (13 lines × 5) apps/barrel_docdb/src/barrel_ars_index.erl:359 — apps/barrel_docdb/src/barrel_ars_index.erl:359-371 | apps/barrel_docdb/src/barrel_ars_index.erl:485-497 | apps/barrel_docdb/src/barrel_ars_index.erl:518-530 | apps/barrel_docdb/src/barrel_ars_index.erl:580-592 | apps/barrel_docdb/src/barrel_ars_index.erl:692-704 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_docdb/src/barrel_ars_index.erl:359` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–13 lines × 3) · ×1
  • Duplicated block (12–13 lines × 3) apps/barrel_docdb/src/barrel_query.erl:533 — apps/barrel_docdb/src/barrel_query.erl:533-545 | apps/barrel_docdb/src/barrel_query.erl:598-609 | apps/barrel_docdb/src/barrel_query.erl:789-801 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×1
  • Duplicated block (11–12 lines × 2) apps/barrel_spaces/src/barrel_session.erl:188 — apps/barrel_spaces/src/barrel_session.erl:188-199 | apps/barrel_spaces/src/barrel_session.erl:224-234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (10–11 lines × 7) · ×1
  • Duplicated block (10–11 lines × 7) apps/barrel_docdb/src/barrel_ars_index.erl:356 — apps/barrel_docdb/src/barrel_ars_index.erl:356-366 | apps/barrel_docdb/src/barrel_ars_index.erl:389-399 | apps/barrel_docdb/src/barrel_ars_index.erl:483-492 | apps/barrel_docdb/src/barrel_ars_index.erl:516-525 | apps/barrel_docdb/src/barrel_ars_index.erl:549-558 | apps/barrel_docdb/src/barrel_ars_index.erl:578-587 | apps/barrel_docdb/src/barrel_ars_index.erl:690-699 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_docdb/src/barrel_ars_index.erl:356` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 5) · ×1
  • Duplicated block (11 lines × 5) apps/barrel_embed/src/barrel_embed_clip.erl:105 — apps/barrel_embed/src/barrel_embed_clip.erl:105-115 | apps/barrel_embed/src/barrel_embed_colbert.erl:109-119 | apps/barrel_embed/src/barrel_embed_fastembed.erl:81-91 | apps/barrel_embed/src/barrel_embed_local.erl:83-93 | apps/barrel_embed/src/barrel_embed_splade.erl:105-115 — before extracting anything, compare `apps/barrel_embed/src/barrel_embed_clip.erl` and `apps/barrel_embed/src/barrel_embed_colbert.erl` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_embed/src/barrel_embed_clip.erl:105` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–11 lines × 3) · ×1
  • Duplicated block (10–11 lines × 3) apps/barrel_docdb/src/barrel_query.erl:2641 — apps/barrel_docdb/src/barrel_query.erl:2641-2651 | apps/barrel_docdb/src/barrel_query.erl:2716-2725 | apps/barrel_docdb/src/barrel_query.erl:3069-3079 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (9–11 lines × 3) · ×1
  • Duplicated block (9–11 lines × 3) apps/barrel_server/src/barrel_server_auth.erl:314 — apps/barrel_server/src/barrel_server_auth.erl:314-322 | apps/barrel_server/src/barrel_server_http.erl:1226-1234 | apps/barrel_server/src/barrel_server_sync.erl:801-811 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_server/src/barrel_server_auth.erl:314` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×1
  • Duplicated block (10–11 lines × 2) apps/barrel_docdb/src/barrel_query.erl:1799 — apps/barrel_docdb/src/barrel_query.erl:1799-1808 | apps/barrel_docdb/src/barrel_query.erl:1988-1998 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×1
  • Duplicated block (18 lines × 2) apps/barrel_embed/src/barrel_embed_port_server.erl:144 — apps/barrel_embed/src/barrel_embed_port_server.erl:144-161 | apps/barrel_rerank/src/barrel_rerank.erl:231-248 — before extracting anything, compare `apps/barrel_embed/src/barrel_embed_port_server.erl` and `apps/barrel_rerank/src/barrel_rerank.erl` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_rerank/src/barrel_rerank.erl:231` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–10 lines × 3) · ×1
  • Duplicated block (8–10 lines × 3) apps/barrel_docdb/src/barrel_db_server.erl:1528 — apps/barrel_docdb/src/barrel_db_server.erl:1528-1536 | apps/barrel_docdb/src/barrel_db_server.erl:1627-1634 | apps/barrel_docdb/src/barrel_timeline.erl:605-614 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×1
  • Duplicated block (9 lines × 3) apps/barrel_embed/src/barrel_embed_jina.erl:139 — apps/barrel_embed/src/barrel_embed_jina.erl:139-147 | apps/barrel_embed/src/barrel_embed_mistral.erl:132-140 | apps/barrel_embed/src/barrel_embed_voyage.erl:138-146 — before extracting anything, compare `apps/barrel_embed/src/barrel_embed_jina.erl` and `apps/barrel_embed/src/barrel_embed_mistral.erl` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_embed/src/barrel_embed_jina.erl:139` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×1
  • Duplicated block (8 lines × 4) apps/barrel_embed/src/barrel_embed_jina.erl:129 — apps/barrel_embed/src/barrel_embed_jina.erl:129-136 | apps/barrel_embed/src/barrel_embed_mistral.erl:121-128 | apps/barrel_embed/src/barrel_embed_openai.erl:131-138 | apps/barrel_embed/src/barrel_embed_voyage.erl:128-135 — before extracting anything, compare `apps/barrel_embed/src/barrel_embed_jina.erl` and `apps/barrel_embed/src/barrel_embed_mistral.erl` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_embed/src/barrel_embed_jina.erl:129` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×1
  • Duplicated block (8 lines × 3) apps/barrel_docdb/src/barrel_query.erl:745 — apps/barrel_docdb/src/barrel_query.erl:745-752 | apps/barrel_docdb/src/barrel_query.erl:764-771 | apps/barrel_docdb/src/barrel_query.erl:861-868 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (5 lines × 9) · ×1
  • Duplicated block (5 lines × 9) apps/barrel_embed/src/barrel_embed_azure.erl:130 — apps/barrel_embed/src/barrel_embed_azure.erl:130-136 | apps/barrel_embed/src/barrel_embed_clip.erl:147-151 | apps/barrel_embed/src/barrel_embed_cohere.erl:126-132 | apps/barrel_embed/src/barrel_embed_fastembed.erl:115-119 | apps/barrel_embed/src/barrel_embed_jina.erl:118-124 | apps/barrel_embed/src/barrel_embed_mistral.erl:110-116 | apps/barrel_embed/src/barrel_embed_openai.erl:120-126 | apps/barrel_embed/src/barrel_embed_vertex.erl:115-121 | apps/barrel_embed/src/barrel_embed_voyage.erl:117-123 — before extracting anything, compare `apps/barrel_embed/src/barrel_embed_azure.erl` and `apps/barrel_embed/src/barrel_embed_jina.erl` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×1
  • Duplicated block (5 lines × 3) apps/barrel_ngram/src/barrel_ngram_regex.erl:445 — apps/barrel_ngram/src/barrel_ngram_regex.erl:445-449 | apps/barrel_ngram/src/barrel_ngram_selector_dense.erl:38-42 | apps/barrel_ngram/src/barrel_ngram_selector_sparse.erl:127-131 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (10 lines × 7) · ×1
  • Duplicated block (10 lines × 7) apps/barrel_embed/src/barrel_embed_azure.erl:171 — apps/barrel_embed/src/barrel_embed_azure.erl:171-182 | apps/barrel_embed/src/barrel_embed_bedrock.erl:178-189 | apps/barrel_embed/src/barrel_embed_cohere.erl:170-181 | apps/barrel_embed/src/barrel_embed_jina.erl:159-170 | apps/barrel_embed/src/barrel_embed_mistral.erl:152-163 | apps/barrel_embed/src/barrel_embed_vertex.erl:194-203 | apps/barrel_embed/src/barrel_embed_voyage.erl:158-169 — before extracting anything, compare `apps/barrel_embed/src/barrel_embed_azure.erl` and `apps/barrel_embed/src/barrel_embed_jina.erl` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×1
  • Duplicated block (9 lines × 5) apps/barrel_embed/src/barrel_embed_cohere.erl:98 — apps/barrel_embed/src/barrel_embed_cohere.erl:98-106 | apps/barrel_embed/src/barrel_embed_jina.erl:92-100 | apps/barrel_embed/src/barrel_embed_mistral.erl:84-92 | apps/barrel_embed/src/barrel_embed_openai.erl:98-106 | apps/barrel_embed/src/barrel_embed_voyage.erl:91-99 — before extracting anything, compare `apps/barrel_embed/src/barrel_embed_cohere.erl` and `apps/barrel_embed/src/barrel_embed_jina.erl` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `apps/barrel_embed/src/barrel_embed_jina.erl:92` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×1
  • Duplicated block (25 lines × 2) apps/barrel_embed/priv/barrel_embed/server.py:41 — apps/barrel_embed/priv/barrel_embed/server.py:41-65 | apps/barrel_rerank/priv/rerank_server.py:104-128 — before extracting anything, compare `apps/barrel_embed/priv/barrel_embed/server.py` and `apps/barrel_rerank/priv/rerank_server.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×1
  • Duplicated block (19 lines × 2) apps/barrel_embed/priv/barrel_embed/server.py:68 — apps/barrel_embed/priv/barrel_embed/server.py:68-86 | apps/barrel_rerank/priv/rerank_server.py:131-149 — before extracting anything, compare `apps/barrel_embed/priv/barrel_embed/server.py` and `apps/barrel_rerank/priv/rerank_server.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9–10 lines × 3) · ×1
  • Duplicated block (9–10 lines × 3) apps/barrel_embed/priv/barrel_embed/providers/clip.py:71 — apps/barrel_embed/priv/barrel_embed/providers/clip.py:71-79 | apps/barrel_embed/priv/barrel_embed/server.py:102-110 | apps/barrel_rerank/priv/rerank_server.py:180-189 — before extracting anything, compare `apps/barrel_embed/priv/barrel_embed/server.py` and `apps/barrel_rerank/priv/rerank_server.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 13+ corresponding lines) apps/barrel_docdb/bench/src/barrel_bench.erl:129 — apps/barrel_docdb/bench/src/barrel_bench.erl:129-141 | apps/barrel_docdb/bench/src/barrel_bench.erl:149-161 | apps/barrel_docdb/bench/src/barrel_bench.erl:169-181 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 9+ corresponding lines) apps/barrel_docdb/bench/src/workloads/barrel_bench_crud.erl:44 — apps/barrel_docdb/bench/src/workloads/barrel_bench_crud.erl:44-52 | apps/barrel_docdb/bench/src/workloads/barrel_bench_crud.erl:54-64 | apps/barrel_docdb/bench/src/workloads/barrel_bench_query.erl:383-391 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×1
  • Duplicated block (7 lines × 4) apps/barrel_docdb/bench/src/barrel_bench.erl:33 — apps/barrel_docdb/bench/src/barrel_bench.erl:33-39 | apps/barrel_docdb/bench/src/barrel_bench.erl:130-136 | apps/barrel_docdb/bench/src/barrel_bench.erl:150-156 | apps/barrel_docdb/bench/src/barrel_bench.erl:170-176 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D8 · Code Coverage · Coverage not measured · ×1
  • Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — clients/barrel-lite/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
ED1 · Handler temporal coupling · Handler temporal coupling · ×1
  • Handler temporal coupling: barrel_rep_tasks clause `handle_loop_error/3#834` apps/barrel_docdb/src/barrel_rep_tasks.erl:863 — `barrel_rep_tasks` clause `handle_loop_error/3#834` blocks the process on a synchronous `timer:sleep` while handling a message — the process is blocked (holding its mailbox) until a peer replies or the sleep elapses. That couples this handler in real time to another process being up and fast, and a mutual call can DEADLOCK. To decouple, move the delay off the hot path (a `state_timeout`/`send_after` self-message, or do the settle in a spawned worker).
P12 · CI test-gate honesty · Runner config excludes tests no gate runs · ×1
  • Runner config excludes tests no gate runs clients/barrel-lite/vitest.config.ts:8 — `test/integration/**` removes 16 test(s) in 5 file(s) (e.g. `clients/barrel-lite/test/integration/attachments.integration.test.ts`, `clients/barrel-lite/test/integration/conflicts.integration.test.ts`) from what vitest collects, and no other runner or CI command runs them — they are dead tests. Run them (another runner, project or job), or delete them.
R10 · Code Duplication · Duplicated block with local edits (23 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (23 matched lines × 2 locations) clients/barrel-lite/src/store/blobstore.ts:77 — clients/barrel-lite/src/store/blobstore.ts:77 · clients/barrel-lite/src/store/opfs.ts:68 — the two spans are one implementation copied and then locally edited — 150 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (13 lines × 2 locations) · ×1
  • Duplicated block (13 lines × 2 locations) clients/barrel-lite/src/wire/transport.ts:514 — clients/barrel-lite/src/wire/transport.ts:514 · clients/barrel-lite/src/wire/transport.ts:542 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (9 lines × 2 locations) · ×1
  • Duplicated block (9 lines × 2 locations) clients/barrel-lite/src/bql/parser.ts:89 — clients/barrel-lite/src/bql/parser.ts:89 · clients/barrel-lite/src/bql/parser.ts:345 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (8 lines × 2 locations) · ×1
  • Duplicated block (8 lines × 2 locations) clients/barrel-lite/src/bql/parser.ts:136 — clients/barrel-lite/src/bql/parser.ts:136 · clients/barrel-lite/src/bql/parser.ts:241 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block with local edits (8 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (8 matched lines × 2 locations) clients/barrel-lite/src/sync/pusher.ts:34 — clients/barrel-lite/src/sync/pusher.ts:34 · clients/barrel-lite/src/sync/pusher.ts:79 — the two spans are one implementation copied and then locally edited — 55 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (7 lines × 2 locations) · ×1
  • Duplicated block (7 lines × 2 locations) clients/barrel-lite/src/bql/parser.ts:240 — clients/barrel-lite/src/bql/parser.ts:240 · clients/barrel-lite/src/bql/parser.ts:343 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (7 lines × 3 locations) · ×1
  • Duplicated block (7 lines × 3 locations) clients/barrel-lite/src/wire/transport.ts:484 — clients/barrel-lite/src/wire/transport.ts:484 · clients/barrel-lite/src/wire/transport.ts:519 · clients/barrel-lite/src/wire/transport.ts:547 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
R10 · Code Duplication · Duplicated block (6 lines × 2 locations) · ×1
  • Duplicated block (6 lines × 2 locations) clients/barrel-lite/src/wire/transport.ts:182 — clients/barrel-lite/src/wire/transport.ts:182 · clients/barrel-lite/src/wire/transport.ts:383 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (5 lines × 2 locations) · ×1
  • Duplicated block (5 lines × 2 locations) clients/barrel-lite/src/db.ts:307 — clients/barrel-lite/src/db.ts:307 · clients/barrel-lite/src/db.ts:497 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R2 · Cyclomatic Complexity · Complex function tokenize (cyclomatic 35, cognitive 71) · ×1
  • Complex function tokenize (cyclomatic 35, cognitive 71) clients/barrel-lite/src/bql/lexer.ts:36 — tokenize has cyclomatic complexity 35 and cognitive complexity 71; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function dispatch (cyclomatic 26, cognitive 11) · ×1
  • Complex function dispatch (cyclomatic 26, cognitive 11) clients/barrel-lite/src/db.ts:669 — dispatch has cyclomatic complexity 26 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function evalCond (cyclomatic 21, cognitive 9) · ×1
  • Complex function evalCond (cyclomatic 21, cognitive 9) clients/barrel-lite/src/bql/eval.ts:71 — evalCond has cyclomatic complexity 21 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 18, cognitive 17) · ×1
  • Complex function (anonymous) (cyclomatic 18, cognitive 17) clients/barrel-lite/test/fake-server.ts:115 — (anonymous) has cyclomatic complexity 18 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function route (cyclomatic 17, cognitive 16) · ×1
  • Complex function route (cyclomatic 17, cognitive 16) clients/barrel-lite/test/fake-server.ts:250 — route has cyclomatic complexity 17 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function lowerCond (cyclomatic 17, cognitive 13) · ×1
  • Complex function lowerCond (cyclomatic 17, cognitive 13) REDACTED:455 — lowerCond has cyclomatic complexity 17 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function canonExpr (cyclomatic 17, cognitive 10) · ×1
  • Complex function canonExpr (cyclomatic 17, cognitive 10) REDACTED:170 — canonExpr has cyclomatic complexity 17 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function checkIdUse (cyclomatic 16, cognitive 14) · ×1
  • Complex function checkIdUse (cyclomatic 16, cognitive 14) REDACTED:413 — checkIdUse has cyclomatic complexity 16 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 15, cognitive 26) · ×1
  • Complex function (anonymous) (cyclomatic 15, cognitive 26) clients/barrel-lite/src/sync/changes-stream.ts:54 — (anonymous) has cyclomatic complexity 15 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function pushNot (cyclomatic 15, cognitive 9) · ×1
  • Complex function pushNot (cyclomatic 15, cognitive 9) REDACTED:238 — pushNot has cyclomatic complexity 15 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function pull (cyclomatic 14, cognitive 28) · ×1
  • Complex function pull (cyclomatic 14, cognitive 28) clients/barrel-lite/src/sync/puller.ts:32 — pull has cyclomatic complexity 14 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function checkPath (cyclomatic 14, cognitive 18) · ×1
  • Complex function checkPath (cyclomatic 14, cognitive 18) REDACTED:338 — checkPath has cyclomatic complexity 14 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function applyState (cyclomatic 14, cognitive 15) · ×1
  • Complex function applyState (cyclomatic 14, cognitive 15) clients/barrel-lite/src/sync/apply.ts:111 — applyState has cyclomatic complexity 14 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function pullAttachments (cyclomatic 13, cognitive 31) · ×1
  • Complex function pullAttachments (cyclomatic 13, cognitive 31) clients/barrel-lite/src/attachments/att-sync.ts:30 — pullAttachments has cyclomatic complexity 13 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function bulkGetEmbeddings (cyclomatic 13, cognitive 17) · ×1
  • Complex function bulkGetEmbeddings (cyclomatic 13, cognitive 17) clients/barrel-lite/src/wire/transport.ts:264 — bulkGetEmbeddings has cyclomatic complexity 13 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function searchLocal (cyclomatic 12, cognitive 16) · ×1
  • Complex function searchLocal (cyclomatic 12, cognitive 16) clients/barrel-lite/src/db.ts:479 — searchLocal has cyclomatic complexity 12 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function open (cyclomatic 12, cognitive 14) · ×1
  • Complex function open (cyclomatic 12, cognitive 14) clients/barrel-lite/src/db.ts:162 — open has cyclomatic complexity 12 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function parseFrame (cyclomatic 12, cognitive 14) · ×1
  • Complex function parseFrame (cyclomatic 12, cognitive 14) clients/barrel-lite/src/sync/sse.ts:37 — parseFrame has cyclomatic complexity 12 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function pushAttachments (cyclomatic 11, cognitive 18) · ×1
  • Complex function pushAttachments (cyclomatic 11, cognitive 18) clients/barrel-lite/src/attachments/att-sync.ts:94 — pushAttachments has cyclomatic complexity 11 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function vvCompare (cyclomatic 11, cognitive 13) · ×1
  • Complex function vvCompare (cyclomatic 11, cognitive 13) clients/barrel-lite/src/codec/vv.ts:60 — vvCompare has cyclomatic complexity 11 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files · clients/barrel-lite/src/db.ts · ×1
  • clients/barrel-lite/src/db.ts: 716 lines of code clients/barrel-lite/src/db.ts:1 — clients/barrel-lite/src/db.ts has 716 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · clients/barrel-lite/src/wire/transport.ts · ×1
  • clients/barrel-lite/src/wire/transport.ts: 644 lines of code clients/barrel-lite/src/wire/transport.ts:1 — clients/barrel-lite/src/wire/transport.ts has 644 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 502 lines of code REDACTED:1 — REDACTED has 502 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R6 · Tooling · No lint script · ×1
  • No lint script — test ✓ · lint ✗ · typecheck ✓ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.
X25 · Inert configuration knob · Constructor parameter is stored and never read · ×1
  • Constructor parameter is stored and never read apps/barrel_rerank/src/barrel_rerank.erl:137 — `barrel_rerank` takes `timeout in Config` from the caller and stores it in `#state.timeout` on line 182, defaulting to `?DEFAULT_TIMEOUT` when none is supplied — but `#state.timeout` is never read anywhere in the type, and line 137 spells `?DEFAULT_TIMEOUT` out again where that field's value belongs. Every caller that passes `timeout in Config` therefore gets `?DEFAULT_TIMEOUT` regardless, and nothing in the type reports that its argument was ignored. Read `#state.timeout` at line 137 — or, if the value genuinely is fixed, delete `timeout in Config` and `#state.timeout` together so the signature stops advertising a knob that does nothing.
Minor — 49 finding(s)
X31 · Test-only surface in a production module · Test-only surface in a production module · ×40
  • Test-only surface in a production module apps/barrel_docdb/src/barrel_att_feed.erl:51 — `barrel_att_feed:encode_feed/2` is exported unconditionally, and the comment directly above the `-export` on this line says the exports below it are for testing. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. This arm read the comment, not the call graph: if the comment is right and only tests call it, wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module. If production code calls it, the comment is stale and wrapping the export would break the build — delete the comment and document the function as part of the module's API.
  • Test-only surface in a production module apps/barrel_docdb/src/barrel_att_feed.erl:51 — `barrel_att_feed:decode_feed/2` is exported unconditionally, and the comment directly above the `-export` on this line says the exports below it are for testing. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. This arm read the comment, not the call graph: if the comment is right and only tests call it, wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module. If production code calls it, the comment is stale and wrapping the export would break the build — delete the comment and document the function as part of the module's API.
  • Test-only surface in a production module apps/barrel_docdb/src/barrel_att_feed.erl:51 — `barrel_att_feed:encode_index/1` is exported unconditionally, and the comment directly above the `-export` on this line says the exports below it are for testing. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. This arm read the comment, not the call graph: if the comment is right and only tests call it, wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module. If production code calls it, the comment is stale and wrapping the export would break the build — delete the comment and document the function as part of the module's API.
  • Test-only surface in a production module apps/barrel_docdb/src/barrel_att_feed.erl:51 — `barrel_att_feed:decode_index/1` is exported unconditionally, and the comment directly above the `-export` on this line says the exports below it are for testing. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. This arm read the comment, not the call graph: if the comment is right and only tests call it, wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module. If production code calls it, the comment is stale and wrapping the export would break the build — delete the comment and document the function as part of the module's API.
  • Test-only surface in a production module apps/barrel_docdb/src/barrel_channel.erl:37 — `barrel_channel:encode_row/2` is exported unconditionally, and the comment directly above the `-export` on this line says the exports below it are for testing. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. This arm read the comment, not the call graph: if the comment is right and only tests call it, wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module. If production code calls it, the comment is stale and wrapping the export would break the build — delete the comment and document the function as part of the module's API.
  • Test-only surface in a production module apps/barrel_docdb/src/barrel_channel.erl:37 — `barrel_channel:decode_row/1` is exported unconditionally, and the comment directly above the `-export` on this line says the exports below it are for testing. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. This arm read the comment, not the call graph: if the comment is right and only tests call it, wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module. If production code calls it, the comment is stale and wrapping the export would break the build — delete the comment and document the function as part of the module's API.
  • Test-only surface in a production module apps/barrel_docdb/src/barrel_db_server.erl:41 — `barrel_db_server:doc_write_ops/5` is exported unconditionally, and the comment directly above the `-export` on this line says the exports below it are for testing. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. This arm read the comment, not the call graph: if the comment is right and only tests call it, wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module. If production code calls it, the comment is stale and wrapping the export would break the build — delete the comment and document the function as part of the module's API.
  • Test-only surface in a production module apps/barrel_docdb/src/barrel_db_server.erl:50 — `barrel_db_server:sweep_retention/1` is exported unconditionally, and the comment directly above the `-export` on this line says the exports below it are for testing. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. This arm read the comment, not the call graph: if the comment is right and only tests call it, wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module. If production code calls it, the comment is stale and wrapping the export would break the build — delete the comment and document the function as part of the module's API.
  • Test-only surface in a production module apps/barrel_docdb/src/barrel_db_server.erl:50 — `barrel_db_server:sweep_retention/2` is exported unconditionally, and the comment directly above the `-export` on this line says the exports below it are for testing. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. This arm read the comment, not the call graph: if the comment is right and only tests call it, wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module. If production code calls it, the comment is stale and wrapping the export would break the build — delete the comment and document the function as part of the module's API.
  • Test-only surface in a production module apps/barrel_docdb/src/barrel_doc_chain.erl:25 — `barrel_doc_chain:owner/2` is exported unconditionally, and the comment directly above the `-export` on this line says the exports below it are for testing. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. This arm read the comment, not the call graph: if the comment is right and only tests call it, wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module. If production code calls it, the comment is stale and wrapping the export would break the build — delete the comment and document the function as part of the module's API.
  • Test-only surface in a production module apps/barrel_docdb/src/barrel_doc_chain.erl:25 — `barrel_doc_chain:owner/3` is exported unconditionally, and the comment directly above the `-export` on this line says the exports below it are for testing. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. This arm read the comment, not the call graph: if the comment is right and only tests call it, wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module. If production code calls it, the comment is stale and wrapping the export would break the build — delete the comment and document the function as part of the module's API.
  • Test-only surface in a production module apps/barrel_docdb/src/barrel_docdb_codec_cbor.erl:46 — `barrel_docdb_codec_cbor:encode_varint/1` is exported unconditionally, and the comment directly above the `-export` on this line says the exports below it are for testing. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. This arm read the comment, not the call graph: if the comment is right and only tests call it, wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module. If production code calls it, the comment is stale and wrapping the export would break the build — delete the comment and document the function as part of the module's API.
  • Test-only surface in a production module apps/barrel_docdb/src/barrel_docdb_codec_cbor.erl:46 — `barrel_docdb_codec_cbor:decode_varint/1` is exported unconditionally, and the comment directly above the `-export` on this line says the exports below it are for testing. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. This arm read the comment, not the call graph: if the comment is right and only tests call it, wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module. If production code calls it, the comment is stale and wrapping the export would break the build — delete the comment and document the function as part of the module's API.
  • Test-only surface in a production module apps/barrel_docdb/src/barrel_history.erl:34 — `barrel_history:encode_entry/5` is exported unconditionally, and the comment directly above the `-export` on this line says the exports below it are for testing. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. This arm read the comment, not the call graph: if the comment is right and only tests call it, wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module. If production code calls it, the comment is stale and wrapping the export would break the build — delete the comment and document the function as part of the module's API.
  • Test-only surface in a production module apps/barrel_docdb/src/barrel_history.erl:34 — `barrel_history:encode_entry/6` is exported unconditionally, and the comment directly above the `-export` on this line says the exports below it are for testing. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. This arm read the comment, not the call graph: if the comment is right and only tests call it, wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module. If production code calls it, the comment is stale and wrapping the export would break the build — delete the comment and document the function as part of the module's API.
  • Test-only surface in a production module apps/barrel_docdb/src/barrel_history.erl:34 — `barrel_history:decode_entry/1` is exported unconditionally, and the comment directly above the `-export` on this line says the exports below it are for testing. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. This arm read the comment, not the call graph: if the comment is right and only tests call it, wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module. If production code calls it, the comment is stale and wrapping the export would break the build — delete the comment and document the function as part of the module's API.
  • Test-only surface in a production module apps/barrel_docdb/src/barrel_hlc.erl:31 — `barrel_hlc:start_link/0` is exported unconditionally, and the comment directly above the `-export` on this line says the exports below it are for testing. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. This arm read the comment, not the call graph: if the comment is right and only tests call it, wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module. If production code calls it, the comment is stale and wrapping the export would break the build — delete the comment and document the function as part of the module's API.
  • Test-only surface in a production module apps/barrel_docdb/src/barrel_hlc.erl:31 — `barrel_hlc:start_link/1` is exported unconditionally, and the comment directly above the `-export` on this line says the exports below it are for testing. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. This arm read the comment, not the call graph: if the comment is right and only tests call it, wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module. If production code calls it, the comment is stale and wrapping the export would break the build — delete the comment and document the function as part of the module's API.
  • Test-only surface in a production module apps/barrel_docdb/src/barrel_hlc.erl:31 — `barrel_hlc:stop/1` is exported unconditionally, and the comment directly above the `-export` on this line says the exports below it are for testing. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. This arm read the comment, not the call graph: if the comment is right and only tests call it, wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module. If production code calls it, the comment is stale and wrapping the export would break the build — delete the comment and document the function as part of the module's API.
  • Test-only surface in a production module apps/barrel_docdb/src/barrel_hlc.erl:31 — `barrel_hlc:now/1` is exported unconditionally, and the comment directly above the `-export` on this line says the exports below it are for testing. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. This arm read the comment, not the call graph: if the comment is right and only tests call it, wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module. If production code calls it, the comment is stale and wrapping the export would break the build — delete the comment and document the function as part of the module's API.
  • Test-only surface in a production module apps/barrel_docdb/src/barrel_hlc.erl:31 — `barrel_hlc:update/2` is exported unconditionally, and the comment directly above the `-export` on this line says the exports below it are for testing. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. This arm read the comment, not the call graph: if the comment is right and only tests call it, wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module. If production code calls it, the comment is stale and wrapping the export would break the build — delete the comment and document the function as part of the module's API.
  • Test-only surface in a production module apps/barrel_docdb/src/barrel_hlc.erl:31 — `barrel_hlc:timestamp/1` is exported unconditionally, and the comment directly above the `-export` on this line says the exports below it are for testing. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. This arm read the comment, not the call graph: if the comment is right and only tests call it, wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module. If production code calls it, the comment is stale and wrapping the export would break the build — delete the comment and document the function as part of the module's API.
  • Test-only surface in a production module apps/barrel_docdb/src/barrel_outbox.erl:34 — `barrel_outbox:encode_entry/3` is exported unconditionally, and the comment directly above the `-export` on this line says the exports below it are for testing. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. This arm read the comment, not the call graph: if the comment is right and only tests call it, wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module. If production code calls it, the comment is stale and wrapping the export would break the build — delete the comment and document the function as part of the module's API.
  • Test-only surface in a production module apps/barrel_docdb/src/barrel_outbox.erl:34 — `barrel_outbox:decode_entry/1` is exported unconditionally, and the comment directly above the `-export` on this line says the exports below it are for testing. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. This arm read the comment, not the call graph: if the comment is right and only tests call it, wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module. If production code calls it, the comment is stale and wrapping the export would break the build — delete the comment and document the function as part of the module's API.
  • Test-only surface in a production module apps/barrel_docdb/src/barrel_path_dict.erl:26 — `barrel_path_dict:reset/0` is exported unconditionally, and the comment directly above the `-export` on this line says the exports below it are for testing. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. This arm read the comment, not the call graph: if the comment is right and only tests call it, wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module. If production code calls it, the comment is stale and wrapping the export would break the build — delete the comment and document the function as part of the module's API.
  • + 15 more in this group — see findings.md.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found rebar.config:112 — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `rebar.config` makes this repository a deployable product (line 112).
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation clients/barrel-lite/package.json:30 — `clients/barrel-lite/package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
X10 · Duplicated predicate · Duplicated predicate · ×1
  • Duplicated predicate clients/barrel-lite/src/bql/eval.ts:21 — `typeof v === "object" && v !== null && !Array.isArray(v)` appears character-identically in 2 files — clients/barrel-lite/src/bql/eval.ts, clients/barrel-lite/src/wire/transport.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
X5 · Nullable reference types · Null assertions (`!`) override strict null checking · ×1
  • Null assertions (`!`) override strict null checking — ~1.5 `!` null assertions per 1k TypeScript source lines — 9 assertion(s) across the 6124 source line(s) of the 43 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: clients/barrel-lite/src/codec/live.ts (6), clients/barrel-lite/src/store/localstore.ts (3). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
Minor — 1 finding(s)
D12 · Dependency Hygiene · Dependency hygiene PARTLY measured · ×1
  • Dependency hygiene PARTLY measured — Python dependencies read, no exact pin to grade for currency — This repository's Python dependencies were read: 4 shipped distribution(s) across 6 manifest(s) (4 development or optional declaration(s) excluded, because a consumer does not install them). Whether any of them is behind its current release is the dependency-CURRENCY question, and no declaration here carries an EXACT pin to ask it about — every one is a floor or a range, which installs the newest release it admits and therefore cannot be behind one. That is a healthy declaration style, NOT a defect and NOT a gap in this analyzer; there is simply no currency question to answer. This is NOT a finding that these dependencies are current or healthy. Lockfiles are deliberately not read (poetry.lock, uv.lock, Pipfile.lock, pdm.lock): the four disagree about dev/optional membership, and misreading one would charge a test-only package a consumer never receives. Known CVEs in the same dependency graph are a separate question, reported under D30.

Appendix B — Reproduction & audit trail

Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-827f42bb9550479d8e202de5c543cb5f/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-827f42bb9550479d8e202de5c543cb5f/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .58artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .11artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .4artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 1 file(s) — `clients/barrel-lite/src/attachments/att-sync.ts` — so the PII/GDPR sweep did not cover them at all.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .0artifacts/raw/trivy-fs.json

Run 01a1de29-2021-7360-9d9e-cf0fd1675d51 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md