scripts/fix-links.mjs dominates the risk profile of remoteintech/remote-jobs: all five top-ranked functions come from the link-management script, led by classifyRedirect with a cyclomatic complexity of 38. Across the full codebase of 70 analyzed functions, 6 are rated critical and 7 combine structural complexity with recent change, with the concentration of that risk heavily skewed toward redirect classification, reverification, CSV parsing, and parked-domain detection.
The table below ranks functions by activity-weighted risk — a score that multiplies structural complexity by recent commit frequency. A function that is both hard to understand (high cyclomatic complexity) and actively changing is a higher priority than one that is complex but untouched. CC = cyclomatic complexity (independent execution paths); ND = max nesting depth; FO = fan-out (distinct callees).
Top 5 Hotspots
| Function | File | Risk | CC | ND | FO |
|---|---|---|---|---|---|
classifyRedirect | scripts/fix-links.mjs | 18.7 | 38 | 2 | 9 |
classify | scripts/fix-links.mjs | 16.5 | 21 | 2 | 3 |
reverify | scripts/fix-links.mjs | 14.9 | 10 | 3 | 6 |
parseCsv | scripts/fix-links.mjs | 14.7 | 14 | 6 | 6 |
isParked | scripts/fix-links.mjs | 14.3 | 10 | 3 | 6 |
Hotspot Analysis
classifyRedirect — scripts/fix-links.mjs
Based on its name and file path, classifyRedirect likely inspects HTTP redirect responses and determines how each should be handled — deciding whether a link should be updated, skipped, flagged, or otherwise resolved. A cyclomatic complexity of 38 means there are 38 independent execution paths through this function, each one a potential bug surface and a required test case. Its fan-out of 9 and the neighbor_risk pattern signal that changes here are likely to require coordinated edits across nearby link-classification helpers.
Recommendation: Add characterization tests that cover the distinct redirect outcomes before making any further changes, then extract each classification branch into a named sub-function to bring the CC down toward a manageable range. The neighbor_risk pattern means you should audit the 9 callee functions for downstream assumptions before refactoring.
classify — scripts/fix-links.mjs
Also in scripts/fix-links.mjs, classify likely performs a broader categorization of link states — possibly acting as a dispatcher that delegates to classifyRedirect and other helpers. With a cyclomatic complexity of 21 and an exit_heavy pattern, it has numerous return paths, each of which must be independently tested to ensure coverage. Its fan-out of 3 is lower, but given that it likely orchestrates other classification logic, changes here carry outsized behavioral risk.
Recommendation: Map the multiple exit paths explicitly — a decision table or enumerated return-value type can make the branching contract visible — and enforce that each path has at least one test case before the next commit lands.
reverify — scripts/fix-links.mjs
reverify likely revisits previously classified links and decides whether their current state still matches the stored result. Its cyclomatic complexity of 10 is moderate, but the max nesting depth of 3 and fan-out of 6 suggest it coordinates network outcomes, stored metadata, and classification helpers from one place. Because it sits between link checking and data updates, mistakes here can either preserve stale link decisions or overwrite valid ones.
Recommendation: Add fixture-based tests for the main reverification outcomes: unchanged links, redirects, failures, and parked domains. Then split status fetching from classification decisions so the function can be tested without depending on live network behavior.
parseCsv — scripts/fix-links.mjs
parseCsv likely loads and normalizes the source data that drives link checks. Its cyclomatic complexity of 14 is not as high as the classification routines, but its max nesting depth of 6 is the deepest in the top five. That depth matters for data ingestion because malformed rows, escaped values, missing fields, and validation branches can become difficult to audit when nested together.
Recommendation: Separate tokenization, row validation, and normalization into named helpers. Use malformed CSV fixtures to cover the nested error paths before changing the parser structure.
isParked — scripts/fix-links.mjs
isParked likely detects parked domains so the link checker can distinguish dead or placeholder destinations from legitimate company pages. Its cyclomatic complexity of 10 and nesting depth of 3 show meaningful branching, while a fan-out of 6 indicates it depends on several helpers or pattern checks. Because parked-domain detection is heuristic, false positives can remove valid companies and false negatives can leave stale links in place.
Recommendation: Build a small fixture set of known parked and non-parked pages, then extract each heuristic into a named predicate. That makes it easier to add or remove parking signals without changing the whole detector at once.
Patterns Found
Antipatterns detected across the top functions in this snapshot:
| Pattern | Occurrences |
|---|---|
exit_heavy | 3 |
neighbor_risk | 1 |
complex_branching | 1 |
deeply_nested | 1 |
These labels belong to two tiers — Tier 1 (structural): complex_branching, deeply_nested, exit_heavy, long_function, god_function. Tier 2 (relational/temporal): hub_function, cyclic_hub, middle_man, neighbor_risk, stale_complex, churn_magnet, shotgun_target, volatile_god.
Key Takeaways
classifyRedirecthas CC 38; add characterization tests before changing redirect handling so each major outcome is pinned.parseCsvhas the deepest nesting in the top five at ND 6; malformed CSV fixtures should come before parser cleanup.- All five top hotspots live in
scripts/fix-links.mjs, so treat link checking as one refactoring unit rather than isolated functions.
Reproduce This Analysis
git clone https://github.com/remoteintech/remote-jobs
cd remote-jobs
git checkout fbbb50f2ab01b7996c55a9624d8f871bdbdc64d1
hotspots analyze . --mode snapshot --explain-patterns --force
To run the same analysis on your own codebase, run hotspots analyze . --mode snapshot in any local git repo — no configuration required.
Hotspots highlights structural and activity risk — not “bad code.” Findings are a prioritization aid, not a bug predictor. Editorial policy →