-
Notifications
You must be signed in to change notification settings - Fork 7
[WIP] UDFs #303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] UDFs #303
Conversation
|
Static Code Review 📊 🔁 Analyzing this pull request for issues... |
📝 WalkthroughWalkthroughAdded many new documentation pages for FLEX UDFs (bitwise, collections, date, json, map, similarity, text) plus UDF index pages and expanded Changes
Sequence Diagram(s)(none — documentation-only additions, no runtime control-flow changes.) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
Pre-merge checks❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 8
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
udfs/udfs.md(1 hunks)
🧰 Additional context used
🪛 GitHub Actions: spellcheck
udfs/udfs.md
[error] 1-1: Misspelled words detected: udfs/udfs.md: html>body>h1
[error] 1-1: Misspelled words detected: udfs/udfs.md: html>body>p
[error] 1-1: Misspelled words detected: StringUtils UDF UpperCaseOdd
🪛 LanguageTool
udfs/udfs.md
[grammar] ~9-~9: Ensure spelling is correct
Context: ...e function needs to be usable to a wide audiance for it to be considered, in the past we...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[style] ~9-~9: The word ‘great’ tends to be overused. Consider an alternative.
Context: ...c and we didn't believe they've added a great value for most of our users. But now with th...
(A_GREAT_NUMBER)
[grammar] ~119-~119: Ensure spelling is correct
Context: ...via a direct connection to the DB. The comamnd takes two optional arguments: - Lib to ...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~171-~171: Ensure spelling is correct
Context: ...ID, labels and attributes via the coresponding properties: id - node internal ID `l...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~195-~195: Ensure spelling is correct
Context: ...ode,endNodeandattributesvia the coresponding properties: id- edge internal IDt...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~215-~215: Ensure spelling is correct
Context: ..., lengthandrelationshipsvia the coresponding properties: nodes- path's nodesle...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[style] ~233-~233: ‘exact same’ might be wordy. Consider a shorter alternative.
Context: ...neighbors. such that if A and B has the exact same neighbors then their similarity value w...
(EN_WORDINESS_PREMIUM_EXACT_SAME)
[grammar] ~268-~268: Ensure spelling is correct
Context: ...on.jsbut it also collects A's and B's neightbors via a call togetNeighbors` We're alm...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~323-~323: Ensure spelling is correct
Context: ... and similarity construct a graph and conputes Jaccard similarity between Alice and ...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~341-~341: Ensure spelling is correct
Context: ...le enough. Let's consider the following requierment, we would like to collect all reachable ...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~406-~406: Use a hyphen to join words.
Context: ...}") ``` ## FLEX Flex is FalkorDB's open source community UDF package available a...
(QB_NEW_EN_HYPHEN)
[grammar] ~407-~407: Ensure spelling is correct
Context: ... package available at ___ It contains a variaty of useful functionality like: 1. 2. 3. ...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~412-~412: Ensure spelling is correct
Context: ...ke: 1. 2. 3. We'll be happy to receive controbutions and extend this library to accomadate n...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~412-~412: Ensure spelling is correct
Context: ...ontrobutions and extend this library to accomadate new functionality. ## Limitations Curr...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~415-~415: Ensure spelling is correct
Context: ... ## Limitations Currently UDFs are not alowed to modify the graph, in any shape or fo...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🪛 markdownlint-cli2 (0.18.1)
udfs/udfs.md
62-62: Hard tabs
Column: 1
(MD010, no-hard-tabs)
66-66: Hard tabs
Column: 1
(MD010, no-hard-tabs)
70-70: Hard tabs
Column: 1
(MD010, no-hard-tabs)
75-75: Hard tabs
Column: 1
(MD010, no-hard-tabs)
83-83: Hard tabs
Column: 1
(MD010, no-hard-tabs)
207-207: Hard tabs
Column: 1
(MD010, no-hard-tabs)
208-208: Hard tabs
Column: 1
(MD010, no-hard-tabs)
209-209: Hard tabs
Column: 1
(MD010, no-hard-tabs)
210-210: Hard tabs
Column: 1
(MD010, no-hard-tabs)
225-225: Hard tabs
Column: 1
(MD010, no-hard-tabs)
226-226: Hard tabs
Column: 1
(MD010, no-hard-tabs)
374-374: Hard tabs
Column: 1
(MD010, no-hard-tabs)
392-392: Hard tabs
Column: 1
(MD010, no-hard-tabs)
397-397: Hard tabs
Column: 1
(MD010, no-hard-tabs)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AI Code Review 🤖
Files Reviewed: 1
Comments Added: 8
Lines of Code Analyzed: 416
Critical Issues: 0
PR Health: Needs Attention❗
Give 👍 or 👎 on each review comment to help us improve.
| function CollectIncreasingAmounts(n) { | ||
| const reachables = []; | ||
| const visited = new Map(); | ||
|
|
||
| DFS_IncreasingAmounts(n, visited, n.amount, reachables); | ||
|
|
||
| return reachables; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bug: visited is initialized as a Map but used as an Array. This will cause a TypeError in DFS_IncreasingAmounts.
| function CollectIncreasingAmounts(n) { | |
| const reachables = []; | |
| const visited = new Map(); | |
| DFS_IncreasingAmounts(n, visited, n.amount, reachables); | |
| return reachables; | |
| } | |
| function CollectIncreasingAmounts(n) { | |
| const reachables = []; | |
| const visited = []; | |
| DFS_IncreasingAmounts(n, visited, n.amount, reachables); | |
| return reachables; | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
♻️ Duplicate comments (13)
udfs/udfs.md (13)
268-268: Fix spelling: "neightbors" → "neighbors".🔎 Proposed fix
-As you'll notice `jaccard` uses both `union` and `intersection` from `collection.js` but it also collects A's and B's neightbors via a call to `getNeighbors` +As you'll notice `jaccard` uses both `union` and `intersection` from `collection.js` but it also collects A's and B's neighbors via a call to `getNeighbors`
119-119: Fix spelling: "comamnd" → "command".🔎 Proposed fix
-The comamnd takes two optional arguments: +The command takes two optional arguments:
232-232: Clarify Jaccard formula notation.Line 232 uses unclear notation:
|A B|should be the intersection|A ∩ B|. The current text is ambiguous and may confuse readers.🔎 Proposed fix
-Jaccard's formula J(A,B) = |A ∩ B| / |A ∪ B| = |A ∩ B| / |(A| + |B| - |A B|) +Jaccard's formula J(A,B) = |A ∩ B| / |A ∪ B| = |A ∩ B| / (|A| + |B| - |A ∩ B|)
48-48: Fix syntax error in query string (missing closing quote).Line 48 has an unterminated string literal that will cause a syntax error when executed.
🔎 Proposed fix
-s = graph.query("RETURN StringUtils.UpperCaseOdd('abcdef)").result_set[0][0] +s = graph.query("RETURN StringUtils.UpperCaseOdd('abcdef')").result_set[0][0]
341-341: Fix spelling: "requierment" → "requirement".🔎 Proposed fix
-Let's consider the following requierment, we would like to collect all reachable nodes from a given start node, a neighbor node is added to the expanded path if its `amount` value is greater than the accumulated sum of amounts on the current path. +Let's consider the following requirement, we would like to collect all reachable nodes from a given start node, a neighbor node is added to the expanded path if its `amount` value is greater than the accumulated sum of amounts on the current path.
235-235: Fix function name: "unio" → "union".Line 235 refers to a function called "unio", but the actual function defined below is "union". This mismatch will confuse readers.
🔎 Proposed fix
-To start with let's define two UDFS: `unio` and `intersection` in a `collection.js` file: +To start with let's define two UDFs: `union` and `intersection` in a `collection.js` file:
391-393: Fix Python indentation: use spaces, not tabs.Lines 391–393 use inconsistent indentation (tabs mixed with spaces), which will cause a
TabErrororIndentationErrorin Python.🔎 Proposed fix
# Load UDF with open("./traversals.js", "r") as f: - content = f.read() + content = f.read() db.udf_load("Traversals", content, True)
9-9: Fix spelling: "audiance" → "audience".🔎 Proposed fix
-the function needs to be usable to a wide audiance for it to be considered, in the past we've rejected requests for adding new functions as these were too specific and we didn't believe they've added a great value for most of our users. +the function needs to be usable to a wide audience for it to be considered, in the past we've rejected requests for adding new functions as these were too specific and we didn't believe they've added a great value for most of our users.
323-323: Fix spelling: "conputes" → "computes".🔎 Proposed fix
-The scripts loads our two UDF libraries `collection` and `similarity` construct a graph and conputes Jaccard similarity between `Alice` and every other node in the graph via the query: +The scripts load our two UDF libraries `collection` and `similarity` construct a graph and computes Jaccard similarity between `Alice` and every other node in the graph via the query:
73-79: Fix undefined property reference in Area function.The
Areafunction at line 75 referencesshape.height, but theTrianglefunction (lines 65–67) only defines propertiesa,b, andc. This will cause the function to returnNaN. The correct implementation should compute the area using the defined properties:(shape.a * shape.b) / 2.🔎 Proposed fix
function Area(shape) { if (ShapeType(shape) == 'triangle') { - return (shape.height * shape.b) / 2; + return (shape.a * shape.b) / 2; } else { throw new Error("Unsupported shape"); } }
205-211: Fix variable name mismatch in stringify_edge function.Line 210 references
n.attributes, but the function parameter ise(edge). This will cause aReferenceErrorat runtime. The reference should bee.attributes.🔎 Proposed fix
function stringify_edge(e) { return "id: " + e.id + "type: " + e.type + "startNode: " + e.startNode.id + "endNode: " + e.endNode.id + - "attributes: " + n.attributes; + "attributes: " + e.attributes; }
370-377: Fix data structure mismatch: visited declared as Map but used as Array.Line 372 declares
visitedasnew Map(), but the code treats it as an array: line 375 callsvisited.push(n.id)and line 383 callsvisited.includes(neighbor.id). These are Array methods, not Map methods. This will cause aTypeErrorat runtime.Change
visitedto an empty array[].🔎 Proposed fix
function CollectIncreasingAmounts(n) { const reachables = []; - const visited = new Map(); + const visited = []; DFS_IncreasingAmounts(n, visited, n.amount, reachables); return reachables; }
254-266: Fix missing function definitions in jaccard example.The
jaccardfunction (line 255) callsunion()andintersection(), but these functions are defined in thecollection.jslibrary block (lines 237–249), not in thesimilarity.jsblock shown here. When executed, this will cause aReferenceErrorbecause the functions are undefined in scope.To fix this, either:
- Include the
unionandintersectionfunction definitions in the same code block asjaccard, or- Clearly explain that both libraries (
collectionandsimilarity) must be loaded before usingjaccard.🔎 Proposed fix (Option 1: Include helper functions)
Prepend the helper functions to the
similarity.jscode block so they are defined whenjaccardexecutes:\`\`\`javascript +function union (a, b) { + return [...new Set([...a, ...b])]; +} + +function intersection (a, b) { + const setB = new Set(b); + return a.filter(x => setB.has(x)); +} + function jaccard(a, b) { const aIds = a.getNeighbors().map(x => x.id); const bIds = b.getNeighbors().map(x => x.id); const unionSize = union(aIds, bIds).length; const intersectionSize = intersection(aIds, bIds).length; return unionSize === 0 ? 0 : intersectionSize / unionSize; } falkor.register('jaccard', jaccard); \`\`\`Alternatively, add a note stating that both libraries must be loaded, and the
unionandintersectionfunctions are provided by thecollectionlibrary dependency.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
udfs/udfs.md
🧰 Additional context used
🪛 GitHub Actions: spellcheck
udfs/udfs.md
[error] 1-1: Misspelled words detected: html>body>h1
[error] 1-1: Misspelled words detected: html>body>p
[error] 1-1: Misspelled words detected: audiance
[error] 1-1: Misspelled words detected: UDFs
[error] 1-1: Misspelled words detected: StringUtils
[error] 1-1: Misspelled words detected: UpperCaseOdd
🪛 LanguageTool
udfs/udfs.md
[grammar] ~9-~9: Ensure spelling is correct
Context: ...e function needs to be usable to a wide audiance for it to be considered, in the past we...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[style] ~9-~9: The word ‘great’ tends to be overused. Consider an alternative.
Context: ...c and we didn't believe they've added a great value for most of our users. But now with th...
(A_GREAT_NUMBER)
[grammar] ~119-~119: Ensure spelling is correct
Context: ...via a direct connection to the DB. The comamnd takes two optional arguments: - Lib to ...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~171-~171: Ensure spelling is correct
Context: ...ID, labels and attributes via the coresponding properties: id - node internal ID `l...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~195-~195: Ensure spelling is correct
Context: ...ode,endNodeandattributesvia the coresponding properties: id- edge internal IDt...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~215-~215: Ensure spelling is correct
Context: ..., lengthandrelationshipsvia the coresponding properties: nodes- path's nodesle...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[style] ~233-~233: ‘exact same’ might be wordy. Consider a shorter alternative.
Context: ...neighbors. such that if A and B has the exact same neighbors then their similarity value w...
(EN_WORDINESS_PREMIUM_EXACT_SAME)
[grammar] ~268-~268: Ensure spelling is correct
Context: ...on.jsbut it also collects A's and B's neightbors via a call togetNeighbors` We're alm...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~323-~323: Ensure spelling is correct
Context: ... and similarity construct a graph and conputes Jaccard similarity between Alice and ...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~341-~341: Ensure spelling is correct
Context: ...le enough. Let's consider the following requierment, we would like to collect all reachable ...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~406-~406: Use a hyphen to join words.
Context: ...}") ``` ## FLEX Flex is FalkorDB's open source community UDF package available a...
(QB_NEW_EN_HYPHEN)
[grammar] ~407-~407: Ensure spelling is correct
Context: .../github.com/FalkorDB/flex It contains a variaty of useful functionality like: 1. String...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~412-~412: Ensure spelling is correct
Context: ...on integers. We'll be happy to receive controbutions and extend this library to accomadate n...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~412-~412: Ensure spelling is correct
Context: ...ontrobutions and extend this library to accomadate new functionality. ## Limitations Curr...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~415-~415: Ensure spelling is correct
Context: ... ## Limitations Currently UDFs are not alowed to modify the graph, in any shape or fo...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🪛 markdownlint-cli2 (0.18.1)
udfs/udfs.md
62-62: Hard tabs
Column: 1
(MD010, no-hard-tabs)
66-66: Hard tabs
Column: 1
(MD010, no-hard-tabs)
70-70: Hard tabs
Column: 1
(MD010, no-hard-tabs)
75-75: Hard tabs
Column: 1
(MD010, no-hard-tabs)
83-83: Hard tabs
Column: 1
(MD010, no-hard-tabs)
207-207: Hard tabs
Column: 1
(MD010, no-hard-tabs)
208-208: Hard tabs
Column: 1
(MD010, no-hard-tabs)
209-209: Hard tabs
Column: 1
(MD010, no-hard-tabs)
210-210: Hard tabs
Column: 1
(MD010, no-hard-tabs)
225-225: Hard tabs
Column: 1
(MD010, no-hard-tabs)
226-226: Hard tabs
Column: 1
(MD010, no-hard-tabs)
374-374: Hard tabs
Column: 1
(MD010, no-hard-tabs)
392-392: Hard tabs
Column: 1
(MD010, no-hard-tabs)
397-397: Hard tabs
Column: 1
(MD010, no-hard-tabs)
406-406: Bare URL used
(MD034, no-bare-urls)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
udfs/udfs.md
🧰 Additional context used
🪛 LanguageTool
udfs/udfs.md
[grammar] ~195-~195: Ensure spelling is correct
Context: ...ode,endNodeandattributesvia the coresponding properties: id- edge internal IDt...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~215-~215: Ensure spelling is correct
Context: ..., lengthandrelationshipsvia the coresponding properties: nodes- path's nodesle...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~406-~406: Use a hyphen to join words.
Context: ...}") ``` ## FLEX Flex is FalkorDB's open source community UDF package available a...
(QB_NEW_EN_HYPHEN)
[style] ~407-~407: Consider using a more concise synonym.
Context: ...://github.com/FalkorDB/flex It contains a variety of useful functionality like: 1. String an...
(A_VARIETY_OF)
🪛 markdownlint-cli2 (0.18.1)
udfs/udfs.md
62-62: Hard tabs
Column: 1
(MD010, no-hard-tabs)
66-66: Hard tabs
Column: 1
(MD010, no-hard-tabs)
70-70: Hard tabs
Column: 1
(MD010, no-hard-tabs)
75-75: Hard tabs
Column: 1
(MD010, no-hard-tabs)
83-83: Hard tabs
Column: 1
(MD010, no-hard-tabs)
207-207: Hard tabs
Column: 1
(MD010, no-hard-tabs)
208-208: Hard tabs
Column: 1
(MD010, no-hard-tabs)
209-209: Hard tabs
Column: 1
(MD010, no-hard-tabs)
210-210: Hard tabs
Column: 1
(MD010, no-hard-tabs)
225-225: Hard tabs
Column: 1
(MD010, no-hard-tabs)
226-226: Hard tabs
Column: 1
(MD010, no-hard-tabs)
374-374: Hard tabs
Column: 1
(MD010, no-hard-tabs)
392-392: Hard tabs
Column: 1
(MD010, no-hard-tabs)
393-393: Hard tabs
Column: 1
(MD010, no-hard-tabs)
397-397: Hard tabs
Column: 1
(MD010, no-hard-tabs)
406-406: Bare URL used
(MD034, no-bare-urls)
🔇 Additional comments (2)
udfs/udfs.md (2)
8-9: Fix spelling and spacing errors in the introduction.Line 8 has multiple issues:
- "audiance" → "audience"
- Missing space between backtick-enclosed code and "isn't":
'UpperCaseOdd'isn't→'UpperCaseOdd'isn'tLine 9: Consider "great value" → "significant value" for stronger language.
🔎 Proposed fix
-These are baked into the DB and are part of its source code, introducing a new function e.g. `UpperCaseOdd`isn't always trivial, -the function needs to be usable to a wide audiance for it to be considered, in the past we've rejected requests for adding new functions as these were too specific and we didn't believe they've added a great value for most of our users. +These are baked into the DB and are part of its source code, introducing a new function (e.g., `UpperCaseOdd`) isn't always trivial. +The function needs to be usable to a wide audience for it to be considered; in the past we've rejected requests for adding new functions as these were too specific and we didn't believe they've added significant value for most of our users.Likely an incorrect or invalid review comment.
62-62: Hard tabs within code blocks do not violate Markdown linting rules. The MD010 (no-hard-tabs) rule applies only to markdown source formatting, not to content within code fence blocks. The tabs at lines 62, 66, 70, 75, 83, and others are legitimate code indentation within thejavascriptcode block and should be preserved as-is.Likely an incorrect or invalid review comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 20
♻️ Duplicate comments (3)
udfs/index.md (3)
232-232: Fix Jaccard formula notation.Line 232 has a typo in the denominator:
|(A|should be(|A|for proper mathematical notation.🔎 Proposed fix
-Jaccard's formula J(A,B) = |A ∩ B| / |A ∪ B| = |A ∩ B| / |(A| + |B| - |A ∩ B|) +Jaccard's formula J(A,B) = |A ∩ B| / |A ∪ B| = |A ∩ B| / (|A| + |B| - |A ∩ B|)
48-48: Fix missing closing parenthesis in Cypher query.Line 48 has an unclosed string in the query:
"RETURN StringUtils.UpperCaseOdd('abcdef'"is missing a closing parenthesis before the final quote.🔎 Proposed fix
-s = graph.query("RETURN StringUtils.UpperCaseOdd('abcdef'").result_set[0][0] +s = graph.query("RETURN StringUtils.UpperCaseOdd('abcdef')").result_set[0][0]
406-406: Wrap bare URL in markdown link and hyphenate "open-source".Line 406 contains a bare URL which should be formatted as a markdown link to comply with MD034 linting rules, and "open source" should be hyphenated as "open-source" when used as an adjective.
🔎 Proposed fix
-Flex is FalkorDB's open source community UDF package available at https://github.com/FalkorDB/flex +Flex is FalkorDB's open-source community UDF package available at [https://github.com/FalkorDB/flex](https://github.com/FalkorDB/flex)
🧹 Nitpick comments (10)
udfs/flex/text/levenshtein.md (1)
37-44: Fix compound noun in comment (style improvement).Line 37 contains "User Names" which is flagged as potentially being better written as one word. Depending on context, consider changing to "usernames" for clarity. However, "User Names" is acceptable if referring to the property names belonging to users. If this is intentional, you can safely ignore this.
udfs/flex/date/toTimeZone.md (1)
1-78: Fix markdown linting violations across documentation files.All 8 documentation files have consistent formatting issues that need to be addressed:
MD058 (Tables should be surrounded by blank lines): All parameter and return tables lack blank lines before and after. Add a blank line immediately before
|and after the closing|of each table.MD040 (Fenced code blocks should have a language specified): Output blocks in examples don't specify a language. Change triple backticks from bare
```to```textor```outputto explicitly specify the code block type.Example fixes:
🔎 Proposed markdown formatting fixes
For tables (add blank line before and after):
## Parameters -| Parameter | Type | Required | Description | + +| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `datetime` | Date/number/string | Yes | The date/time value to convert | | `timezone` | string | Yes | Timezone offset like `"+02:00"`, `"-05:00"`, or `"+0530"` | + ## ReturnsFor output code blocks (specify language):
**Output:** -``` +```text eastern -------------------------- 2024-03-15T09:00:00.000ZApply these fixes systematically to all 8 files: - `udfs/flex/date/toTimeZone.md` - `udfs/flex/text/camelCase.md` - `udfs/flex/text/lpad.md` - `udfs/flex/map/merge.md` - `udfs/flex/bitwise/not.md` - `udfs/flex/map/submap.md` - `udfs/flex/similarity/jaccard.md` - `udfs/flex/text/decapitalize.md` </details> </blockquote></details> <details> <summary>udfs/flex/bitwise/shiftLeft.md (1)</summary><blockquote> `12-15`: **Add blank lines around parameter table and specify language for output code block.** Markdown formatting guidelines require blank lines surrounding tables (MD058) and language specification on all fenced code blocks (MD040). <details> <summary>🔎 Proposed fixes</summary> ```diff ## Parameters + | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `a` | number (integer) | Yes | The value to shift | | `positions` | number (integer) | Yes | Number of positions to shift left | + ## Returns**Output:** -``` +```text result ------ 20```diff **Output:** -``` +```text times2 | times4 | times8 -------|--------|------- 14 | 28 | 56```diff **Output:** -``` +```text mask ---- 8</details> </blockquote></details> <details> <summary>udfs/flex/collections/intersection.md (1)</summary><blockquote> `12-15`: **Add blank lines around parameter table and specify language for output code blocks.** Apply consistent Markdown formatting: blank lines around tables (MD058) and language specification on all fenced code blocks (MD040). <details> <summary>🔎 Proposed fixes</summary> ```diff ## Parameters + | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `list1` | list | Yes | The first list | | `list2` | list | Yes | The second list | + ## Returns**Output:** -``` +```text result ------- [3, 4]```diff **Output:** -``` +```text result ------- [3, 4]</details> </blockquote></details> <details> <summary>udfs/flex/map/removeKey.md (1)</summary><blockquote> `12-15`: **Add blank lines around parameter table and specify language for output code blocks.** Consistent with other FLEX documentation: add blank lines around tables (MD058) and language specification on fenced code block outputs (MD040). <details> <summary>🔎 Proposed fixes</summary> ```diff ## Parameters + | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `map` | map | Yes | The map to remove the key from | | `key` | string | Yes | The key to remove | + ## Returns**Output:** -``` +```text sanitized ----------------------- {name: 'Alice', age: 30}```diff **Output:** -``` +```text result --------- {a: 1, b: 2}</details> </blockquote></details> <details> <summary>udfs/flex/json/toJson.md (1)</summary><blockquote> `12-15`: **Add blank lines around parameter table and specify language for output code blocks.** Apply consistent formatting across FLEX documentation: blank lines around tables (MD058) and language specification on code block outputs (MD040). <details> <summary>🔎 Proposed fixes</summary> ```diff ## Parameters + | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `value` | any | Yes | The value to serialize to JSON | + ## Returns**Output:** -``` +```text json --------------------------------------- '{"name":"Alice","age":30,"active":true}'```diff **Output:** -``` +```text json ----------- '[1,2,3,4,5]'</details> </blockquote></details> <details> <summary>udfs/flex/date/truncate.md (1)</summary><blockquote> `12-15`: **Add blank lines around parameter tables and specify language for output code blocks.** Consistent formatting needed: blank lines around both parameter table (line 12) and supported units table (line 18), plus language specification on output code blocks (MD040). <details> <summary>🔎 Proposed fixes</summary> ```diff ## Parameters + | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `datetime` | Date/number/string | Yes | The date/time value to truncate | | `unit` | string | Yes | The unit to truncate to | + ### Supported Units + | Unit | Description | Truncates To | |------|-------------|--------------| | `'minute'` | Truncate to start of minute | Sets seconds and milliseconds to 0 | ... + ## Returns**Output:** -``` +```text truncated -------------------------- 2024-03-15T00:00:00.000Z```diff **Output:** -``` +```text truncated -------------------------- 2024-03-01T00:00:00.000Z</details> Also applies to: 18-27 </blockquote></details> <details> <summary>udfs/flex/date/format.md (1)</summary><blockquote> `12-17`: **Add blank lines around parameter tables and specify language for output code blocks.** Consistent formatting: blank lines around parameter table (line 12) and supported tokens table (line 18), plus language specification on output code blocks (MD040). <details> <summary>🔎 Proposed fixes</summary> ```diff ## Parameters + | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `datetime` | Date/number/string | Yes | The date/time value to format | | `pattern` | string | No | Format pattern using tokens (default: `'YYYY-MM-DDTHH:mm:ss[Z]'`) | | `timezone` | string | No | Timezone offset like `"+02:00"` or `"-05:00"` | + ### Supported Pattern Tokens + | Token | Description | Example | |-------|-------------|---------| | `YYYY` | 4-digit year | `2024` | ... + ## Returns**Output:** -``` +```text date ---------- 2024-03-15```diff **Output:** -``` +```text formatted ------------------- 2024-03-15 14:30:45</details> Also applies to: 18-29 </blockquote></details> <details> <summary>udfs/flex/map/removeKeys.md (1)</summary><blockquote> `12-15`: **Add blank lines around parameter table and specify language for output code blocks.** Apply consistent Markdown formatting: blank lines around table (MD058) and language specification on code block outputs (MD040). <details> <summary>🔎 Proposed fixes</summary> ```diff ## Parameters + | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `map` | map | Yes | The map to remove keys from | | `keys` | list | Yes | An array of key names to remove | + ## Returns**Output:** -``` +```text sanitized ----------------------- {name: 'Alice', age: 30}```diff **Output:** -``` +```text result ----------------- {a: 1, b: 2, c: 3}</details> </blockquote></details> <details> <summary>udfs/index.md (1)</summary><blockquote> `178-180`: **Improve node stringification with JSON.stringify for clarity.** While the current implementation works, using `JSON.stringify` for objects provides clearer output and is more maintainable. <details> <summary>🔎 Proposed improvement</summary> ```diff function stringify_node(n) { - return "id: " + n.id + " labels: " + n.labels + " attributes: " + n.attributes; + return "id: " + n.id + " labels: " + JSON.stringify(n.labels) + " attributes: " + JSON.stringify(n.attributes); }This ensures proper serialization of nested objects and arrays.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (44)
.wordlist.txtudfs/flex/bitwise/and.mdudfs/flex/bitwise/not.mdudfs/flex/bitwise/or.mdudfs/flex/bitwise/shiftLeft.mdudfs/flex/bitwise/shiftRight.mdudfs/flex/bitwise/xor.mdudfs/flex/collections/frequencies.mdudfs/flex/collections/intersection.mdudfs/flex/collections/shuffle.mdudfs/flex/collections/union.mdudfs/flex/collections/zip.mdudfs/flex/date/format.mdudfs/flex/date/parse.mdudfs/flex/date/toTimeZone.mdudfs/flex/date/truncate.mdudfs/flex/index.mdudfs/flex/json/fromJsonList.mdudfs/flex/json/fromJsonMap.mdudfs/flex/json/toJson.mdudfs/flex/map/fromPairs.mdudfs/flex/map/merge.mdudfs/flex/map/removeKey.mdudfs/flex/map/removeKeys.mdudfs/flex/map/submap.mdudfs/flex/similarity/jaccard.mdudfs/flex/text/camelCase.mdudfs/flex/text/capitalize.mdudfs/flex/text/decapitalize.mdudfs/flex/text/format.mdudfs/flex/text/indexOf.mdudfs/flex/text/indexesOf.mdudfs/flex/text/jaroWinkler.mdudfs/flex/text/join.mdudfs/flex/text/levenshtein.mdudfs/flex/text/lpad.mdudfs/flex/text/regexGroups.mdudfs/flex/text/repeat.mdudfs/flex/text/replace.mdudfs/flex/text/rpad.mdudfs/flex/text/snakeCase.mdudfs/flex/text/swapCase.mdudfs/flex/text/upperCamelCase.mdudfs/index.md
✅ Files skipped from review due to trivial changes (3)
- udfs/flex/text/regexGroups.md
- udfs/flex/bitwise/or.md
- udfs/flex/text/indexesOf.md
🧰 Additional context used
🪛 LanguageTool
udfs/flex/collections/intersection.md
[grammar] ~65-~65: Ensure spelling is correct
Context: ...If an element appears multiple times in list1, each occurrence is checked against lis...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~65-~65: Ensure spelling is correct
Context: ...st1, each occurrence is checked against list2 - Efficient implementation using Set for f...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
udfs/flex/text/levenshtein.md
[style] ~37-~37: It’s more common nowadays to write this noun as one word.
Context: ...- 3 ### Example 2: Finding Similar User Namescypher // Find users with names simi...
(RECOMMENDED_COMPOUNDS)
udfs/index.md
[grammar] ~195-~195: Ensure spelling is correct
Context: ...ode,endNodeandattributesvia the coresponding properties: id- edge internal IDt...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~215-~215: Ensure spelling is correct
Context: ..., lengthandrelationshipsvia the coresponding properties: nodes- path's nodesle...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~406-~406: Use a hyphen to join words.
Context: ...}") ``` ## FLEX Flex is FalkorDB's open source community UDF package available a...
(QB_NEW_EN_HYPHEN)
[style] ~407-~407: Consider using a more concise synonym.
Context: ...://github.com/FalkorDB/flex It contains a variety of useful functionality like: 1. String an...
(A_VARIETY_OF)
🪛 markdownlint-cli2 (0.18.1)
udfs/flex/collections/union.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
30-30: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
47-47: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
60-60: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/text/rpad.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
31-31: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
44-44: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/map/removeKey.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
31-31: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
59-59: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/map/removeKeys.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
31-31: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
59-59: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/text/camelCase.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
29-29: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
41-41: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/date/truncate.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
18-18: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
42-42: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
55-55: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/text/decapitalize.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
31-31: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/collections/intersection.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
31-31: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/text/jaroWinkler.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
34-34: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/map/fromPairs.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
30-30: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
45-45: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/bitwise/shiftRight.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
30-30: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
47-47: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
60-60: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
74-74: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/bitwise/and.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
30-30: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
44-44: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/bitwise/not.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
29-29: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
42-42: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
56-56: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/bitwise/xor.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
19-19: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
44-44: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
57-57: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
70-70: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/collections/frequencies.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
30-30: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/collections/shuffle.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
30-30: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/collections/zip.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
31-31: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
44-44: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/date/toTimeZone.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
18-18: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
42-42: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
55-55: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/json/fromJsonList.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
30-30: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
60-60: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/json/fromJsonMap.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
30-30: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
58-58: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/json/toJson.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
30-30: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
45-45: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/map/merge.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
31-31: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
59-59: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/map/submap.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
31-31: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
57-57: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/similarity/jaccard.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
29-29: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/text/capitalize.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
29-29: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
41-41: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/text/format.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
30-30: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
50-50: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/text/indexOf.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
32-32: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
44-44: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/text/join.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
31-31: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
45-45: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/text/levenshtein.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
31-31: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
45-45: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/text/lpad.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
31-31: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
44-44: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
59-59: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/text/repeat.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
30-30: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
42-42: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
55-55: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
70-70: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/text/replace.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
31-31: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
44-44: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
64-64: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/text/snakeCase.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
29-29: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
43-43: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/text/swapCase.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
29-29: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
41-41: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/flex/text/upperCamelCase.md
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
29-29: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
41-41: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
udfs/index.md
62-62: Hard tabs
Column: 1
(MD010, no-hard-tabs)
66-66: Hard tabs
Column: 1
(MD010, no-hard-tabs)
70-70: Hard tabs
Column: 1
(MD010, no-hard-tabs)
75-75: Hard tabs
Column: 1
(MD010, no-hard-tabs)
83-83: Hard tabs
Column: 1
(MD010, no-hard-tabs)
207-207: Hard tabs
Column: 1
(MD010, no-hard-tabs)
208-208: Hard tabs
Column: 1
(MD010, no-hard-tabs)
209-209: Hard tabs
Column: 1
(MD010, no-hard-tabs)
210-210: Hard tabs
Column: 1
(MD010, no-hard-tabs)
225-225: Hard tabs
Column: 1
(MD010, no-hard-tabs)
226-226: Hard tabs
Column: 1
(MD010, no-hard-tabs)
374-374: Hard tabs
Column: 1
(MD010, no-hard-tabs)
392-392: Hard tabs
Column: 1
(MD010, no-hard-tabs)
393-393: Hard tabs
Column: 1
(MD010, no-hard-tabs)
397-397: Hard tabs
Column: 1
(MD010, no-hard-tabs)
406-406: Bare URL used
(MD034, no-bare-urls)
🔇 Additional comments (8)
udfs/flex/text/snakeCase.md (1)
52-58: Example 3 is incomplete (no output section).Example 3 shows a query but lacks an output section like the other examples. Please add an Output: block demonstrating the expected result, or clarify if this is intentional.
udfs/flex/collections/union.md (1)
37-41: Examples 2 and 4 are incomplete (missing output sections).For consistency with Examples 1 and 3, Examples 2 and 4 should include an Output: block showing expected results. This helps users understand what the queries produce.
Also applies to: 53-57
udfs/flex/collections/zip.md (1)
51-62: Examples 3 and 4 are incomplete (missing output sections).For consistency with Examples 1 and 2, Examples 3 and 4 should include an Output: block showing expected results.
Also applies to: 58-62
udfs/flex/text/levenshtein.md (1)
46-55: Example 3 is incomplete (missing output section).Example 3 shows a query but lacks an output section like Examples 1 and 2. Please add an Output: block demonstrating the expected result.
udfs/flex/index.md (3)
1-96: Documentation quality and structure are excellent across all files.All documentation files follow a consistent, well-organized structure with clear sections for syntax, parameters, returns, multiple practical examples, edge case notes, and cross-references. The examples are concrete and demonstrate both basic usage and real-world scenarios (e.g., permission flags in bitwise ops, timezone handling in date parsing, API response parsing in JSON utilities). The See Also sections properly cross-reference related functions using correct relative paths.
1-96: Consolidated markdown formatting issues across all documentation files.Static analysis tools have flagged consistent formatting issues across all the documentation files in this PR:
MD058 - Tables should be surrounded by blank lines: Tables in all files lack blank lines before them. Example:
and.mdline 12,xor.mdlines 12/19,shiftRight.mdline 12, etc.MD040 - Fenced code blocks should have a language specified: Output code blocks (the
**Output:**sections showing results) need language specification. Examples:and.mdline 30,xor.mdlines 44/57,shiftRight.mdlines 30/47/60/74, etc.These are minor formatting issues but should be fixed to pass linting checks. Consider adding a blank line before each table and specifying a language (e.g.,
plaintextortext) for output blocks.🔎 Proposed markdown formatting fixes (example from and.md)
For tables, add a blank line before:
## Parameters + | Parameter | Type | Required | Description |For output blocks, add language specifier:
**Output:** -``` +```plaintext result ------ 8Likely an incorrect or invalid review comment.
11-96: All referenced FLEX function documentation files exist in the repository.Verification of 43 referenced files shows that 41 exist. The 2 missing files—
README.mdandTEMPLATE.md—are infrastructure/template files rather than function documentation. All 30+ function files across the 7 categories (bitwise, date, json, text, collection, map, similarity) are present in the repository.udfs/index.md (1)
370-381: Improve custom traversal example with better variable initialization.While functional, initializing
visitedas an array (line 371) is more idiomatic for a DFS traversal than other collection types.The implementation correctly demonstrates custom graph traversal using
getNeighbors()with node filtering logic based on amount values. The approach is sound and the recursive logic is well-structured.
| UDF | ||
| UDFs | ||
| StringUtils | ||
| UpperCaseOdd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix alphabetical ordering of new wordlist entries.
The entries "UDF" and "UDFs" are correctly placed alphabetically after "Trendshift", but "StringUtils" is out of order. It should be inserted in the 'S' section (around line 281-288 where other "Str*" entries like "str", "strList", and "substring" are located), not at the end of the file.
🔎 Proposed fix for alphabetical ordering
Move "StringUtils" to its correct alphabetical position in the 'S' section:
stopwords
str
+ StringUtils
strList
subcommandsThen remove it from the end of the file:
Trendshift
UDF
UDFs
- StringUtils
UpperCaseOddCommittable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In .wordlist.txt around lines 689-692 the entries list includes "UDF", "UDFs",
and "StringUtils"; "UDF" and "UDFs" are fine but "StringUtils" is out of
alphabetical order and must be moved into the 'S' section; cut the "StringUtils"
entry from lines 689-692 and insert it into the 'S' block around lines 281-288
with other "Str*" entries (e.g., alongside "str", "strList", before "substring")
so the file remains alphabetically ordered, then save the file.
| ## Parameters | ||
| | Parameter | Type | Required | Description | | ||
| |-----------|------|----------|-------------| | ||
| | `list1` | list | Yes | The first list | | ||
| | `list2` | list | Yes | The second list | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add blank line before table (MD058).
Tables should be surrounded by blank lines. Add a blank line before line 12 where the table begins.
🔎 Proposed fix
| `list2` | list | Yes | The second list |
+
| Parameter | Type | Required | Description |📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ## Parameters | |
| | Parameter | Type | Required | Description | | |
| |-----------|------|----------|-------------| | |
| | `list1` | list | Yes | The first list | | |
| | `list2` | list | Yes | The second list | | |
| ## Parameters | |
| | Parameter | Type | Required | Description | | |
| |-----------|------|----------|-------------| | |
| | `list1` | list | Yes | The first list | | |
| | `list2` | list | Yes | The second list | |
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
🤖 Prompt for AI Agents
In udfs/flex/collections/union.md around lines 11 to 15, the Markdown table
starting on line 12 needs a preceding blank line to satisfy MD058; insert a
single empty line immediately before the table header (so there is a blank line
between the preceding paragraph/heading and the table), save the file, and
ensure the rest of the table formatting remains unchanged.
| ``` | ||
|
|
||
| **Output:** | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specify language for output code blocks (MD040).
Fenced code blocks should specify a language. Output examples at lines 31, 47, and 60 use bare triple backticks. Add text as the language identifier.
🔎 Proposed fix
**Output:**
-```
+```text
resultAlso applies to: 47-47, 60-60
🤖 Prompt for AI Agents
In udfs/flex/collections/union.md around lines 31, 47 and 60, the fenced code
blocks are missing language identifiers (MD040); update each bare
triple-backtick block to specify a language (use `text`) so they become ```text
... ```, ensuring all three instances at the specified lines are changed
accordingly.
| ## Parameters | ||
| | Parameter | Type | Required | Description | | ||
| |-----------|------|----------|-------------| | ||
| | `list1` | list | Yes | The first list | | ||
| | `list2` | list | Yes | The second list | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add blank line before table (MD058).
Tables should be surrounded by blank lines. Add a blank line before line 12 where the table begins.
🔎 Proposed fix
| `list2` | list | Yes | The second list |
+
| Parameter | Type | Required | Description |Committable suggestion skipped: line range outside the PR's diff.
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
🤖 Prompt for AI Agents
In udfs/flex/collections/zip.md around lines 11 to 15, the Markdown table
starting at line 12 is missing a blank line before it (MD058). Add a single
empty line immediately before the table so the table is surrounded by blank
lines—i.e., insert a blank line between the preceding paragraph/heading and the
table start.
| ``` | ||
|
|
||
| **Output:** | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specify language for output code blocks (MD040).
Fenced code blocks should specify a language. Output examples at lines 31 and 44 use bare triple backticks. Add text as the language identifier.
🔎 Proposed fix
**Output:**
-```
+```text
pairsAlso applies to: 44-44
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
31-31: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
In udfs/flex/collections/zip.md around lines 31 and 44, the fenced code blocks
use bare triple backticks and must specify a language per MD040; update both
code fences to include the language identifier `text` (e.g., change ``` to
```text) so the output examples are properly marked.
| ## Parameters | ||
| | Parameter | Type | Required | Description | | ||
| |-----------|------|----------|-------------| | ||
| | `string` | string | Yes | The string to swap case | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add blank line before table (MD058).
Tables should be surrounded by blank lines. Add a blank line before line 12 where the table begins.
🔎 Proposed fix
| `string` | string | Yes | The string to swap case |
+
| Parameter | Type | Required | Description |📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ## Parameters | |
| | Parameter | Type | Required | Description | | |
| |-----------|------|----------|-------------| | |
| | `string` | string | Yes | The string to swap case | | |
| ## Parameters | |
| | Parameter | Type | Required | Description | | |
| |-----------|------|----------|-------------| | |
| | `string` | string | Yes | The string to swap case | |
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
🤖 Prompt for AI Agents
In udfs/flex/text/swapCase.md around lines 11 to 14, the Markdown table is not
preceded by a blank line (MD058); add a single empty line immediately before the
table start (before line 12) so the table is surrounded by blank lines, then
save the file.
| ``` | ||
|
|
||
| **Output:** | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specify language for output code blocks (MD040).
Fenced code blocks should specify a language. Output examples at lines 29 and 41 use bare triple backticks. Add text as the language identifier.
🔎 Proposed fix
**Output:**
-```
+```text
resultAlso applies to: 41-41
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
29-29: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
In udfs/flex/text/swapCase.md around lines 29 and 41, the fenced code blocks are
missing a language identifier; update each bare triple-backtick block to use
```text so the examples explicitly declare the language (e.g., replace ``` with
```text for the blocks at lines 29 and 41).
| ## Parameters | ||
| | Parameter | Type | Required | Description | | ||
| |-----------|------|----------|-------------| | ||
| | `string` | string | Yes | The string to convert to UpperCamelCase | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add blank line before table (MD058).
Tables should be surrounded by blank lines. Add a blank line before line 12 where the table begins.
🔎 Proposed fix
| `string` | string | Yes | The string to convert to UpperCamelCase |
+
| Parameter | Type | Required | Description |📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ## Parameters | |
| | Parameter | Type | Required | Description | | |
| |-----------|------|----------|-------------| | |
| | `string` | string | Yes | The string to convert to UpperCamelCase | | |
| ## Parameters | |
| | Parameter | Type | Required | Description | | |
| |-----------|------|----------|-------------| | |
| | `string` | string | Yes | The string to convert to UpperCamelCase | |
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
12-12: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
🤖 Prompt for AI Agents
In udfs/flex/text/upperCamelCase.md around lines 11 to 14, the Markdown table
starting on line 12 needs a blank line before it to satisfy MD058; insert a
single empty line immediately above the table (between the preceding
paragraph/heading and the table) so the table is surrounded by blank lines.
| ``` | ||
|
|
||
| **Output:** | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specify language for output code blocks (MD040).
Fenced code blocks should specify a language. The output examples at lines 29 and 41 use bare triple backticks. Add text as the language identifier.
🔎 Proposed fix
**Output:**
-```
+```text
resultAlso applies to: 41-41
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
29-29: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
In udfs/flex/text/upperCamelCase.md around lines 29 and 41, the fenced code
blocks use bare triple backticks and must specify a language; update each of
those code fences to use the language identifier "text" (e.g., replace ``` with
```text) so the output examples are properly annotated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (3)
udfs/index.md (3)
48-48: Fix missing closing parenthesis in Cypher query.Line 48 has a syntax error—the query string is missing a closing parenthesis on the function call.
🔎 Proposed fix
-s = graph.query("RETURN StringUtils.UpperCaseOdd('abcdef'").result_set[0][0] +s = graph.query("RETURN StringUtils.UpperCaseOdd('abcdef')").result_set[0][0]
406-406: Wrap bare URL in markdown link syntax and fix hyphenation.Line 406 contains a bare URL that should be formatted as a markdown link per MD034 linting rules. Additionally, "open source" should be hyphenated as "open-source" when used as a compound adjective.
🔎 Proposed fix
-Flex is FalkorDB's open source community UDF package available at https://github.com/FalkorDB/flex +Flex is FalkorDB's open-source community UDF package available at [https://github.com/FalkorDB/flex](https://github.com/FalkorDB/flex)
232-232: Fix Jaccard formula notation typo.The denominator contains a typo:
|(A|should be|A|.🔎 Proposed fix
-Jaccard's formula J(A,B) = |A ∩ B| / |A ∪ B| = |A ∩ B| / |(A| + |B| - |A ∩ B|) +Jaccard's formula J(A,B) = |A ∩ B| / |A ∪ B| = |A ∩ B| / (|A| + |B| - |A ∩ B|)
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
udfs/flex/index.mdudfs/index.md
🧰 Additional context used
🪛 LanguageTool
udfs/index.md
[grammar] ~406-~406: Use a hyphen to join words.
Context: ...}") ``` ## FLEX Flex is FalkorDB's open source community UDF package available a...
(QB_NEW_EN_HYPHEN)
[style] ~407-~407: Consider using a more concise synonym.
Context: ...://github.com/FalkorDB/flex It contains a variety of useful functionality like: 1. String an...
(A_VARIETY_OF)
🪛 markdownlint-cli2 (0.18.1)
udfs/index.md
62-62: Hard tabs
Column: 1
(MD010, no-hard-tabs)
66-66: Hard tabs
Column: 1
(MD010, no-hard-tabs)
70-70: Hard tabs
Column: 1
(MD010, no-hard-tabs)
75-75: Hard tabs
Column: 1
(MD010, no-hard-tabs)
83-83: Hard tabs
Column: 1
(MD010, no-hard-tabs)
207-207: Hard tabs
Column: 1
(MD010, no-hard-tabs)
208-208: Hard tabs
Column: 1
(MD010, no-hard-tabs)
209-209: Hard tabs
Column: 1
(MD010, no-hard-tabs)
210-210: Hard tabs
Column: 1
(MD010, no-hard-tabs)
225-225: Hard tabs
Column: 1
(MD010, no-hard-tabs)
226-226: Hard tabs
Column: 1
(MD010, no-hard-tabs)
374-374: Hard tabs
Column: 1
(MD010, no-hard-tabs)
392-392: Hard tabs
Column: 1
(MD010, no-hard-tabs)
393-393: Hard tabs
Column: 1
(MD010, no-hard-tabs)
397-397: Hard tabs
Column: 1
(MD010, no-hard-tabs)
406-406: Bare URL used
(MD034, no-bare-urls)
🔇 Additional comments (1)
udfs/flex/index.md (1)
1-121: LGTM!The FLEX function reference index is well-organized with clear categorization, consistent link formatting, and practical use-case examples. All functions are properly documented with links to their respective documentation files.
| return shape.type; | ||
| } | ||
|
|
||
| function Triangle() { | ||
| return {type: 'triangle', a:2, b:3, c:5}; | ||
| } | ||
|
|
||
| function RandomShape() { | ||
| return Triangle(); | ||
| } | ||
|
|
||
| function Area(shape) { | ||
| if (ShapeType(shape) == 'triangle') { | ||
| return (shape.a * shape.b) / 2; | ||
| } else { | ||
| throw new Error("Unsupported shape"); | ||
| } | ||
| } | ||
|
|
||
| function Perimeter(shape) { | ||
| if (ShapeType(shape) == 'triangle') { | ||
| return shape.a + shape.b + shape.c; | ||
| } else { | ||
| throw new Error("Unsupported shape"); | ||
| } | ||
| } | ||
|
|
||
| // Expose functions | ||
| falkor.register('Area', Area); | ||
| falkor.register('Perimeter', Perimeter); | ||
| falkor.register('RandomShape', RandomShape); | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# First, find the file and check if it exists
find . -name "index.md" -path "*/udfs/*" -type fRepository: FalkorDB/docs
Length of output: 93
🏁 Script executed:
# Check for hard tabs in the file, using cat -A to visualize them
cat -A ./udfs/index.md | head -100Repository: FalkorDB/docs
Length of output: 3467
🏁 Script executed:
# Count all hard tabs in the file and get their line numbers
grep -n $'\t' ./udfs/index.md | wc -l
echo "---"
# Show which lines have tabs
grep -n $'\t' ./udfs/index.mdRepository: FalkorDB/docs
Length of output: 625
Replace all hard tabs with spaces in code blocks.
Code blocks use hard tab characters for indentation, violating the MD010 linting rule and creating inconsistent formatting. 15 lines across the file contain tabs. Replace all leading tabs with consistent spaces (4 spaces per indentation level).
Affected lines: 62, 66, 70, 75, 83, 207–210, 225–226, 374, 392–393, 397.
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
62-62: Hard tabs
Column: 1
(MD010, no-hard-tabs)
66-66: Hard tabs
Column: 1
(MD010, no-hard-tabs)
70-70: Hard tabs
Column: 1
(MD010, no-hard-tabs)
75-75: Hard tabs
Column: 1
(MD010, no-hard-tabs)
83-83: Hard tabs
Column: 1
(MD010, no-hard-tabs)
🤖 Prompt for AI Agents
In udfs/index.md around lines 62–93 (affected lines specifically: 62, 66, 70,
75, 83, 207–210, 225–226, 374, 392–393, 397), code blocks contain hard tab
characters for indentation which violates MD010; replace all leading tab
characters with spaces using 4 spaces per indentation level across the listed
lines and any other tabs inside code blocks, verify alignment remains correct,
and run the linter to ensure MD010 is satisfied.
Structure headings level2 and level3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (7)
udfs/index.md (7)
232-232: Fix typo in Jaccard similarity formula.The denominator notation has a typo:
|(A|should be|A|. This makes the mathematical notation unclear.🔎 Proposed fix
-Jaccard's formula J(A,B) = |A ∩ B| / |A ∪ B| = |A ∩ B| / |(A| + |B| - |A ∩ B|) +Jaccard's formula J(A,B) = |A ∩ B| / |A ∪ B| = |A ∩ B| / (|A| + |B| - |A ∩ B|)(Also changed the pipe delimiters to parentheses in the denominator for clarity.)
48-48: Fix missing closing parenthesis in Cypher query.The query string is missing a closing parenthesis and parenthesis for the outer
RETURNstatement.🔎 Proposed fix
-s = graph.query("RETURN StringUtils.UpperCaseOdd('abcdef'").result_set[0][0] +s = graph.query("RETURN StringUtils.UpperCaseOdd('abcdef')").result_set[0][0]
405-412: Wrap bare URL in Markdown link syntax and fix hyphenation.Line 406 contains a bare URL and uses the unhyphenated phrase "open source". Wrap the URL in Markdown link syntax and change "open source" to "open-source" for proper formatting and grammar compliance.
🔎 Proposed fix
-Flex is FalkorDB's open source community UDF package available at https://github.com/FalkorDB/flex +Flex is FalkorDB's open-source community UDF package available at [https://github.com/FalkorDB/flex](https://github.com/FalkorDB/flex)
170-181: Fix stringify_node to properly serialize complex attributes.Line 179 concatenates
n.labelsandn.attributesdirectly as strings, which will produce[object Object]in the output. UseJSON.stringify()to correctly serialize these properties.🔎 Proposed fix
function stringify_node(n) { - return "id: " + n.id + " labels: " + JSON.stringify(n.labels) + " attributes: " + JSON.stringify(n.attributes); + return "id: " + n.id + " labels: " + JSON.stringify(n.labels) + " attributes: " + JSON.stringify(n.attributes); }Note: The fix is already present in the annotated code at line 179, which is correct. If this was an error in a previous version, the issue has been resolved.
204-212: Replace hard tabs with spaces in stringify_edge.Lines 207–210 use hard tabs for indentation; replace with spaces to match line 206. All variable references correctly use
e(no issues detected).function stringify_edge(e) { return "id: " + e.id + - " type: " + e.type + - " startNode: " + e.startNode.id + - " endNode: " + e.endNode.id + - " attributes: " + JSON.stringify(e.attributes); + " type: " + e.type + + " startNode: " + e.startNode.id + + " endNode: " + e.endNode.id + + " attributes: " + JSON.stringify(e.attributes); }
62-93: Replace hard tabs with spaces in code blocks.Multiple code blocks contain hard tab characters instead of spaces for indentation, violating the MD010 linting rule. This affects readability and consistency in Markdown rendering.
Affected lines: 62, 66, 70, 83, 87, 207–210, 225–226, 374, 392–393, and 397.
🔎 Proposed fix for lines 62–93 (Shapes example)
function ShapeType(shape) { - return shape.type; + return shape.type; } function Triangle() { - return {type: 'triangle', a:2, b:3, c:5}; + return {type: 'triangle', a:2, b:3, c:5}; } function RandomShape() { - return Triangle(); + return Triangle(); } function Area(shape) { if (ShapeType(shape) == 'triangle') { - return (shape.a * shape.b) / 2; + return (shape.a * shape.b) / 2; } else { throw new Error("Unsupported shape"); } } function Perimeter(shape) { if (ShapeType(shape) == 'triangle') { - return shape.a + shape.b + shape.c; + return shape.a + shape.b + shape.c; } else { throw new Error("Unsupported shape"); } }Apply the same fix (tabs → 4 spaces) to lines 207–210, 225–226, 374, 392–393, and 397.
223-228: Replace hard tabs in stringify_path.Lines 225–226 contain hard tab characters for indentation that conflict with the space-based indentation used elsewhere in the function. Replace with spaces for consistency.
function stringify_path(p) { return "nodes: " + p.nodes + - "length: " + p.length + - "relationships: " + p.relationships; + "length: " + p.length + + "relationships: " + p.relationships; }
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
udfs/index.md
🧰 Additional context used
🪛 LanguageTool
udfs/index.md
[grammar] ~406-~406: Use a hyphen to join words.
Context: ...}") ``` ## FLEX Flex is FalkorDB's open source community UDF package available a...
(QB_NEW_EN_HYPHEN)
[style] ~407-~407: Consider using a more concise synonym.
Context: ...://github.com/FalkorDB/flex It contains a variety of useful functionality like: 1. String an...
(A_VARIETY_OF)
🪛 markdownlint-cli2 (0.18.1)
udfs/index.md
62-62: Hard tabs
Column: 1
(MD010, no-hard-tabs)
66-66: Hard tabs
Column: 1
(MD010, no-hard-tabs)
70-70: Hard tabs
Column: 1
(MD010, no-hard-tabs)
75-75: Hard tabs
Column: 1
(MD010, no-hard-tabs)
83-83: Hard tabs
Column: 1
(MD010, no-hard-tabs)
207-207: Hard tabs
Column: 1
(MD010, no-hard-tabs)
208-208: Hard tabs
Column: 1
(MD010, no-hard-tabs)
209-209: Hard tabs
Column: 1
(MD010, no-hard-tabs)
210-210: Hard tabs
Column: 1
(MD010, no-hard-tabs)
225-225: Hard tabs
Column: 1
(MD010, no-hard-tabs)
226-226: Hard tabs
Column: 1
(MD010, no-hard-tabs)
374-374: Hard tabs
Column: 1
(MD010, no-hard-tabs)
392-392: Hard tabs
Column: 1
(MD010, no-hard-tabs)
393-393: Hard tabs
Column: 1
(MD010, no-hard-tabs)
397-397: Hard tabs
Column: 1
(MD010, no-hard-tabs)
406-406: Bare URL used
(MD034, no-bare-urls)
🔇 Additional comments (1)
udfs/index.md (1)
230-266: Verify that helper functions are defined before use in jaccard example.The
jaccardfunction (lines 255–266) callsunion()andintersection()which are defined in the preceding code block (lines 237–249). Ensure both UDF libraries are loaded in the correct order and that the example clearly documents this dependency.Verification notes
Looking at the example flow:
- Lines 237–249:
unionandintersectionare defined in acollection.jsscript and registered withfalkor.register().- Lines 254–266:
jaccardis defined in a separatesimilarity.jsscript but callsunion()andintersection().- Lines 316–317: Both libraries are loaded in sequence:
load_script("collection", "./collection.js")thenload_script("similarity", "./similarity.js").Issue: The example does not clarify whether
unionandintersectionare globally available across loaded UDF libraries, or if they must be within the same library. If they must be in the same file, thesimilarity.jscode will fail with a ReferenceError.Add a comment to clarify the scoping and cross-library function visibility, or refactor the example to ensure all functions are in the same library.
| ```javascript | ||
| function DFS_IncreasingAmounts(n, visited, total, reachables) { | ||
| // Add current node to visited to prevent infinite loops in cycles | ||
| visited.push(n.id); | ||
| for (const neighbor of n.getNeighbors()) { | ||
| // 1. Check if already visited | ||
| // 2. Logic: neighbor.amount must be GREATER than accumulated amount | ||
| if (visited.includes(neighbor.id) || neighbor.amount <= total) { | ||
| continue; | ||
| } | ||
| // Add to the list of discovered reachable nodes | ||
| reachables.push(neighbor); | ||
| // Recurse: add the neighbor's amount to the accumulated sum | ||
| DFS_IncreasingAmounts( | ||
| neighbor, | ||
| visited, | ||
| total + neighbor.amount, | ||
| reachables | ||
| ); | ||
| } | ||
| } | ||
| function CollectIncreasingAmounts(n) { | ||
| const visited = []; | ||
| const reachables = []; | ||
| DFS_IncreasingAmounts(n, visited, n.amount, reachables); | ||
| return reachables; | ||
| } | ||
| // Register function to be later used in a query | ||
| falkor.register('CollectIncreasingAmounts', CollectIncreasingAmounts); | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# First, find the file and check its existence
git ls-files | grep -i "udfs/index.md"Repository: FalkorDB/docs
Length of output: 70
🏁 Script executed:
# If found, let's read the relevant lines with tab visualization
# Use sed to show tabs as [TAB] and spaces as dots for clarity
head -n 400 udfs/index.md | tail -n +345 | cat -ARepository: FalkorDB/docs
Length of output: 1632
🏁 Script executed:
# Alternative approach: Use hexdump to see the exact bytes for critical lines
# Lines 345-381 and lines mentioned in review (374, 392-393, 397)
head -n 400 udfs/index.md | tail -n +370 | head -n 35 | od -c | grep -E "(TAB|t|space)"Repository: FalkorDB/docs
Length of output: 97
🏁 Script executed:
# Verify exact line numbers by counting lines in the file
wc -l udfs/index.mdRepository: FalkorDB/docs
Length of output: 74
🏁 Script executed:
# Get context around the specific lines mentioned to map them accurately
sed -n '345,410p' udfs/index.md | cat -n | grep -E "(^I|visited)" | head -20Repository: FalkorDB/docs
Length of output: 487
Replace hard tabs with spaces for consistent indentation.
Hard tabs appear in the JavaScript code (line 374) and Python section (lines 392–393, 397). Replace with spaces to match the surrounding indentation style. The visited array is correctly initialized and used throughout the DFS_IncreasingAmounts function.
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
374-374: Hard tabs
Column: 1
(MD010, no-hard-tabs)
🤖 Prompt for AI Agents
In udfs/index.md around lines 345 to 381 (and referenced Python sections around
lines 392–393 and 397), the code contains hard tab characters that break the
repository’s indentation consistency; replace every hard tab in these JavaScript
and Python snippets with the project’s standard spaces (e.g., 2 or 4 spaces as
used elsewhere) so all indentation aligns with surrounding lines, then verify
the file has no remaining tab characters and run a quick lint/format to ensure
consistent styling.
Reworded several sections for clarity and grammatical correctness, including examples and command specifications.
Added introductory information about the FLEX UDF package, including its features and contribution guidelines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (7)
udfs/index.md (7)
406-413: Format bare URL as Markdown link and fix hyphenation.Line 407 contains a bare URL that should be wrapped in Markdown link syntax per MD034, and "open source" should be hyphenated as "open-source" when used as an adjective.
🔎 Proposed fix
-Flex is FalkorDB's open source community UDF package available at https://github.com/FalkorDB/flex +Flex is FalkorDB's open-source community UDF package available at [https://github.com/FalkorDB/flex](https://github.com/FalkorDB/flex)Alternatively, for improved readability:
-Flex is FalkorDB's open source community UDF package available at https://github.com/FalkorDB/flex +Flex is FalkorDB's open-source community UDF package available at [the FLEX GitHub repository](https://github.com/FalkorDB/flex)
233-233: Fix typo in Jaccard formula denominator.The denominator notation is malformed:
|(A|should be|A|. The corrected formula should use standard set cardinality notation with parentheses for grouping.🔎 Proposed fix
-Jaccard's formula J(A,B) = |A ∩ B| / |A ∪ B| = |A ∩ B| / |(A| + |B| - |A ∩ B|) +Jaccard's formula J(A,B) = |A ∩ B| / |A ∪ B| = |A ∩ B| / (|A| + |B| - |A ∩ B|)
346-382: Replace hard tab with spaces in DFS_IncreasingAmounts function.Line 375 contains a hard tab for indentation. Replace with spaces (4 spaces) to maintain consistency with the rest of the codebase (MD010).
🔎 Proposed fix
function CollectIncreasingAmounts(n) { const visited = []; const reachables = []; - DFS_IncreasingAmounts(n, visited, n.amount, reachables); + DFS_IncreasingAmounts(n, visited, n.amount, reachables); return reachables; }
48-48: Fix syntax error: missing closing parenthesis in query string.Line 48 is missing a closing parenthesis in the Cypher query. The query string
"RETURN StringUtils.UpperCaseOdd('abcdef'"should be"RETURN StringUtils.UpperCaseOdd('abcdef')".🔎 Proposed fix
-s = graph.query("RETURN StringUtils.UpperCaseOdd('abcdef'").result_set[0][0] +s = graph.query("RETURN StringUtils.UpperCaseOdd('abcdef')").result_set[0][0]
61-94: Replace hard tabs with spaces for consistent code formatting.Lines 63, 67, 71, 76, and 84 contain hard tab characters for indentation, violating Markdown linting standards (MD010). Replace all leading tabs with 4 spaces to maintain consistent formatting.
🔎 Proposed fix
function ShapeType(shape) { - return shape.type; + return shape.type; } function Triangle() { - return {type: 'triangle', a:2, b:3, c:5}; + return {type: 'triangle', a:2, b:3, c:5}; } function RandomShape() { - return Triangle(); + return Triangle(); } function Area(shape) { if (ShapeType(shape) == 'triangle') { - return (shape.a * shape.b) / 2; + return (shape.a * shape.b) / 2; } else { throw new Error("Unsupported shape"); } } function Perimeter(shape) { if (ShapeType(shape) == 'triangle') { - return shape.a + shape.b + shape.c; + return shape.a + shape.b + shape.c; } else { throw new Error("Unsupported shape"); } }
223-228: Replace hard tabs with spaces in path stringify example.Lines 226 and 227 contain hard tabs. Replace with spaces for consistent Markdown formatting (MD010).
🔎 Proposed fix
function stringify_path(p) { return "nodes: " + p.nodes + - "length: " + p.length + - "relationships: " + p.relationships; + "length: " + p.length + + "relationships: " + p.relationships; }
205-213: Replace hard tabs with spaces in edge stringify example.Lines 208, 209, 210, and 211 contain hard tabs. Replace with spaces for consistent Markdown formatting (MD010).
🔎 Proposed fix
function stringify_edge(e) { return "id: " + e.id + - " type: " + e.type + - " startNode: " + e.startNode.id + - " endNode: " + e.endNode.id + - " attributes: " + JSON.stringify(e.attributes); + " type: " + e.type + + " startNode: " + e.startNode.id + + " endNode: " + e.endNode.id + + " attributes: " + JSON.stringify(e.attributes); }
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
udfs/index.md
🧰 Additional context used
🪛 LanguageTool
udfs/index.md
[style] ~14-~14: Consider a more concise word here.
Context: ... use them within FalkorDB. ## Example In order to introduce UDFs, please review the follo...
(IN_ORDER_TO_PREMIUM)
[grammar] ~407-~407: Use a hyphen to join words.
Context: ...}") ``` ## FLEX Flex is FalkorDB's open source community UDF package available a...
(QB_NEW_EN_HYPHEN)
[style] ~408-~408: Consider using a more concise synonym.
Context: ...://github.com/FalkorDB/flex It contains a variety of useful functionality like: 1. String an...
(A_VARIETY_OF)
🪛 markdownlint-cli2 (0.18.1)
udfs/index.md
63-63: Hard tabs
Column: 1
(MD010, no-hard-tabs)
67-67: Hard tabs
Column: 1
(MD010, no-hard-tabs)
71-71: Hard tabs
Column: 1
(MD010, no-hard-tabs)
76-76: Hard tabs
Column: 1
(MD010, no-hard-tabs)
84-84: Hard tabs
Column: 1
(MD010, no-hard-tabs)
208-208: Hard tabs
Column: 1
(MD010, no-hard-tabs)
209-209: Hard tabs
Column: 1
(MD010, no-hard-tabs)
210-210: Hard tabs
Column: 1
(MD010, no-hard-tabs)
211-211: Hard tabs
Column: 1
(MD010, no-hard-tabs)
226-226: Hard tabs
Column: 1
(MD010, no-hard-tabs)
227-227: Hard tabs
Column: 1
(MD010, no-hard-tabs)
375-375: Hard tabs
Column: 1
(MD010, no-hard-tabs)
393-393: Hard tabs
Column: 1
(MD010, no-hard-tabs)
394-394: Hard tabs
Column: 1
(MD010, no-hard-tabs)
398-398: Hard tabs
Column: 1
(MD010, no-hard-tabs)
407-407: Bare URL used
(MD034, no-bare-urls)
🔇 Additional comments (3)
udfs/index.md (3)
238-267: Code structure for Jaccard similarity is correct.The union and intersection helper functions are properly defined before being used in the jaccard function. This resolves the ReferenceError issue from previous reviews.
273-322: Jaccard similarity workflow example is well-structured.The Python code demonstrates a complete, executable workflow for loading UDF scripts, constructing a test graph, and computing similarity metrics. The example is pedagogically clear and correct.
415-416: Clear statement of UDF limitations.The limitations section accurately documents the current constraint that UDFs cannot modify the graph. This is important for setting user expectations.
| ```python | ||
| from falkordb import FalkorDB | ||
| db = FalkorDB() | ||
| g = db.select_graph("G") | ||
| # Load UDF | ||
| with open("./traversals.js", "r") as f: | ||
| content = f.read() | ||
| db.udf_load("Traversals", content, True) | ||
| # Use our custom traversal to find relevant reachable nodes | ||
| q = """MATCH (n:Transaction) | ||
| WHERE n.id = 12 | ||
| RETURN Traversals.CollectIncreasingAmounts(n)""" | ||
| reachables = g.query(q).result_set[0][0] | ||
| for node in reachables: | ||
| print(f"Node ID: {node.id}, Amount: {node.properties.get('amount')}") | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace hard tabs with spaces in Python traversal example.
Lines 393, 394, and 398 contain hard tabs. Replace with spaces for consistent Markdown formatting (MD010).
🔎 Proposed fix
# Load UDF
with open("./traversals.js", "r") as f:
- content = f.read()
- db.udf_load("Traversals", content, True)
+ content = f.read()
+ db.udf_load("Traversals", content, True)
# Use our custom traversal to find relevant reachable nodes
q = """MATCH (n:Transaction)
- WHERE n.id = 12
+ WHERE n.id = 12
RETURN Traversals.CollectIncreasingAmounts(n)"""🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
393-393: Hard tabs
Column: 1
(MD010, no-hard-tabs)
394-394: Hard tabs
Column: 1
(MD010, no-hard-tabs)
398-398: Hard tabs
Column: 1
(MD010, no-hard-tabs)
🤖 Prompt for AI Agents
In udfs/index.md around lines 385 to 404 (specifically lines 393, 394 and 398)
the Python example uses hard tabs for indentation which breaks Markdown lint
rule MD010; replace those hard tab characters with spaces (use consistent
indentation, e.g., 4 spaces per indent level) for the lines inside the code
block so the example formats correctly and passes the linter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
udfs/flex/index.md (2)
4-4: Simplify wordy phrasing."It contains a variety of useful functionality like:" is unnecessarily verbose. Consider a more concise alternative.
🔎 Proposed fix
-It contains a variety of useful functionality like: +It offers:
6-9: Add bullet point formatting to list items.Lines 6–9 describe FLEX features but lack proper bullet point syntax, making the list structure unclear. These should be formatted as markdown list items.
🔎 Proposed fix
-String and set similarity metrics for fuzzy matching and comparison. -Date and time manipulation, formatting, and parsing. -Low-level bitwise operations on integers. -We'll be happy to receive contributions and extend this library to accommodate additional functionality. +- String and set similarity metrics for fuzzy matching and comparison. +- Date and time manipulation, formatting, and parsing. +- Low-level bitwise operations on integers. +- We're happy to receive contributions and extend this library to accommodate additional functionality.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
udfs/flex/index.md
🧰 Additional context used
🪛 LanguageTool
udfs/flex/index.md
[grammar] ~3-~3: Use a hyphen to join words.
Context: ...ction Reference Flex is FalkorDB's open source community UDF package available a...
(QB_NEW_EN_HYPHEN)
[style] ~4-~4: Consider using a more concise synonym.
Context: ...//github.com/FalkorDB/flex It contains a variety of useful functionality like: String and ...
(A_VARIETY_OF)
🪛 markdownlint-cli2 (0.18.1)
udfs/flex/index.md
3-3: Bare URL used
(MD034, no-bare-urls)
🔇 Additional comments (2)
udfs/flex/index.md (2)
105-128: Excellent organization and content coverage.The "Common Use Cases" section effectively ties FLEX functions to practical real-world scenarios, helping users understand when and why to use each function category. The function categorization and descriptions are clear and well-structured.
13-104: All referenced function documentation files are present and valid.Verification confirms that all 42 function documentation files referenced in the markdown tables (lines 13-104) exist in the repository. No missing files detected.
udfs/flex/index.md
Outdated
| @@ -0,0 +1,129 @@ | |||
| # FLEX Function Reference | |||
|
|
|||
| Flex is FalkorDB's open source community UDF package available at https://github.com/FalkorDB/flex | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrap bare URL in markdown link syntax and hyphenate compound adjective.
Line 3 contains a bare URL which violates markdown conventions. Additionally, "open source" should be hyphenated as "open-source" when used as a compound adjective before a noun.
🔎 Proposed fix
-Flex is FalkorDB's open source community UDF package available at https://github.com/FalkorDB/flex
+Flex is FalkorDB's [open-source community UDF package](https://github.com/FalkorDB/flex).📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Flex is FalkorDB's open source community UDF package available at https://github.com/FalkorDB/flex | |
| Flex is FalkorDB's [open-source community UDF package](https://github.com/FalkorDB/flex). |
🧰 Tools
🪛 LanguageTool
[grammar] ~3-~3: Use a hyphen to join words.
Context: ...ction Reference Flex is FalkorDB's open source community UDF package available a...
(QB_NEW_EN_HYPHEN)
🪛 markdownlint-cli2 (0.18.1)
3-3: Bare URL used
(MD034, no-bare-urls)
🤖 Prompt for AI Agents
In udfs/flex/index.md around line 3, the sentence contains a bare URL and uses
"open source" as a compound adjective; update the line to hyphenate
"open-source" and wrap the URL in markdown link syntax (e.g.,
[Flex](https://github.com/FalkorDB/flex) or similar) so the sentence reads with
the compound adjective and the URL as a proper markdown link.
add mising closing brace Co-authored-by: typo-app[bot] <139475626+typo-app[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (3)
udfs/index.md (3)
407-407: Wrap bare URL in markdown link syntax and fix hyphenation.Line 407 contains a bare URL and unhyphenated adjective phrase. Update to:
-Flex is FalkorDB's open source community UDF package available at https://github.com/FalkorDB/flex +Flex is FalkorDB's open-source community UDF package available at [https://github.com/FalkorDB/flex](https://github.com/FalkorDB/flex)
233-233: Fix typo in Jaccard formula.Line 233 contains a typo in the denominator:
|(A|should be|A|. Update the formula notation for clarity:-Jaccard's formula J(A,B) = |A ∩ B| / |A ∪ B| = |A ∩ B| / |(A| + |B| - |A ∩ B|) +Jaccard's formula J(A,B) = |A ∩ B| / |A ∪ B| = |A ∩ B| / (|A| + |B| - |A ∩ B|)
256-267: Defineunionandintersectionfunctions in similarity.js or provide alternate implementation.The
jaccardfunction (lines 256–267) callsunionandintersectionwithout defining or importing them. Although both libraries are loaded in the usage example (lines 317–318), each UDF library script executes in its own scope, so these functions will not be available tojaccard, causing a ReferenceError at runtime.Either move the helper functions into similarity.js or rewrite
jaccardto inline the logic:🔎 Option 1: Define helpers in similarity.js
+function union(a, b) { + return [...new Set([...a, ...b])]; +} + +function intersection(a, b) { + const setB = new Set(b); + return a.filter(x => setB.has(x)); +} + function jaccard(a, b) { const aIds = a.getNeighbors().map(x => x.id); const bIds = b.getNeighbors().map(x => x.id);🔎 Option 2: Inline the logic
function jaccard(a, b) { const aIds = a.getNeighbors().map(x => x.id); const bIds = b.getNeighbors().map(x => x.id); - - const unionSize = union(aIds, bIds).length; - const intersectionSize = intersection(aIds, bIds).length; + + const unionSet = new Set([...aIds, ...bIds]); + const intersectionSet = aIds.filter(x => new Set(bIds).has(x)); + const unionSize = unionSet.size; + const intersectionSize = intersectionSet.length;
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
udfs/index.md
🧰 Additional context used
🪛 LanguageTool
udfs/index.md
[style] ~14-~14: Consider a more concise word here.
Context: ... use them within FalkorDB. ## Example In order to introduce UDFs, please review the follo...
(IN_ORDER_TO_PREMIUM)
[grammar] ~407-~407: Use a hyphen to join words.
Context: ...}") ``` ## FLEX Flex is FalkorDB's open source community UDF package available a...
(QB_NEW_EN_HYPHEN)
[style] ~408-~408: Consider using a more concise synonym.
Context: ...://github.com/FalkorDB/flex It contains a variety of useful functionality like: 1. String an...
(A_VARIETY_OF)
🪛 markdownlint-cli2 (0.18.1)
udfs/index.md
63-63: Hard tabs
Column: 1
(MD010, no-hard-tabs)
67-67: Hard tabs
Column: 1
(MD010, no-hard-tabs)
71-71: Hard tabs
Column: 1
(MD010, no-hard-tabs)
76-76: Hard tabs
Column: 1
(MD010, no-hard-tabs)
84-84: Hard tabs
Column: 1
(MD010, no-hard-tabs)
208-208: Hard tabs
Column: 1
(MD010, no-hard-tabs)
209-209: Hard tabs
Column: 1
(MD010, no-hard-tabs)
210-210: Hard tabs
Column: 1
(MD010, no-hard-tabs)
211-211: Hard tabs
Column: 1
(MD010, no-hard-tabs)
226-226: Hard tabs
Column: 1
(MD010, no-hard-tabs)
227-227: Hard tabs
Column: 1
(MD010, no-hard-tabs)
375-375: Hard tabs
Column: 1
(MD010, no-hard-tabs)
393-393: Hard tabs
Column: 1
(MD010, no-hard-tabs)
394-394: Hard tabs
Column: 1
(MD010, no-hard-tabs)
398-398: Hard tabs
Column: 1
(MD010, no-hard-tabs)
407-407: Bare URL used
(MD034, no-bare-urls)
| function ShapeType(shape) { | ||
| return shape.type; | ||
| } | ||
|
|
||
| function Triangle() { | ||
| return {type: 'triangle', a:2, b:3, c:5}; | ||
| } | ||
|
|
||
| function RandomShape() { | ||
| return Triangle(); | ||
| } | ||
|
|
||
| function Area(shape) { | ||
| if (ShapeType(shape) == 'triangle') { | ||
| return (shape.a * shape.b) / 2; | ||
| } else { | ||
| throw new Error("Unsupported shape"); | ||
| } | ||
| } | ||
|
|
||
| function Perimeter(shape) { | ||
| if (ShapeType(shape) == 'triangle') { | ||
| return shape.a + shape.b + shape.c; | ||
| } else { | ||
| throw new Error("Unsupported shape"); | ||
| } | ||
| } | ||
|
|
||
| // Expose functions | ||
| falkor.register('Area', Area); | ||
| falkor.register('Perimeter', Perimeter); | ||
| falkor.register('RandomShape', RandomShape); | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify the presence of hard tabs in udfs/index.md
# Check if file exists and get basic info
if [ -f ./udfs/index.md ]; then
echo "=== File Info ==="
wc -l ./udfs/index.md
echo ""
else
echo "File not found: ./udfs/index.md"
exit 1
fi
# Find all lines with hard tabs (explicit tab character)
echo "=== Lines with hard tabs ==="
grep -n $'\t' ./udfs/index.md
echo ""
echo "=== Total lines with hard tabs ==="
grep -c $'\t' ./udfs/index.md || echo "0"Repository: FalkorDB/docs
Length of output: 725
Replace hard tabs with spaces in code blocks.
Code blocks contain hard tab characters for indentation, violating Markdown linting rule MD010. Lines 63, 67, 71, 76, 84, 208–211, 226–227, 375, 393–394, and 398 use tabs instead of spaces. Replace all leading tabs with spaces (use 4 spaces per indentation level) for consistency.
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
63-63: Hard tabs
Column: 1
(MD010, no-hard-tabs)
67-67: Hard tabs
Column: 1
(MD010, no-hard-tabs)
71-71: Hard tabs
Column: 1
(MD010, no-hard-tabs)
76-76: Hard tabs
Column: 1
(MD010, no-hard-tabs)
84-84: Hard tabs
Column: 1
(MD010, no-hard-tabs)
🤖 Prompt for AI Agents
In udfs/index.md around lines 62 to 94 (and also the other reported lines: 63,
67, 71, 76, 84, 208–211, 226–227, 375, 393–394, 398), the code block uses hard
tab characters for indentation which violates MD010; replace every leading tab
in those code blocks with spaces (use 4 spaces per indentation level), ensure
indentation is consistent across the entire block, and re-save the file without
tabs so Markdown linting passes.
Corrected grammatical errors and improved clarity in the UDFs documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (3)
udfs/index.md (3)
407-407: Wrap the bare URL in Markdown link syntax (MD034 violation) and hyphenate "open source".Line 407 contains a bare URL and uses the unhyphenated phrase "open source" which should be "open-source" as a compound adjective.
🔎 Proposed fix
-Flex is FalkorDB's open source community UDF package available at https://github.com/FalkorDB/flex +Flex is FalkorDB's open-source community UDF package available at [https://github.com/FalkorDB/flex](https://github.com/FalkorDB/flex)
233-233: Fix typo in Jaccard formula denominator.Line 233 contains a typo:
|(A|should be|A|.🔎 Proposed fix
-Jaccard's formula J(A,B) = |A ∩ B| / |A ∪ B| = |A ∩ B| / |(A| + |B| - |A ∩ B|) +Jaccard's formula J(A,B) = |A ∩ B| / |A ∪ B| = |A ∩ B| / (|A| + |B| - |A ∩ B|)(Also simplified notation: used parentheses instead of pipes for clarity.)
74-79: Fix theAreafunction: it references an undefined propertyshape.height.The
Triangleobject (line 66-68) only has propertiesa,b, andc. TheAreafunction should compute the triangle area using these properties, notshape.height.🔎 Proposed fix
function Area(shape) { if (ShapeType(shape) == 'triangle') { - return (shape.a * shape.b) / 2; + return (shape.a * shape.b) / 2; // Already correct; ensure shape.height is not referenced elsewhere } else { throw new Error("Unsupported shape"); } }The formula
(a * b) / 2is already correct for the triangle area. Remove any reference toshape.heightthat may exist in the actual implementation.
🧹 Nitpick comments (2)
udfs/index.md (2)
14-14: Simplify the phrasing in the introduction.The phrase "In order to introduce UDFs, please review the following" is slightly verbose. Consider a more direct opening like "To introduce UDFs, review the following example" or simply "Here's a complete example introducing UDFs".
408-408: Reduce verbosity in the description of Flex functionality.The phrase "a variety of useful functionality" could be more concise (e.g., "useful functionality" or "key features"). This is a minor style improvement.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
udfs/index.md
🧰 Additional context used
🪛 LanguageTool
udfs/index.md
[style] ~14-~14: Consider a more concise word here.
Context: ... use them within FalkorDB. ## Example In order to introduce UDFs, please review the follo...
(IN_ORDER_TO_PREMIUM)
[grammar] ~407-~407: Use a hyphen to join words.
Context: ...}") ``` ## FLEX Flex is FalkorDB's open source community UDF package available a...
(QB_NEW_EN_HYPHEN)
[style] ~408-~408: Consider using a more concise synonym.
Context: ...://github.com/FalkorDB/flex It contains a variety of useful functionality like: 1. String an...
(A_VARIETY_OF)
🪛 markdownlint-cli2 (0.18.1)
udfs/index.md
63-63: Hard tabs
Column: 1
(MD010, no-hard-tabs)
67-67: Hard tabs
Column: 1
(MD010, no-hard-tabs)
71-71: Hard tabs
Column: 1
(MD010, no-hard-tabs)
76-76: Hard tabs
Column: 1
(MD010, no-hard-tabs)
84-84: Hard tabs
Column: 1
(MD010, no-hard-tabs)
208-208: Hard tabs
Column: 1
(MD010, no-hard-tabs)
209-209: Hard tabs
Column: 1
(MD010, no-hard-tabs)
210-210: Hard tabs
Column: 1
(MD010, no-hard-tabs)
211-211: Hard tabs
Column: 1
(MD010, no-hard-tabs)
226-226: Hard tabs
Column: 1
(MD010, no-hard-tabs)
227-227: Hard tabs
Column: 1
(MD010, no-hard-tabs)
375-375: Hard tabs
Column: 1
(MD010, no-hard-tabs)
393-393: Hard tabs
Column: 1
(MD010, no-hard-tabs)
394-394: Hard tabs
Column: 1
(MD010, no-hard-tabs)
398-398: Hard tabs
Column: 1
(MD010, no-hard-tabs)
407-407: Bare URL used
(MD034, no-bare-urls)
🔇 Additional comments (1)
udfs/index.md (1)
256-267: The documentation already clarifies how these dependencies are resolved. At line 269, the text explicitly states: "As you'll noticejaccarduses bothunionandintersectionfromcollection.js", and the loading mechanism (lines 317-318) shows bothcollection.jsandsimilarity.jsare loaded sequentially into the same FalkorDB execution context viaload_script(). Sinceunionandintersectionare registered globally viafalkor.register()beforesimilarity.jsis loaded, the code will not fail with aReferenceError. No changes are required.
|
|
||
| ```javascript | ||
| function ShapeType(shape) { | ||
| return shape.type; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace hard tabs with spaces throughout the file (MD010 linting violation).
Multiple code blocks use hard tab characters for indentation instead of spaces. This violates Markdown linting rule MD010 and creates inconsistent formatting. Replace all leading tabs with 4 spaces per indentation level.
Affected lines: 63, 67, 71, 76, 84, 208–211, 226–227, 375, 393–394, 398.
🔎 Example fix (JavaScript block, lines 62–94)
function ShapeType(shape) {
- return shape.type;
+ return shape.type;
}
function Triangle() {
- return {type: 'triangle', a:2, b:3, c:5};
+ return {type: 'triangle', a:2, b:3, c:5};
}
function RandomShape() {
- return Triangle();
+ return Triangle();
}
function Area(shape) {
if (ShapeType(shape) == 'triangle') {
- return (shape.a * shape.b) / 2;
+ return (shape.a * shape.b) / 2;
} else {
throw new Error("Unsupported shape");
}
}Apply the same conversion to all remaining blocks at the specified lines.
Also applies to: 67-67, 71-71, 76-76, 84-84, 208-211, 226-227, 375-375, 393-394, 398-398
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
63-63: Hard tabs
Column: 1
(MD010, no-hard-tabs)
🤖 Prompt for AI Agents
In udfs/index.md around lines 63, 67, 71, 76, 84, 208–211, 226–227, 375,
393–394, and 398, replace all leading hard tab characters with spaces (use 4
spaces per indentation level) in every code block and indented line; update the
example block at 62–94 accordingly and scan the whole file to convert any
remaining tabs to spaces so the file no longer violates MD010.
Updated wording for clarity and consistency in UDF documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (1)
udfs/index.md (1)
408-408: Hyphenate "open-source" (compound adjective).Line 408 uses "open source" as a compound adjective before a noun, which should be hyphenated as "open-source".
-FLEX is FalkorDB's open source community UDF package, available at [github.com/FalkorDB/flex](https://github.com/FalkorDB/flex). +FLEX is FalkorDB's open-source community UDF package, available at [github.com/FalkorDB/flex](https://github.com/FalkorDB/flex).
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
udfs/index.md
🧰 Additional context used
🪛 LanguageTool
udfs/index.md
[style] ~14-~14: Consider a more concise word here.
Context: ... use them within FalkorDB. ## Example In order to introduce UDFs, please review the follo...
(IN_ORDER_TO_PREMIUM)
[grammar] ~408-~408: Use a hyphen to join words.
Context: ...") ``` ## FLEX FLEX is FalkorDB's open source community UDF package, available ...
(QB_NEW_EN_HYPHEN)
[style] ~409-~409: Consider using a more concise synonym.
Context: ...ithub.com/FalkorDB/flex). It contains a variety of useful functionality, including: 1. St...
(A_VARIETY_OF)
🪛 markdownlint-cli2 (0.18.1)
udfs/index.md
63-63: Hard tabs
Column: 1
(MD010, no-hard-tabs)
67-67: Hard tabs
Column: 1
(MD010, no-hard-tabs)
71-71: Hard tabs
Column: 1
(MD010, no-hard-tabs)
76-76: Hard tabs
Column: 1
(MD010, no-hard-tabs)
84-84: Hard tabs
Column: 1
(MD010, no-hard-tabs)
206-206: Hard tabs
Column: 1
(MD010, no-hard-tabs)
207-207: Hard tabs
Column: 1
(MD010, no-hard-tabs)
208-208: Hard tabs
Column: 1
(MD010, no-hard-tabs)
209-209: Hard tabs
Column: 1
(MD010, no-hard-tabs)
224-224: Hard tabs
Column: 1
(MD010, no-hard-tabs)
225-225: Hard tabs
Column: 1
(MD010, no-hard-tabs)
375-375: Hard tabs
Column: 1
(MD010, no-hard-tabs)
393-393: Hard tabs
Column: 1
(MD010, no-hard-tabs)
394-394: Hard tabs
Column: 1
(MD010, no-hard-tabs)
398-398: Hard tabs
Column: 1
(MD010, no-hard-tabs)
| `pow` - computes v^x | ||
| `trim` - removes leading and trailing spaces. | ||
|
|
||
| These are baked into the DB and are part of its source code, introducing a new function e.g. `UpperCaseOdd`isn't always trivial, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add space after backtick before word.
Line 8 is missing a space between the code formatting and the following word: UpperCaseOddisn't should be UpperCaseOdd isn't.
-These are baked into the DB and are part of its source code, introducing a new function e.g. `UpperCaseOdd`isn't always trivial,
+These are baked into the DB and are part of its source code, introducing a new function e.g. `UpperCaseOdd` isn't always trivial,🤖 Prompt for AI Agents
In udfs/index.md around line 8, there's no space between the closing backtick
and the following word: change "`UpperCaseOdd`isn't" to "`UpperCaseOdd` isn't"
by inserting a single space after the closing backtick so the markdown renders
correctly.
| return shape.type; | ||
| } | ||
|
|
||
| function Triangle() { | ||
| return {type: 'triangle', a:2, b:3, c:5}; | ||
| } | ||
|
|
||
| function RandomShape() { | ||
| return Triangle(); | ||
| } | ||
|
|
||
| function Area(shape) { | ||
| if (ShapeType(shape) == 'triangle') { | ||
| return (shape.a * shape.b) / 2; | ||
| } else { | ||
| throw new Error("Unsupported shape"); | ||
| } | ||
| } | ||
|
|
||
| function Perimeter(shape) { | ||
| if (ShapeType(shape) == 'triangle') { | ||
| return shape.a + shape.b + shape.c; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace all hard tabs with spaces throughout code blocks (MD010 violation).
Code blocks contain hard tab characters for indentation instead of spaces, violating Markdown linting rule MD010. This affects 15 lines across multiple blocks. Replace all leading tabs with 4 spaces per indentation level for consistency.
Affected lines: 63, 67, 71, 76, 84 (Shapes block), 206-209 (stringify_edge), 224-225 (stringify_path), 375 (DFS call), 393-394, 398 (Python block).
🔎 Example fixes
For the JavaScript shapes block (lines 62-94):
function ShapeType(shape) {
- return shape.type;
+ return shape.type;
}
function Triangle() {
- return {type: 'triangle', a:2, b:3, c:5};
+ return {type: 'triangle', a:2, b:3, c:5};
}
function RandomShape() {
- return Triangle();
+ return Triangle();
}
function Area(shape) {
if (ShapeType(shape) == 'triangle') {
- return (shape.a * shape.b) / 2;
+ return (shape.a * shape.b) / 2;
} else {
throw new Error("Unsupported shape");
}
}
function Perimeter(shape) {
if (ShapeType(shape) == 'triangle') {
- return shape.a + shape.b + shape.c;
+ return shape.a + shape.b + shape.c;
} else {
throw new Error("Unsupported shape");
}
}For the Python block (lines 385-404):
# Load UDF
with open("./traversals.js", "r") as f:
- content = f.read()
- db.udf_load("Traversals", content, True)
+ content = f.read()
+ db.udf_load("Traversals", content, True)
# Use our custom traversal to find relevant reachable nodes
q = """MATCH (n:Transaction)
- WHERE n.id = 12
+ WHERE n.id = 12
RETURN Traversals.CollectIncreasingAmounts(n)"""Apply the same 4-space replacement to lines 206-209 (stringify_edge), 224-225 (stringify_path), and 375 (DFS call).
Also applies to: 206-209, 224-225, 375-375, 393-398
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
63-63: Hard tabs
Column: 1
(MD010, no-hard-tabs)
67-67: Hard tabs
Column: 1
(MD010, no-hard-tabs)
71-71: Hard tabs
Column: 1
(MD010, no-hard-tabs)
76-76: Hard tabs
Column: 1
(MD010, no-hard-tabs)
84-84: Hard tabs
Column: 1
(MD010, no-hard-tabs)
🤖 Prompt for AI Agents
In udfs/index.md around lines 63-84 and additionally lines 206-209, 224-225,
375, 393-398, replace all hard tab characters used for indentation inside the
code blocks with spaces (use 4 spaces per indentation level). Ensure you only
convert leading tab characters used for indentation (not tabs inside string
literals) across the affected JavaScript and Python blocks so indentation
remains consistent and MD010 is resolved; update each affected line accordingly
and run the markdown linter to verify no remaining hard tabs.
Updated the introduction and formatting in the FLEX Function Reference documentation.
Updated the supported format patterns for the 'pattern' parameter in the date parsing documentation.
Co-Authored-By: Warp <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
.wordlist.txt (1)
689-692: StringUtils remains out of alphabetical order—move to 'S' section.This issue was previously flagged and remains unresolved. The entry "StringUtils" (line 691) should be relocated to the 'S' section (around line 281–288, after "str" and before "strList") to maintain alphabetical order. The entries "UDF" and "UDFs" are correctly positioned.
🔎 Proposed fix
Remove from current location:
UDF UDFs - StringUtils UpperCaseOddInsert in the 'S' section (around line 281):
stopwords str + StringUtils strList
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.wordlist.txtudfs/flex/date/toTimeZone.mdudfs/flex/index.md
🚧 Files skipped from review as they are similar to previous changes (1)
- udfs/flex/date/toTimeZone.md
🧰 Additional context used
🪛 LanguageTool
.wordlist.txt
[uncategorized] ~694-~694: Ger doublet «jaccard Jaccard».
Context: ...ils UpperCaseOdd unparseable toTimeZone jaccard Jaccard levenshtein submap Submap removeKeys re...
(GER_DOUBLET)
[uncategorized] ~697-~697: Ger doublet «submap Submap».
Context: ... toTimeZone jaccard Jaccard levenshtein submap Submap removeKeys removeKey fromPairs fromJson...
(GER_DOUBLET)
[uncategorized] ~705-~705: Ger doublet «bitwise Bitwise».
Context: ...omPairs fromJsonList fromJsonMap toJson bitwise Bitwise Jaro PascalCase UpperCamelCase Winkler ...
(GER_DOUBLET)
[uncategorized] ~722-~722: Ger doublet «Deduplication deduplication».
Context: ...ups rpad snakeCase swapCase Deduplicate Deduplication deduplication sanitization sprintf fullMatch abc uppe...
(GER_DOUBLET)
udfs/flex/index.md
[grammar] ~3-~3: Use a hyphen to join words.
Context: ...ction Reference FLEX is FalkorDB's open source community UDF package, available ...
(QB_NEW_EN_HYPHEN)
[style] ~4-~4: Consider using a more concise synonym.
Context: ...ithub.com/FalkorDB/flex). It contains a variety of useful functionality, including: - Str...
(A_VARIETY_OF)
🔇 Additional comments (2)
udfs/flex/index.md (1)
106-130: Well-structured common use cases.The practical use case section effectively demonstrates where each function category applies. The organization by use case (data cleaning, fuzzy matching, aggregation, etc.) provides users with alternative navigation beyond the namespace structure.
.wordlist.txt (1)
693-731: Remaining wordlist entries are well-placed and relevant.The new UDF-related terminology entries (function names, concepts, and variants) appropriately reflect the expanded documentation scope. The case variants (e.g.,
jaccard/Jaccard,bitwise/Bitwise) are intentional and legitimate for capturing function name styles and documentation terms. Static analysis doublet warnings are false positives in this context.
| FLEX is FalkorDB's open source community UDF package, available at [github.com/FalkorDB/flex](https://github.com/FalkorDB/flex). | ||
| It contains a variety of useful functionality, including: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix compound adjective hyphenation and consider more concise phrasing.
Line 3 uses "open source" as a compound adjective before the noun "community UDF package" and should be hyphenated as "open-source". Additionally, line 4's phrase "a variety of useful functionality" could be more concise (e.g., "offers useful functionality for" or "includes").
🔎 Proposed fix
-FLEX is FalkorDB's open source community UDF package, available at [github.com/FalkorDB/flex](https://github.com/FalkorDB/flex).
-It contains a variety of useful functionality, including:
+FLEX is FalkorDB's open-source community UDF package, available at [github.com/FalkorDB/flex](https://github.com/FalkorDB/flex).
+It offers useful functionality, including:📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| FLEX is FalkorDB's open source community UDF package, available at [github.com/FalkorDB/flex](https://github.com/FalkorDB/flex). | |
| It contains a variety of useful functionality, including: | |
| FLEX is FalkorDB's open-source community UDF package, available at [github.com/FalkorDB/flex](https://github.com/FalkorDB/flex). | |
| It offers useful functionality, including: |
🧰 Tools
🪛 LanguageTool
[grammar] ~3-~3: Use a hyphen to join words.
Context: ...ction Reference FLEX is FalkorDB's open source community UDF package, available ...
(QB_NEW_EN_HYPHEN)
[style] ~4-~4: Consider using a more concise synonym.
Context: ...ithub.com/FalkorDB/flex). It contains a variety of useful functionality, including: - Str...
(A_VARIETY_OF)
🤖 Prompt for AI Agents
In udfs/flex/index.md around lines 3 to 4, change the phrase "open source
community UDF package" to "open-source community UDF package" to correct
compound-adjective hyphenation, and replace "It contains a variety of useful
functionality, including:" with a more concise phrasing such as "It includes
useful functionality, including:" (or "It offers useful functionality,
including:") to tighten the wording.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.
PR Summary by Typo
Overview
This PR introduces comprehensive documentation for User Defined Functions (UDFs) in FalkorDB, enabling users to extend the database's functionality with custom JavaScript functions. It details how to create, manage, and utilize UDFs within the FalkorDB environment.
Key Changes
udfs/udfs.mdcovering the concepts, usage, and management of UDFs.GRAPH.UDF LOAD,LIST,DELETE, andFLUSHcommands for UDF lifecycle management..wordlist.txtwith new terms related to UDFs.Work Breakdown
To turn off PR summary, please visit Notification settings.