scip-query 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/{chunk-ECVXWZ4Q.js → chunk-27HMTUJE.js} +2 -2
- package/dist/{chunk-2LQWMYG4.js → chunk-27XEGMCT.js} +2 -2
- package/dist/{chunk-NKT5EMEX.js → chunk-2TPCIPYA.js} +2 -2
- package/dist/{chunk-ZOIPAYRP.js → chunk-2XRXEIRK.js} +2 -2
- package/dist/{chunk-Q3B3FNCU.js → chunk-3AMWF6V5.js} +2 -2
- package/dist/{chunk-BVNO67DB.js → chunk-3H5OSDF7.js} +2 -2
- package/dist/{chunk-D64L53WX.js → chunk-43GKP6LI.js} +2 -2
- package/dist/{chunk-F5BJSNU5.js → chunk-44P4SJFN.js} +2 -2
- package/dist/{chunk-T7VQG55Q.js → chunk-5JRMZMLM.js} +2 -2
- package/dist/{chunk-72MFTCU5.js → chunk-5VY3RIEI.js} +2 -2
- package/dist/{chunk-D7J6GZAG.js → chunk-6JUAGXR4.js} +2 -2
- package/dist/{chunk-NQ75OVUU.js → chunk-6KDOYKCB.js} +2 -2
- package/dist/chunk-6KMTPNZL.js +3 -0
- package/dist/{chunk-TTMKELT7.js → chunk-72FR7KEZ.js} +2 -2
- package/dist/{chunk-FXG3PHVW.js → chunk-7COVQPQQ.js} +6 -6
- package/dist/{chunk-MBKJ7GHT.js → chunk-7TVFPOD7.js} +2 -2
- package/dist/{chunk-M72ZFN6E.js → chunk-A6KSEIRN.js} +2 -2
- package/dist/{chunk-52Q4JFDW.js → chunk-AAMURYOK.js} +2 -2
- package/dist/{chunk-XEMQUN3Z.js → chunk-BP7S6V3M.js} +2 -2
- package/dist/{chunk-ETU2I5JM.js → chunk-BRBF3E5X.js} +2 -2
- package/dist/{chunk-V7CVBPWX.js → chunk-BUNDZ6K2.js} +2 -2
- package/dist/{chunk-NAH5EAZS.js → chunk-BZXE3HO4.js} +2 -2
- package/dist/{chunk-AZLKLZ5S.js → chunk-CXQQOXSI.js} +2 -2
- package/dist/{chunk-RIQED5OU.js → chunk-EDSD3VJK.js} +2 -2
- package/dist/chunk-EVZSAR3S.js +2 -0
- package/dist/{chunk-L2CX5GHZ.js → chunk-GMOEX7EV.js} +2 -2
- package/dist/{chunk-O3WDE26W.js → chunk-GUDKRIGW.js} +2 -2
- package/dist/{chunk-MKM7NBZK.js → chunk-GULVO6NF.js} +2 -2
- package/dist/{chunk-V3Z3IOWO.js → chunk-GY3HAWUA.js} +2 -2
- package/dist/{chunk-G2UBOONK.js → chunk-HV27H2V2.js} +2 -2
- package/dist/chunk-HZZQKNVE.js +2 -0
- package/dist/{chunk-T6NGEV5I.js → chunk-I4R3SNMR.js} +2 -2
- package/dist/{chunk-UAHZ57BR.js → chunk-IMQFJ53K.js} +2 -2
- package/dist/{chunk-NJJ7AS4F.js → chunk-IUSSGHJO.js} +2 -2
- package/dist/{chunk-OVMUVXKQ.js → chunk-JJUX2OAP.js} +2 -2
- package/dist/chunk-JZBGTSAB.js +13 -0
- package/dist/{chunk-YPKBZ77R.js → chunk-K5N5RNGM.js} +2 -2
- package/dist/{chunk-OSWF3HSF.js → chunk-K7SPOJHZ.js} +2 -2
- package/dist/{chunk-BCNT6ODA.js → chunk-KSJ544IV.js} +2 -2
- package/dist/{chunk-HSU3M25J.js → chunk-KYB7FPXT.js} +2 -2
- package/dist/{chunk-ORBRX2QJ.js → chunk-LY7NMOBW.js} +2 -2
- package/dist/{chunk-CW3KZ7UF.js → chunk-M7EEHYSU.js} +2 -2
- package/dist/{chunk-U7I373V4.js → chunk-N23FT4EZ.js} +2 -2
- package/dist/{chunk-ZRIOGL7F.js → chunk-N2OTJWC2.js} +2 -2
- package/dist/{chunk-PH7ZFK6L.js → chunk-NCVFKOLB.js} +2 -2
- package/dist/{chunk-2QGE5AEP.js → chunk-NOKUZU56.js} +2 -2
- package/dist/{chunk-BP2NAIAZ.js → chunk-OXTM2RX3.js} +2 -2
- package/dist/{chunk-RA5MTIOO.js → chunk-PEHDARNC.js} +2 -2
- package/dist/chunk-PESEPWZO.js +2 -0
- package/dist/{chunk-LFM3O5KX.js → chunk-PMY4UFGV.js} +2 -2
- package/dist/{chunk-H7NSJ7L2.js → chunk-Q7PWDXL5.js} +2 -2
- package/dist/{chunk-FBCOFKEC.js → chunk-QVGFVRKD.js} +2 -2
- package/dist/{chunk-Q7S2DADC.js → chunk-QYOPMTZ6.js} +2 -2
- package/dist/{chunk-VYF5HA76.js → chunk-QZOAOLLZ.js} +2 -2
- package/dist/{chunk-NLMRJ7SI.js → chunk-R7U2I55B.js} +2 -2
- package/dist/{chunk-64PRNLKP.js → chunk-RLB6SG25.js} +2 -2
- package/dist/{chunk-MJKJMWIM.js → chunk-SFDVBARK.js} +2 -2
- package/dist/{chunk-B4VYXRCQ.js → chunk-TYCZ7S4I.js} +2 -2
- package/dist/{chunk-4D54JIU3.js → chunk-U3VMUDXJ.js} +2 -2
- package/dist/chunk-UHPWZCYQ.js +3 -0
- package/dist/{chunk-OPE5YXFE.js → chunk-V5W7H7V4.js} +2 -2
- package/dist/{chunk-YDDGCJJG.js → chunk-WMO2VZZK.js} +2 -2
- package/dist/chunk-WPZPB42I.js +2 -0
- package/dist/{chunk-EXKLAEB4.js → chunk-X3DTIEMU.js} +2 -2
- package/dist/chunk-X5C43YVI.js +2 -0
- package/dist/{chunk-IRJDYTNZ.js → chunk-XC2PJOVM.js} +2 -2
- package/dist/{chunk-Z3IPJKJP.js → chunk-XDESMVOL.js} +2 -2
- package/dist/{chunk-KSUZS77X.js → chunk-XZBLZHXL.js} +2 -2
- package/dist/{chunk-7ITCOJGD.js → chunk-YQKECTPV.js} +2 -2
- package/dist/chunk-YTVKPJXW.js +2 -0
- package/dist/{chunk-75X52JTA.js → chunk-ZEO4CXQR.js} +2 -2
- package/dist/cli.js +256 -244
- package/dist/index.js +1 -1
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.d.ts +34 -0
- package/dist/queries/decorative-checkers.js +2 -0
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +3 -0
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.d.ts +33 -0
- package/dist/queries/not-implemented.js +2 -0
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.js +1 -1
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.d.ts +56 -0
- package/dist/queries/test-quality.js +2 -0
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.d.ts +23 -1
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/runtime.js +1 -1
- package/docs/COMMAND_REFERENCE.md +4 -1
- package/docs/analyzer-inventory.md +16 -0
- package/package.json +14 -2
- package/skills/_shared/SKILL.md +4 -1
- package/skills/scip-calibrate/SKILL.md +124 -0
- package/skills/scip-calibrate/agents/openai.yaml +4 -0
- package/skills/scip-integrity-audit/SKILL.md +32 -0
- package/skills/scip-tla-model-system/SKILL.md +7 -9
- package/dist/chunk-EDB7Y442.js +0 -2
- package/dist/chunk-EZ5WDZ2Q.js +0 -3
- package/dist/chunk-H2NMIZFD.js +0 -2
- package/dist/chunk-HXXMPYEF.js +0 -2
- package/dist/chunk-PXHPCWX5.js +0 -2
- package/dist/chunk-T2FQ4GHD.js +0 -9
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as m,c as d}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as m,c as d}from"./chunk-BZXE3HO4.js";import{a as $}from"./chunk-BP7S6V3M.js";function v(r,e={}){return P(r,e).cycles}function P(r,e={}){let{scope:s,maxDepth:i=10}=e,n=$(r,s),c=[],a=new Set,l=new Set,f=[],g=!1;function b(t,o){if(o>i){g=!0;return}if(l.has(t)){let h=f.indexOf(t);if(h!==-1){let u=f.slice(h).concat(t),y=u.indexOf(u.reduce((C,D)=>C<D?C:D)),p=[...u.slice(y,-1),...u.slice(0,y),u[y]],k=p.join(" -> ");S.has(k)||(S.add(k),c.push({path:p,kind:w(p)}))}return}if(a.has(t))return;a.add(t),l.add(t),f.push(t);let x=n.get(t);if(x)for(let h of x)b(h,o+1);f.pop(),l.delete(t)}let S=new Set;for(let t of n.keys())a.has(t)||b(t,0);return c.sort((t,o)=>t.kind!==o.kind?t.kind==="real"?-1:1:t.path.length-o.path.length),{cycles:c,truncated:g,maxDepth:i}}function w(r){for(let i of r){let n=m(i);if(n==="test"||n==="barrel"||n==="entry")return"module-hierarchy"}if(r.length!==3)return"real";let[e,s]=r;return!e||!s?"real":d(e)||d(s)||B(e,s)||B(s,e)||R(e,s)||R(s,e)||m(e)==="entry"||m(s)==="entry"?"module-hierarchy":"real"}function B(r,e){if(!/\.rs$/.test(r)||!/\.rs$/.test(e))return!1;let s=e.replace(/\.rs$/,"/");return r.startsWith(s)?!r.slice(s.length).includes("/"):!1}function R(r,e){if(!/\.rs$/.test(r)||!/\.rs$/.test(e))return!1;let s=r.replace(/\.rs$/,""),i=e.replace(/\.rs$/,"");if(s===i+"_tests"||s===i+"/tests")return!0;let n=r.split("/"),c=e.split("/");if(n.length===c.length&&n.includes("tests")&&c.includes("src")){let a=n[n.length-1],l=c[c.length-1];if(a&&a===l)return!0}return!1}export{v as a,P as b};
|
|
2
|
+
//# sourceMappingURL=chunk-LY7NMOBW.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk-K6UI6EBZ.js";import{a as d}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as g}from"./chunk-K6UI6EBZ.js";import{a as d}from"./chunk-IMQFJ53K.js";import{a as c}from"./chunk-GULVO6NF.js";import{d as p}from"./chunk-X5C43YVI.js";import{f as o}from"./chunk-JZBGTSAB.js";import{x as u}from"./chunk-ISLWJ4PY.js";function F(r,a={}){let{scope:l,limit:s=30,scanLimit:b}=a,f=new d(r);return g({candidates:()=>f.productionCallableDefinitions({scope:l,files:a.files,minLoc:2,excludeRootedSymbols:!0,requireFunctionLikeSymbol:!0}),filterCandidate:e=>y(e.relativePath),scanLimit:b,profile:{name:"unused-params"},evaluate:e=>{let n=o(r,e.relativePath)?.callables.find(t=>t.startLine===e.startLine&&t.endLine===e.endLine);if(!n||n.params.length===0||n.params.some(t=>!t.simple)||n.paramsEndLine>=n.endLine)return null;let L=c(r,e.relativePath),m=[];for(let t=n.params.length-1;t>=0;t--){let i=n.params[t];if(i.name===""||i.name.startsWith("_")||h(L.get(i.name),n.paramsEndLine,n.endLine))break;m.unshift(i.name)}return m.length===0?null:{symbol:e.symbol,shortName:p(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,paramCount:n.paramCount,unusedTrailing:m}},orderResults:(e,n)=>n.unusedTrailing.length-e.unusedTrailing.length||e.file.localeCompare(n.file)||e.startLine-n.startLine,limit:s})}function y(r){let a=u(r);return a==="typescript"||a==="tsx"||a==="javascript"}function h(r,a,l){return r?r.some(s=>s>a&&s<=l):!1}export{F as a};
|
|
2
|
+
//# sourceMappingURL=chunk-M7EEHYSU.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as k}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as k}from"./chunk-BP7S6V3M.js";function K(i,l={}){let{limit:d=10,scope:h,minDepth:x=3}=l,f=k(i,h),w=new Map,o=[],p=new Map,a=new Map,m=new Set,b=[],g=0;for(let e of f.keys()){if(p.has(e))continue;let t=[],s=(f.get(e)??new Set).values();for(p.set(e,g),a.set(e,g),g+=1,b.push(e),m.add(e),t.push({node:e,iter:s,pendingChild:null});t.length>0;){let n=t[t.length-1];if(n.pendingChild!==null){let u=n.pendingChild;n.pendingChild=null,a.set(n.node,Math.min(a.get(n.node),a.get(u)))}let c=n.iter.next();if(c.done){if(a.get(n.node)===p.get(n.node)){let u=[];for(;;){let S=b.pop();if(m.delete(S),u.push(S),w.set(S,o.length),S===n.node)break}o.push(u)}t.pop();continue}let r=c.value;if(p.has(r))m.has(r)&&a.set(n.node,Math.min(a.get(n.node),p.get(r)));else{p.set(r,g),a.set(r,g),g+=1,b.push(r),m.add(r);let u=(f.get(r)??new Set).values();n.pendingChild=r,t.push({node:r,iter:u,pendingChild:null})}}}let C=new Map,D=new Array(o.length);for(let e=0;e<o.length;e++)D[e]=o[e].length,C.set(e,new Set);for(let[e,t]of f){let s=w.get(e);for(let n of t){let c=w.get(n);c!==s&&C.get(s).add(c)}}let y=new Array(o.length),R=new Array(o.length);for(let e=0;e<o.length;e++){let t=[],s=0;for(let n of C.get(e)){let c=R[n];c>s&&(s=c,t=y[n])}y[e]=[e,...t],R[e]=D[e]+s}function M(e){return y[e]}let T=o.map(e=>[...e].sort()),v=new Set,I=[];for(let e=0;e<o.length;e++){let t=M(e),s=[];for(let c of t)s.push(...T[c]);if(s.length<x)continue;let n=s.join(" ");v.has(n)||(v.add(n),I.push(A(s)))}return I.sort((e,t)=>t.depth-e.depth),F(I).slice(0,d)}function A(i){return{chain:i,depth:i.length,actionTier:"signal",chainKind:"transitive-dependency-depth",evidenceReasons:[`${i.length} file(s) form the representative transitive dependency path`,"cycles are condensed before longest-path calculation"],recommendation:"Review whether the chain crosses ownership or layer boundaries; shorten it only when the dependency direction is accidental."}}function F(i){let l=[];for(let d of i)l.some(h=>L(d.chain,h.chain))||l.push(d);return l}function L(i,l){if(i.length>=l.length)return!1;let d=l.length-i.length;for(let h=0;h<i.length;h++)if(i[h]!==l[d+h])return!1;return!0}export{K as a};
|
|
2
|
+
//# sourceMappingURL=chunk-N23FT4EZ.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{a as T,c as E,g as L,h as D}from"./chunk-
|
|
1
|
+
import{a as T,c as E,g as L,h as D}from"./chunk-KYB7FPXT.js";import{j as O,o as A}from"./chunk-KSJ544IV.js";import{d as H}from"./chunk-KMVGRIO2.js";import{a as _}from"./chunk-IMQFJ53K.js";import{d as C,e as F}from"./chunk-X5C43YVI.js";import{a as w}from"./chunk-JZBGTSAB.js";var J=5;function ae(e,t={}){let{base:a="HEAD",minContainment:o=.7,minCallees:r=3,minSiteCoverage:n=.4,maxHelpers:c=Number.POSITIVE_INFINITY,limit:m=20,scanLimit:g}=t,f=t.semantic!==!1,s=t.diffPlan??E(e,{base:a}),l={available:s.note!==T,base:a,changedFiles:s.changedFiles,helpersChecked:0,skipped:[],findings:[]};if(!l.available||s.changedFiles.length===0)return l;let x=new _(e),k=new Set(s.changedFiles),$=new Map(s.renamedFiles.map(i=>[i.to,i.from])),j=t.baseContentAt??L(e.config.projectRoot,a,D(s)),h=Z(x,k,$,j);if(h.length===0)return l;let R=h.slice(0,c);h.length>c&&(l.note=`helper scoring capped at ${c} of ${h.length} new symbols`);let q=x.calleeMap(R,{semantic:f}),B=R.map(i=>({def:i,callees:A((q.get(i.symbolId)??[]).map(p=>p.symbol))})),V=O(e),M,G=()=>(M??=V.calleeIndex({minCallees:Math.min(3,r),scanLimit:g,semantic:f}),M);for(let{def:i,callees:p}of B){let d=C(i.symbol);if(p.size<r){l.skipped.push({helperShortName:d,helperFile:i.relativePath,reason:`fewer than ${r} meaningful callees \u2014 too small to score`});continue}let P=G(),N=Y(p,P);if(N===0){l.skipped.push({helperShortName:d,helperFile:i.relativePath,reason:"helper callee pattern is all project-wide infrastructure \u2014 too generic to score"});continue}let b=Q(e,i.symbolId);if(b.length===0){l.skipped.push({helperShortName:d,helperFile:i.relativePath,reason:"no references yet \u2014 covered by the new-dead check"});continue}l.helpersChecked+=1;let I=K({candidateIndex:P,changed:k,helperCallees:p,helperFile:i.relativePath,helperSymbol:i.symbol,minContainment:o,minSiteCoverage:n,migratedFiles:b});I.length!==0&&(I.sort((u,S)=>z(S.migrationScope)-z(u.migrationScope)||S.containment-u.containment||S.siteCoverage-u.siteCoverage||u.file.localeCompare(S.file)),l.findings.push({helperSymbol:i.symbol,helperShortName:d,helperFile:i.relativePath,helperShape:"specific-callee-cluster",helperCalleeCount:p.size,specificHelperCalleeCount:N,migratedFiles:b.sort(),leftovers:I.slice(0,J)}))}return l.findings.sort((i,p)=>(p.leftovers[0]?.containment??0)-(i.leftovers[0]?.containment??0)||i.helperFile.localeCompare(p.helperFile)),l.findings=l.findings.slice(0,m),l}function K(e){let t=[],a=U(e.helperSymbol,e.helperFile,e.migratedFiles),o=new Set;for(let r of e.helperCallees)for(let n of e.candidateIndex.candidateIndexesByCallee.get(r)??[])o.add(n);for(let r of o){let n=e.candidateIndex.corpus[r];if(n.symbol===e.helperSymbol||e.changed.has(n.file)||n.callees.has(e.helperSymbol))continue;let c=H(e.helperCallees,n.callees);if(c<e.minContainment)continue;let m=[...e.helperCallees].filter(s=>n.callees.has(s)),g=n.callees.size===0?0:m.length/n.callees.size;if(g<e.minSiteCoverage||!m.some(s=>(e.candidateIndex.docFreq.get(s)??0)<=e.candidateIndex.ubiquityThreshold))continue;let f=W(a,n.symbol,n.file);t.push({symbol:n.symbol,shortName:C(n.symbol),file:n.file,...f,containment:c,siteCoverage:g,uniqueSiteCalleeCount:Math.max(0,n.callees.size-m.length),sharedCallees:m.map(C).sort()})}return t}function z(e){return e==="same-scope"?2:e==="unknown"?1:0}function U(e,t,a){let o=new Set([...y(t),...v(F(e))]);for(let r of a)for(let n of y(r))o.add(n);return o}function W(e,t,a){let o=new Set([...y(a),...v(F(t))]);if(e.size===0||o.size===0)return{migrationScope:"unknown",migrationScopeReasons:["insufficient path/name tokens to infer migration scope"]};let r=[...o].filter(n=>e.has(n)).sort();return r.length>0?{migrationScope:"same-scope",migrationScopeReasons:[`shares migration-scope token(s): ${r.slice(0,5).join(", ")}`]}:{migrationScope:"possible-subtype",migrationScopeReasons:["no path/name tokens shared with the helper or already migrated files"]}}var X=new Set(["app","apps","common","component","components","helper","helpers","index","lib","package","packages","page","pages","route","routes","service","services","shared","spec","src","test","tests","util","utils"]);function y(e){return v(e.replace(/\.[^.]+$/,""))}function v(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(t=>t.length>1&&!X.has(t))}function Y(e,t){let a=0;for(let o of e)(t.docFreq.get(o)??0)<=t.ubiquityThreshold&&(a+=1);return a}function Z(e,t,a,o){return e.productionCallableDefinitions({files:[...t],requireFunctionLikeSymbol:!0}).filter(r=>{if(!t.has(r.relativePath))return!1;let n=a.get(r.relativePath)??r.relativePath,c=o(n);return c===null||!new RegExp(`\\b${w(r.leaf)}\\b`).test(c)})}function Q(e,t){return e.all(`SELECT DISTINCT ref_d.relative_path
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN documents ref_d ON c.document_id = ref_d.id
|
|
5
5
|
WHERE m.symbol_id = ?
|
|
6
6
|
AND m.role != 1
|
|
7
7
|
${e.pathExclusionsFor("ref_d")}`,t).map(o=>o.relative_path)}export{ae as a};
|
|
8
|
-
//# sourceMappingURL=chunk-
|
|
8
|
+
//# sourceMappingURL=chunk-N2OTJWC2.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as T}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as T}from"./chunk-V5W7H7V4.js";import{a as I}from"./chunk-YQKECTPV.js";import{a as H}from"./chunk-AAMURYOK.js";import{a as p}from"./chunk-5JRMZMLM.js";import{a as F}from"./chunk-R5336VHZ.js";import{a as v}from"./chunk-3H5OSDF7.js";import{a as k,b as G}from"./chunk-EDSD3VJK.js";import{b as D}from"./chunk-IUSSGHJO.js";import{a as S}from"./chunk-7COVQPQQ.js";import{a as j}from"./chunk-XZBLZHXL.js";import{a as w}from"./chunk-CXQQOXSI.js";import{a as P}from"./chunk-SFDVBARK.js";import{a as A}from"./chunk-NOKUZU56.js";function X(t,e,n={}){let o=n.impactDepth??3,r=n.sliceDepth??3,l=n.semantic,s=!z(e),a=s?H(t,e,{semantic:l}):{definitions:[],referencedBy:[]},m=s?P(t,e,{semantic:l}):null,f=s?j(t,e,{semantic:l}):null,h=s?v(t,e,{semantic:l}):null,y=s?p(t,e,{direction:"backward",maxDepth:r,semantic:l}):null,R=s?p(t,e,{direction:"forward",maxDepth:r,semantic:l}):null,d=s?w(t,e,{maxDepth:o,scope:n.scope}):[],i=A(t,e,{semantic:l}),C=k(t,e),g=G(t,e),u=I(t,e),x=T(t,e),c={symbol:a.definitions.length>0||a.referencedBy.length>0||m!==null||f!==null||h!==null||y!==null||R!==null||d.length>0,file:i!==null||C.length>0||g.length>0,module:u.files.length>0||u.symbols.length>0||x.length>0},b=[];!c.symbol&&!c.file&&!c.module&&b.push("No symbol, file, or module matched target.");let B=i?.file??a.definitions[0]?.relativePath??null;return{target:e,matched:c,history:O(t,B),trace:a,callGraph:m,complexity:f,dataflow:h,backwardSlice:y,forwardSlice:R,affected:d,changeSurface:i,deps:C,rdeps:g,system:u,surface:x,warnings:b}}function O(t,e){let n={available:!1,file:e,churn:null,coChangePartners:[],suppressionsInFile:0};if(!e)return n;let o=S(t).fileChurn();if(!o)return n;let r=D(t,e,{limit:5});return{available:!0,file:e,churn:o.get(e)??{changes:0,fixChanges:0,lastChangedAt:0},coChangePartners:r.findings.map(l=>({file:l.fileA===e?l.fileB:l.fileA,together:l.together,confidence:l.confidence,subjectContext:l.subjectContext})),suppressionsInFile:F(t).byFile.get(e)??0}}function z(t){return t.includes("/")||t.includes("\\")||/\.[A-Za-z0-9]+(?::\d+(?:-\d+)?)?$/.test(t)}export{X as a};
|
|
2
|
+
//# sourceMappingURL=chunk-NCVFKOLB.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as f}from"./chunk-
|
|
1
|
+
import{a as f}from"./chunk-K7SPOJHZ.js";import{a as d}from"./chunk-IMQFJ53K.js";import{e as c}from"./chunk-WMO2VZZK.js";import{d as u}from"./chunk-X5C43YVI.js";function L(e,n,i={}){let t=f(e,n);if(!t)return null;let r=h(e,t);if(!r||e.isIgnored(r.relative_path))return null;let s=[],m=0,l=g(e,r.relative_path),p=i.semantic===!1?new Map:c(e,l);for(let o of l){let a=S(e,r,o,p.get(o.symbolId)??new Set);m+=a,s.push({symbol:o.symbol,shortName:u(o.symbol),startLine:o.startLine,endLine:o.endLine,externalConsumers:a,riskLevel:b(a)})}return{file:r.relative_path,symbols:s,totalExternalConsumers:m}}function h(e,n){return e.get(`SELECT id, relative_path FROM documents
|
|
2
2
|
WHERE relative_path = ?
|
|
3
3
|
${e.pathExclusionsFor("documents")}
|
|
4
4
|
LIMIT 1`,n)??null}function g(e,n){return new d(e).definitionsForFile(n).sort((i,t)=>i.startLine-t.startLine||i.endLine-t.endLine)}function S(e,n,i,t){let r=e.all(`SELECT DISTINCT consumer_d.relative_path
|
|
@@ -8,4 +8,4 @@ import{a as f}from"./chunk-OSWF3HSF.js";import{a as d}from"./chunk-UAHZ57BR.js";
|
|
|
8
8
|
WHERE m.symbol_id = ?
|
|
9
9
|
AND m.role != 1
|
|
10
10
|
AND c.document_id != ?`,i.symbolId,n.id);return new Set([...r.map(s=>s.relative_path),...[...t].filter(s=>s!==n.relative_path)]).size}function b(e){return e>10?"high":e>0?"medium":"low"}export{L as a};
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
11
|
+
//# sourceMappingURL=chunk-NOKUZU56.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as C}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as C}from"./chunk-IMQFJ53K.js";import{q as v}from"./chunk-GULVO6NF.js";import{b as O,d as x,f as T}from"./chunk-WMO2VZZK.js";import{d as A}from"./chunk-X5C43YVI.js";import{f as b}from"./chunk-JZBGTSAB.js";import{x as g}from"./chunk-ISLWJ4PY.js";function H(e,n={}){let{samples:o=50,scope:r,maxDisagreements:u=5}=n,l=new C(e),a=B(l.productionCallableDefinitions({scope:r,minLoc:2,requireFunctionLikeSymbol:!0}),o),c=K(e,a);if(a.length===0||!c)return{available:!1,sampleSize:a.length,oracleCoverage:0,scores:[],topDisagreements:[]};let t={references:P(),callees:P()},i=[],f=0,m=c==="semantic"?T(e,a):new Map,I=c==="source"?E(e,l,a):null;for(let s of a){let p=S(s,c==="semantic"?x(e,s).map(d=>d.file):[...I?.referencesBySymbolId.get(s.symbolId)??[]]),j=S(s,c==="semantic"?(m.get(s.symbolId)??[]).map(d=>d.file):[...I?.calleesBySymbolId.get(s.symbolId)??[]]);f+=1;let L=S(s,v(e,s).map(d=>d.file)),k=S(s,(l.calleeMap([s],{semantic:!1}).get(s.symbolId)??[]).map(d=>d.file)),w=y(c,"references"),R=y(c,"callees");Q(t.references,s,"references",L,p,w,i),Q(t.callees,s,"callees",k,j,R,i)}return i.sort((s,p)=>p.cheapOnly.length+p.oracleOnly.length-(s.cheapOnly.length+s.oracleOnly.length)),{available:!0,sampleSize:a.length,oracleCoverage:a.length>0?D(f/a.length):0,oracleKind:c,scores:["references","callees"].map(s=>F(s,t[s],c)),topDisagreements:i.slice(0,u)}}function P(){return{comparedSymbols:0,agreed:0,cheapTotal:0,oracleTotal:0,skippedOraclePartial:0}}function B(e,n){let o=[...e].sort((l,a)=>l.symbolId-a.symbolId);if(o.length<=n)return o;let r=o.length/n,u=[];for(let l=0;l<n;l++)u.push(o[Math.floor(l*r)]);return u}function K(e,n){let o=n[0];if(!o)return null;if(h(e,o))return"source";try{if(O(e).capability("semantic-references",o.relativePath).available)return"semantic"}catch{}return n.some(r=>h(e,r))?"source":null}function S(e,n){let o=new Set;for(let r of n)r!==e.relativePath&&o.add(r);return o}function Q(e,n,o,r,u,l,a){if(!l&&u.size===0){e.skippedOraclePartial+=1;return}e.comparedSymbols+=1,e.cheapTotal+=r.size,e.oracleTotal+=u.size;let c=[],t=[];for(let i of r)u.has(i)?e.agreed+=1:c.push(i);for(let i of u)r.has(i)||t.push(i);(c.length>0||t.length>0)&&a.push({symbol:A(n.symbol),question:o,cheapOnly:c,oracleOnly:t})}var z={references:!0,callees:!1};function F(e,n,o){let r=n.oracleTotal>0?n.agreed/n.oracleTotal:1,u=n.cheapTotal-n.agreed,l=y(o,e);return{question:e,comparedSymbols:n.comparedSymbols,precision:l&&n.cheapTotal>0?D(n.agreed/n.cheapTotal):null,recall:D(r),unverified:u,skippedOraclePartial:n.skippedOraclePartial}}function y(e,n){return e==="semantic"?z[n]:!1}function h(e,n){return g(n.relativePath)==="clojure"&&b(e,n.relativePath)!==null}function E(e,n,o){let r=new Map,u=new Map,l=o.filter(t=>h(e,t)),a=new Map;for(let t of l){let i=a.get(t.leaf)??[];i.push(t),a.set(t.leaf,i)}for(let t of n.sourceFiles()){if(g(t)!=="clojure")continue;let i=b(e,t);if(i)for(let f of i.fileIdentifiers)for(let m of a.get(f)??[])M(r,m.symbolId,t)}let c=new Map;for(let t of n.scopedDefinitions()){if(g(t.relativePath)!=="clojure")continue;let i=c.get(t.leaf)??[];i.push(t),c.set(t.leaf,i)}for(let t of l){let i=b(e,t.relativePath);if(i){for(let f of i.callSites)if(!(f.line<t.startLine||f.line>t.endLine))for(let m of c.get(f.calleeLeaf)??[])M(u,t.symbolId,m.relativePath)}}return{referencesBySymbolId:r,calleesBySymbolId:u}}function M(e,n,o){let r=e.get(n);if(r){r.add(o);return}e.set(n,new Set([o]))}function D(e){return Math.round(e*1e3)/1e3}export{H as a};
|
|
2
|
+
//# sourceMappingURL=chunk-OXTM2RX3.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as i}from"./chunk-KSJ544IV.js";function l(n,o,s,t={}){let e=i(n,o,s,t);return e?{symbolA:e.symbolA,symbolB:e.symbolB,similarity:e.similarity,sharedCallees:e.sharedEvidence,uniqueToA:e.uniqueToA,uniqueToB:e.uniqueToB,consolidationStrategy:e.consolidationStrategy}:null}export{l as a};
|
|
2
|
+
//# sourceMappingURL=chunk-PEHDARNC.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d as x}from"./chunk-HZZQKNVE.js";import{f as m,g as f}from"./chunk-3AMWF6V5.js";import{b as v}from"./chunk-B75HZHUP.js";import{a as E}from"./chunk-IMQFJ53K.js";import{a as y}from"./chunk-BGBBVSH4.js";import{a as b}from"./chunk-5VY3RIEI.js";import{b as h}from"./chunk-27HMTUJE.js";import{f as g}from"./chunk-7TVFPOD7.js";import{d as u}from"./chunk-X5C43YVI.js";import{c as p}from"./chunk-JZBGTSAB.js";var T=/^(?:validate|verify|check|assert)(?:[A-Z].*)?$/,R=/^(?:is|has)(?:[A-Z].*)?$/,L=/[{,]\s*(?:ok|success|valid|isValid)\s*:\s*false\b/,d=/\breturn\b/g,N=/\bfunction\b|=>|\)\s*(?::\s*[^{;=]+)?\s*\{/,I=/\.(?:addIssue|push)\s*\(/;function q(e,i={}){let{scope:t,limit:n=30,scanLimit:s}=i,l=new E(e),c=v(l.productionCallableDefinitions({scope:t,minLoc:1,requireFunctionLikeSymbol:!0,excludeTypesFiles:!0}),s),o=[];for(let r of c){let a=A(e,r);a&&o.push({symbol:r.symbol,shortName:u(r.symbol),file:r.relativePath,startLine:r.startLine,endLine:r.endLine,loc:y(r),...a})}return o.sort((r,a)=>r.file.localeCompare(a.file)||r.startLine-a.startLine||r.loc-a.loc),n?o.slice(0,n):o}function S(e){return T.test(e)?"imperative":R.test(e)?"predicate":null}function A(e,i){let t=S(i.leaf);if(!t)return null;let n=m(e,i);if(!n||!N.test(n))return null;if(x(n)){let l=P(e,i);return!l||D(l.body,C(l.snippet))?null:{nameKind:t,resolvedVia:"one-hop-delegate",delegateTarget:l.shortName}}let s=f(n);return D(s,C(n))?null:{nameKind:t,resolvedVia:"direct"}}function C(e){let i=e.indexOf("=>");return i===-1?!1:!/^\s*\{/.test(e.slice(i+2))}function D(e,i){let t=p(e);if(/\bthrow\b/.test(t)||/\.reject\s*\(/.test(t)||L.test(t)||I.test(t))return!0;let n=k(t);if(i&&n.length===0){let s=t.trim();return s!==""&&s!=="true"}for(let s of n)if(s!==""&&s!=="true")return!0;return!1}function k(e){let i=[];d.lastIndex=0;let t;for(;t=d.exec(e);){let n=t.index+t[0].length,s=0,l=e.length;for(let c=n;c<e.length;c+=1){let o=e[c];if(o==="("||o==="["||o==="{")s+=1;else if(o===")"||o==="]"||o==="}"){if(s===0){l=c;break}s-=1}else if(o===";"&&s===0){l=c;break}}i.push(e.slice(n,l).trim()),d.lastIndex=l}return i}function P(e,i){let t=b(e,i,{callableOnly:!0,limit:3}),n=[...new Set(t.map(r=>r.symbol))].filter(r=>r!==i.symbol);if(n.length!==1)return null;let l=h(e,n[0]).match;if(!l)return null;let c=g(e,l.relativePath).find(r=>r.symbolId===l.symbolId);if(!c)return null;let o=m(e,c);return o?{body:f(o),snippet:o,shortName:u(c.symbol)}:null}export{q as a};
|
|
2
|
+
//# sourceMappingURL=chunk-PESEPWZO.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as p}from"./chunk-B75HZHUP.js";import{a as b}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as p}from"./chunk-B75HZHUP.js";import{a as b}from"./chunk-IMQFJ53K.js";import{a as c,c as f}from"./chunk-5VY3RIEI.js";import{d as m}from"./chunk-X5C43YVI.js";function k(o,n={}){let{limit:s=20,scope:i,minFanIn:r=2,minFanOut:a=2,scanLimit:e}=n,u=new b(o);return p(u.productionCallableDefinitions({scope:i,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof e=="number"&&e>0}),e).map(t=>d(o,t,n.semantic!==!1)).filter(t=>t.fanIn>=r&&t.fanOut>=a).sort((t,l)=>l.score-t.score||l.fanIn-t.fanIn).slice(0,s)}function d(o,n,s){let i=new Set(f(o,n,{limit:500,semantic:s}).map(e=>e.file)).size,r=new Set(c(o,n,{limit:500,semantic:s}).filter(e=>e.file!==n.relativePath).map(e=>`${e.symbol}|${e.file}`)).size,a=i*r;return{symbol:n.symbol,shortName:m(n.symbol),fanIn:i,fanOut:r,score:a,definedIn:n.relativePath,actionTier:"signal",riskKind:"coordination-hotspot",evidenceReasons:[`${i} incoming file(s) reference this symbol`,`${r} distinct cross-file callee symbol(s) are reached from it`,`centrality score is ${a} (fan-in * fan-out)`],recommendation:"Review ownership, API stability, and caller groups before changing this central symbol; do not refactor solely from graph centrality."}}export{k as a};
|
|
2
|
+
//# sourceMappingURL=chunk-PMY4UFGV.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as G}from"./chunk-QZ4JVECJ.js";import{a as U}from"./chunk-WXVGNFAO.js";import{a as _}from"./chunk-
|
|
1
|
+
import{a as G}from"./chunk-QZ4JVECJ.js";import{a as U}from"./chunk-WXVGNFAO.js";import{a as _}from"./chunk-7COVQPQQ.js";import{b as F,i as O,j as L,k as $,l as K,m as H,o as z,p as X}from"./chunk-WS3Z6W3M.js";import{existsSync as Y,readFileSync as P,statSync as St}from"fs";import{join as T}from"path";function M(t,n){let e=it(t,n)??rt(t,n)??ot(t,n)??st(t,n);return ct(t,e,n)}function it(t,n){let e=-1,i=null;for(let r=0;r<=n;r+=1){let o=j(t[r]??"");o&&(i===null?(i=o,e=r):o===i&&(i=null,e=-1))}if(i===null||e<0)return null;for(let r=n+1;r<t.length;r+=1)if(j(t[r]??"")===i)return{start:e,end:r+1};return{start:e,end:t.length}}function j(t){let n=t.match(/^\s*(```+|~~~+)/);return n?n[1].startsWith("`")?"`":"~":null}function rt(t,n){if(!w(t[n]??""))return null;let e=n;for(;e>0&&w(t[e-1]??"");)e-=1;let i=n+1;for(;i<t.length&&w(t[i]??"");)i+=1;return{start:e,end:i}}function w(t){let n=t.trim();return n.startsWith("|")&&n.endsWith("|")&&n.includes("|")}function ot(t,n){let e=n;for(;e>=0;){let o=t[e]??"";if(I(o)!==null)break;if(N(o)!==null)return null;e-=1}if(e<0)return null;let i=I(t[e]??"");if(i===null)return null;let r=e+1;for(;r<t.length;){let o=t[r]??"",s=I(o);if(s!==null){if(s<=i)break;r+=1;continue}if(N(o)!==null)break;r+=1}return{start:e,end:r}}function I(t){let n=t.match(/^(\s*)(?:[-*+]\s+|\d+[.)]\s+)/);return n?n[1].length:null}function st(t,n){let e=t[n]??"";if(V(e)||e.trim().length===0)return{start:n,end:n+1};let i=n;for(;i>0&&q(t[i-1]??"");)i-=1;let r=n+1;for(;r<t.length&&q(t[r]??"");)r+=1;return{start:i,end:r}}function q(t){return N(t)===null}function N(t){return t.trim().length===0?"blank":V(t)?"heading":j(t)?"fence":w(t)?"table":I(t)!==null?"list":null}function V(t){return/^#{1,6}\s+/.test(t.trim())}function ct(t,n,e){let{start:i,end:r}=n;if(r-i>40){let s=Math.floor(20);i=Math.max(i,e-s),r=Math.min(r,i+40),i=Math.max(n.start,r-40)}let o=t.slice(i,r).join(`
|
|
2
2
|
`).trim();return o.length<=2e3?o:`${o.slice(0,2e3).trimEnd()}...`}function R(t,n){return n.filter(e=>t.includes(e))}import{existsSync as at,readFileSync as W}from"fs";var lt=/<!--\s*scip-query:\s*snapshot\s*-->/i;function Z(t,n){if((t.config.docs?.snapshotPaths??[]).some(r=>G(r,n)))return!0;let i=X(t,n);return i.length>0&<.test(i)}var J={classifyCitation:ut,citationContexts:ft,citationKindLabel:mt,citationRemediation:ht,referenceTargets:pt,hasLineAnchoredCitation:dt};function dt(t){return t.some(n=>(n.lineReferences?.length??0)>0)}function ut(t){let n=t.join(`
|
|
3
3
|
`).toLowerCase(),e=[],i=R(n,[".scipquery","declaredcouplings","suppression","suppressions","config","configuration","json"]);if(i.length>0)return e.push(`configuration/example terms near citation: ${i.join(", ")}`),{citationKind:"configuration-example",actionTier:"support",reasons:e};let r=R(n,["accepted","intentional","intentionally","retained","historical"]);if(r.length>0)return e.push(`intentional-record terms near citation: ${r.join(", ")}`),{citationKind:"intentional-record",actionTier:"support",reasons:e};let o=R(n,["command","cli","usage","example","run","workflow"]);return o.length>0?(e.push(`guide/reference terms near citation: ${o.join(", ")}`),{citationKind:"guide-reference",actionTier:"signal",reasons:e}):(e.push(t.length>0?"citation appears in prose without config or guide markers":"citation context unavailable"),{citationKind:"behavioral-claim",actionTier:"direct",reasons:e})}function ft(t,n,e){let i;try{i=W(`${t.config.projectRoot}/${n}`,"utf-8").split(/\r?\n/)}catch{return[]}let r=e.flatMap(gt),o=[];for(let s=0;s<i.length;s+=1){let c=i[s]??"";r.some(a=>c.includes(a))&&o.push(M(i,s))}return o}function gt(t){let n=t.split("/");return[t,`./${t}`,n.slice(-3).join("/"),n.slice(-2).join("/")].filter((e,i,r)=>e.length>0&&r.indexOf(e)===i)}function mt(t){switch(t){case"behavioral-claim":return"a behavioral doc claim";case"configuration-example":return"a configuration example";case"guide-reference":return"a guide reference";case"intentional-record":return"an intentional record"}}function ht(t,n){switch(t){case"behavioral-claim":return`Re-read ${n} and update the behavioral claim or citation.`;case"configuration-example":return`Verify the configuration example in ${n} still points at the intended file; update only if the example target changed.`;case"guide-reference":return`Verify the guide reference in ${n} still sends readers to the right implementation or command surface.`;case"intentional-record":return`Verify the intentional citation in ${n} is still meant to name this file.`}}function pt(t,n,e){let i=U(e),r=new Set;for(let o of n)yt(t,o,i.get(o)??[])&&r.add(o);return r}function yt(t,n,e){if(!Ct.test(n))return!0;let i=`${t.config.projectRoot}/${n}`;if(!at(i))return!0;if(e.length===0)return!1;let r=W(i,"utf-8").split(/\r?\n/),o=bt(r);for(let s of e)for(let c=s.startLine;c<=s.endLine;c+=1)if((r[c]??"").trim()!==""&&!o.has(c))return!0;return!1}var Ct=/\.(?:[cm]?[jt]sx?)$/i;function bt(t){let n=new Set,e=!1;for(let i=0;i<t.length;i+=1){let r=t[i].trim();!e&&Dt(r)&&(e=!0),e&&(n.add(i),r.endsWith(";")&&(e=!1))}return n}function Dt(t){return/^import(?:\s|$)/.test(t)||/^export(?:\s+type)?\s+(?:\*|\{)/.test(t)}var Q=H({kind:"doc-path-evidence",invalidation:z("doc-path-evidence"),serialize:Nt,deserialize:Bt}),v=/\.(?:md|mdx|rst|txt)$/i;function xt(t){return/(?:^|\/)(?:docs\/plans|plans|adrs?|rfcs?|decisions|changelogs?|archive|reports?)\//i.test(t)||/(?:^|\/)CHANGELOG\.(?:md|mdx|rst|txt)$/i.test(t)}var Rt=3,Tt=/([A-Za-z0-9_@-]+(?:\/[A-Za-z0-9_.@-]+)+\.[A-Za-z0-9]{1,6})(?::([1-9][0-9]*))?\b/g;function sn(t,n={}){let{doc:e,limit:i=20,minCoupling:r=Rt,includeSnapshotExcluded:o=!1}=n,s=It(t);if(!s)return{available:!1,commitsAnalyzed:0,docsScanned:0,findings:[]};let c=[];for(let a of s.docFiles){if(e!==void 0&&!a.includes(e)||e===void 0&&!tt(t,a)||e!==void 0&&!Y(T(t.config.projectRoot,a)))continue;let f=Z(t,a);if(f&&!o)continue;let{value:y,estimated:l}=At(t,a,s.changeTimes.get(a)),m=vt(t,a),h=new Map,{resolved:d,broken:g,citations:D}=kt(t,a,s.tracked,s.trackedBySuffix,s.everSeenInHistory),S=new Map(D.map(u=>[u.file,u]));for(let u of d){if(u===a||v.test(u))continue;let C=(s.changeTimes.get(u)??[]).filter(b=>b>y).length;if(C===0)continue;let p=S.get(u);h.set(u,{file:u,evidence:"reference",coChanges:0,changesSinceDocUpdate:C,...B("reference",m,p?.contexts),citationContexts:p?.contexts,citedLines:p?.lineReferences})}for(let[u,C]of s.coupling.get(a)??[]){if(C<r||!s.tracked.has(u))continue;let p=(s.changeTimes.get(u)??[]).filter(A=>A>y).length;if(p===0)continue;let b=h.get(u);b?(b.evidence="both",b.coChanges=C,Object.assign(b,B("both",m,b.citationContexts))):h.set(u,{file:u,evidence:"co-change",coChanges:C,changesSinceDocUpdate:p,...B("co-change",m)})}if(h.size===0&&g.length===0)continue;let x=[...h.values()].sort((u,C)=>C.changesSinceDocUpdate-u.changesSinceDocUpdate);c.push({doc:a,docLastChangedAt:y,staleness:x.reduce((u,C)=>u+C.changesSinceDocUpdate,0)+g.length*10,subjects:x.slice(0,8),brokenReferences:g,...f?{snapshotExcluded:!0}:{},...l?{docLastChangedAtEstimated:!0}:{}})}return c.sort((a,f)=>f.staleness-a.staleness),{available:!0,commitsAnalyzed:s.historyCommitCount,docsScanned:s.docFiles.length,findings:c.slice(0,i)}}function At(t,n,e){if(e&&e.length>0)return{value:Math.max(...e),estimated:!1};try{return{value:Math.floor(St(T(t.config.projectRoot,n)).mtimeMs/1e3),estimated:!0}}catch{return{value:0,estimated:!1}}}function vt(t,n){let e;try{e=P(T(t.config.projectRoot,n),"utf8").slice(0,6e3)}catch{return{docIntent:"unknown",reasons:["doc text unavailable"]}}let i=`${n}
|
|
4
4
|
${e}`.toLowerCase(),r=R(i,["historical note","historical record","history note","retrospective","postmortem","post-mortem","archived","archive","previously","legacy","recorded","record of","snapshot","as of","migration note","decision record"]);if(r.length>0)return{docIntent:"historical-note",reasons:[`historical-note terms: ${r.join(", ")}`]};let o=R(i,["current","standard","standards","must","should","policy","guide","guidance","workflow","contract","invariant","source of truth"]);return o.length>0?{docIntent:"current-guidance",reasons:[`current-guidance terms: ${o.join(", ")}`]}:{docIntent:"unknown",reasons:["no current-guidance or historical-note markers found"]}}function B(t,n,e=[]){let i=t==="co-change"||e.length===0?null:J.classifyCitation(e);return{actionTier:wt(t,n.docIntent,i?.actionTier),docIntent:n.docIntent,docIntentReasons:n.reasons,...i?{citationKind:i.citationKind,citationKindReasons:i.reasons}:{}}}function wt(t,n,e){return n==="historical-note"?"support":e||(t==="co-change"?"signal":"direct")}function It(t){let n=_(t),e=n.commitHistory();if(!e)return null;let i=n.trackedFiles()??new Set,r=new Map,o=new Map,s=new Set;for(let c of e.commits){let a=[...new Set(c.files)],f=a.filter(l=>v.test(l)),y=a.filter(l=>!v.test(l));for(let l of a){s.add(l);let m=r.get(l)??[];m.push(c.timestamp),r.set(l,m)}for(let l of f){let m=o.get(l);m||(m=new Map,o.set(l,m));for(let h of y)m.set(h,(m.get(h)??0)+1)}}return{changeTimes:r,coupling:o,docFiles:[...i].filter(c=>v.test(c)),everSeenInHistory:s,historyCommitCount:e.commits.length,tracked:i,trackedBySuffix:nt(i)}}function cn(t,n){if(n.size===0)return[];let e=$(),i=0,r=0,o=0,s=0,c=0,a=0;return K("doc-reference.docs-citing-files",()=>{let f=_(t).trackedFiles()??new Set;i=f.size;let y=nt(f),l=Mt(n,y),m=[];for(let h of f){if(!tt(t,h))continue;e&&(r+=1);let d;try{d=P(T(t.config.projectRoot,h),"utf-8")}catch{e&&(o+=1);continue}if(!_t(d,l)){e&&(s+=1);continue}let g=et(t,h,d);if(!g)continue;e&&(c+=1);let D=Et(g.candidates,n,l,f,y);if(D.size===0)continue;let S=[...new Set([...D.values()].flatMap(p=>[...p]))],x=Lt(g.contextsByCandidate,S),u=[...D].map(([p,b])=>({file:p,contexts:E([...b].flatMap(A=>x.get(A)??[])).slice(0,3),lineReferences:k([...b].flatMap(A=>g.lineReferencesByCandidate.get(A)??[]))})).filter(p=>p.contexts.length>0),C=[...D.keys()];if(C.length>0){e&&(a+=1);let p=C.sort();m.push({doc:h,cited:p,citations:u,citedClaims:E(u.flatMap(b=>b.contexts)).slice(0,3)})}}return m},()=>({targets:n.size,trackedFiles:i,livingDocs:r,unreadableDocs:o,candidateMisses:s,evidenceDocs:c,citedDocs:a}))}function tt(t,n){return v.test(n)&&!xt(n)&&Y(T(t.config.projectRoot,n))}function nt(t){let n=new Map;for(let e of t){let i=e.split("/");for(let r of[2,3]){if(i.length<r)continue;let o=i.slice(-r).join("/"),s=n.get(o)??[];s.push(e),n.set(o,s)}}return n}function Mt(t,n){let e=new Set(t);for(let i of t){let r=i.split("/");for(let o of[2,3]){if(r.length<o)continue;let s=r.slice(-o).join("/"),c=n.get(s);c?.length===1&&c[0]===i&&e.add(s)}}return e}function Et(t,n,e,i,r){let o=new Map;for(let s of t){if(!e.has(s))continue;let c;if(n.has(s))c=s;else if(i.has(s))c=s;else{let f=r.get(s);f?.length===1&&(c=f[0])}if(!c||!n.has(c))continue;let a=o.get(c)??new Set;a.add(s),o.set(c,a)}return o}function kt(t,n,e,i,r){let o=new Set,s=new Set,c=et(t,n);if(!c)return{resolved:o,broken:[],citations:[]};let a=c.candidates,f=c.contextsByCandidate,y=c.lineReferencesByCandidate,l=new Map,m=new Map,h=(d,g)=>{let D=f.get(g);if(D&&D.length>0){let x=l.get(d)??[];x.push(...D),l.set(d,E(x).slice(0,3))}let S=y.get(g);S&&S.length>0&&m.set(d,k([...m.get(d)??[],...S]))};for(let d of a){if(e.has(d)){o.add(d),h(d,d);continue}let g=i.get(d);if(g&&g.length===1){o.add(g[0]),h(g[0],d);continue}g&&g.length>1||r.has(d)&&s.add(d)}return{resolved:o,broken:[...s],citations:[...l].map(([d,g])=>({file:d,contexts:g,lineReferences:m.get(d)}))}}function Lt(t,n){let e=new Map;for(let i of n){let r=t.get(i);r&&r.length>0&&e.set(i,[...r])}return e}function et(t,n,e){let i=e;if(i===void 0)try{i=P(T(t.config.projectRoot,n),"utf-8")}catch{return null}let r=F(t,n,i),o=Q.read(t,n,r);if(o)return o;let s=jt(i);return Q.write(t,n,r,s),s}function _t(t,n){for(let e of n)if(t.includes(e))return!0;return!1}function jt(t){let n=t.split(/\r?\n/),e=new Set,i=new Map,r=new Map;for(let o=0;o<n.length;o+=1){let s=n[o]??"";for(let c of s.matchAll(Tt)){let a=(c[1]??"").replace(/^\.?\//,"");if(a.length===0)continue;e.add(a);let f=c[2]?Number(c[2]):null;f!==null&&Number.isSafeInteger(f)&&r.set(a,k([...r.get(a)??[],f]));let y=M(n,o);if(y.length===0)continue;let l=i.get(a)??[];l.push(y),i.set(a,E(l).slice(0,3))}}return{candidates:[...e],contextsByCandidate:i,lineReferencesByCandidate:r}}function Nt(t){let n={candidates:t.candidates,contextsByCandidate:[...t.contextsByCandidate.entries()],lineReferencesByCandidate:[...t.lineReferencesByCandidate.entries()]};return JSON.stringify(n)}function Bt(t){try{let n=JSON.parse(t);if(!O(n))return null;let e=L(n.candidates),i=Ft(n.contextsByCandidate),r=Pt(n.lineReferencesByCandidate);return!e||!i?null:{candidates:e,contextsByCandidate:new Map(i),lineReferencesByCandidate:new Map(r??[])}}catch{return null}}function Pt(t){if(t===void 0)return[];if(!Array.isArray(t))return null;let n=[];for(let e of t){if(!Array.isArray(e)||e.length!==2||typeof e[0]!="string"||!Array.isArray(e[1]))return null;let i=[];for(let r of e[1]){if(typeof r!="number"||!Number.isSafeInteger(r))return null;i.push(r)}n.push([e[0],k(i)])}return n}function Ft(t){if(!Array.isArray(t))return null;let n=[];for(let e of t){if(!Array.isArray(e)||e.length!==2||typeof e[0]!="string")return null;let i=L(e[1]);if(!i)return null;n.push([e[0],i])}return n}function E(t){let n=[];for(let e of new Set(t))n.some(i=>Ot(i,e))||n.push(e);return n}function k(t){return[...new Set(t)].sort((n,e)=>n-e)}function Ot(t,n){if(t===n)return!0;let e=t.split(/\r?\n/).map(c=>c.trim()).filter(c=>c.length>0),i=n.split(/\r?\n/).map(c=>c.trim()).filter(c=>c.length>0),r=Math.min(e.length,i.length);if(r===0)return!1;if(r<3)return t.includes(n)||n.includes(t);let o=new Set(i),s=e.filter(c=>o.has(c)).length;return s>=3&&s/r>=.6}export{Z as a,J as b,xt as c,sn as d,cn as e};
|
|
5
|
-
//# sourceMappingURL=chunk-
|
|
5
|
+
//# sourceMappingURL=chunk-Q7PWDXL5.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as oe}from"./chunk-B75HZHUP.js";import{a as N}from"./chunk-UAHZ57BR.js";import{b as J,e as $,f as G,g as X}from"./chunk-NAH5EAZS.js";import{c as se}from"./chunk-72MFTCU5.js";import{c as Y,d as ee,e as te,f as ne,l as ie}from"./chunk-MKM7NBZK.js";import{e as re}from"./chunk-YDDGCJJG.js";import{j as Q,o as _}from"./chunk-MBKJ7GHT.js";import{d as U,g as H,h as V,i as K,j as Z,k as q}from"./chunk-HXXMPYEF.js";import{m as W}from"./chunk-T2FQ4GHD.js";import{A as P,x as z}from"./chunk-ISLWJ4PY.js";import{b as O,l as b,m as B,o as j,p as I}from"./chunk-WS3Z6W3M.js";import{c as w}from"./chunk-GNG622H3.js";import{a as R}from"./chunk-64MNV6AB.js";import{b as L}from"./chunk-7S5E7KWT.js";var x=new WeakMap,ae=B({kind:"definition-exclusions",invalidation:j("definition-exclusions"),serialize:e=>JSON.stringify(e),deserialize:De});function le(e,t){let n=z(t);if(!(n==="rust"||n==="typescript"||n==="tsx"||n==="javascript"))return[];let r=I(e,t);if(!r)return[];let s=O(e,t,r),a=ae.read(e,t,s);if(a)return a;let u=n==="rust"?Te(e,t):Pe(e,t);return ae.write(e,t,s,u),u}function De(e){try{let t=JSON.parse(e);return!Array.isArray(t)||!t.every(Le)?null:t}catch{return null}}function Le(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.startLine!="number"||!Number.isFinite(t.startLine)||typeof t.endLine!="number"||!Number.isFinite(t.endLine)||typeof t.reason!="string"?!1:t.containerName===void 0||typeof t.containerName=="string"}var ue=new Set(["describe","it","test","fdescribe","fit","xdescribe","xit","beforeEach","afterEach","beforeAll","afterAll","before","after","suite","bench","benchmark"]),we=/\b(?:describe|it|test|fdescribe|fit|xdescribe|xit|beforeEach|afterEach|beforeAll|afterAll|before|after|suite|bench|benchmark)\s*\(/,Ie=/\b(?:export\s+)?(?:async\s+)?function\s+use[A-Z][A-Za-z0-9_$]*\b|\b(?:const|let|var)\s+use[A-Z][A-Za-z0-9_$]*\s*(?::[^=;]+)?=\s*(?:async\s*)?(?:function\b|(?:<[^=;{]+>\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*=>)/;function Pe(e,t){let n=I(e,t);if(!n||!Ne(n))return[];let i=P(e,t);if(!i)return[];let r=x.get(i);if(r)return r;let s=!1,a=i.rootNode;for(let l of a.namedChildren){if(l.type!=="expression_statement")continue;let d=l.namedChild(0);if(!d||d.type!=="call_expression")continue;let o=d.namedChild(0);if(!o)continue;let c=o.type==="member_expression"?o.namedChild(o.namedChildCount-1)?.text:o.text;if(c&&ue.has(c)){s=!0;break}}let u=[];s&&u.push({startLine:0,endLine:a.endPosition.row,reason:"TS/JS test file (describe/it/test at top level)"});for(let l of a.namedChildren){let d=null,o=null;if(l.type==="function_declaration")d=l.namedChild(0)?.text??null,o=l;else if(l.type==="export_statement"){let c=l.namedChild(0);c?.type==="function_declaration"&&(d=c.namedChild(0)?.text??null,o=c)}else if(l.type==="lexical_declaration"){let c=l.namedChild(0);if(c?.type==="variable_declarator"){let p=c.namedChild(0)?.text,m=c.namedChild(1);p&&(m?.type==="arrow_function"||m?.type==="function_expression")&&(d=p,o=c)}}d&&/^use[A-Z]/.test(d)&&o&&u.push({startLine:o.startPosition.row,endLine:o.endPosition.row,reason:"React custom hook (use*)"})}return u.push(...de(i,new Set(["function_declaration","method_definition","class_declaration","interface_declaration","type_alias_declaration","enum_declaration","variable_declarator","export_statement"]),new Set(["comment"]))),x.set(i,u),u}function Ne(e){if(e.includes("scip-query"))return!0;let t=!1;for(let n of ue)if(e.includes(n)){t=!0;break}return t&&we.test(e)?!0:e.includes("use")&&Ie.test(e)}var ke=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale)?/i;function Fe(e){return ke.test(e)}function de(e,t,n){let i=[],r=s=>{if(t.has(s.type)&&s.parent){let u=s.parent.children,l=-1;for(let d=0;d<u.length;d+=1)if(u[d].startIndex===s.startIndex&&u[d].type===s.type){l=d;break}if(l>0)for(let d=l-1;d>=0;d-=1){let o=u[d];if(n.has(o.type)){if(Fe(o.text)){i.push({startLine:s.startPosition.row,endLine:s.endPosition.row,reason:"scip-query suppression comment"});break}continue}if(!(o.type==="attribute_item"||o.type==="inner_attribute_item"))break}}for(let a of s.namedChildren)r(a)};return r(e.rootNode),i}function Te(e,t){let n=P(e,t);if(!n)return[];let i=x.get(n);if(i)return i;let r=[],s=Ae(n);return s?(x.set(n,s),s):(fe(n.rootNode,r,!1,!1),r.push(...de(n,new Set(["function_item","function_signature_item","struct_item","enum_item","union_item","impl_item","mod_item","static_item","const_item"]),new Set(["line_comment","block_comment"]))),r.push(...He(n.rootNode)),x.set(n,r),r)}function Ae(e){return Ve(e.rootNode)?[{startLine:0,endLine:e.rootNode.endPosition.row,reason:"generated file (@generated header)"}]:null}function fe(e,t,n,i){let r=n,s=i;e.type==="trait_item"&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait declaration body (dynamic dispatch)"}),e.type==="impl_item"&&e.childForFieldName("trait")&&(s=!0,t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl block (dynamic dispatch)"})),e.type==="function_item"||e.type==="function_signature_item"?Me(e,t,n,i):i&&Ue(e)?t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl associated item (dynamic dispatch)"}):e.type==="struct_item"||e.type==="enum_item"||e.type==="union_item"?Oe(e,t,n):e.type==="mod_item"&&k(e).some(a=>/#\[\s*cfg\s*\(\s*test\s*\)/.test(a))&&(r=!0);for(let a of e.namedChildren)fe(a,t,r,s)}function Me(e,t,n,i){let r=k(e),s=null;i?s="trait impl method (dynamic dispatch)":n&&(s="inside #[cfg(test)] mod");for(let a of r){let u=je(a);if(u){s=u;break}if(me(a)){s="#[allow(dead_code)]";break}}s&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:s})}function Oe(e,t,n){let i=k(e),r=e.namedChildren.find(s=>s.type==="type_identifier")?.text;i.some(We)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[derive(<reflective>)] \u2014 fields accessed via macro/reflection",containerName:r}),i.some(me)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[allow(dead_code)]",containerName:r}),n&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"inside #[cfg(test)] mod",containerName:r})}function k(e){let t=e.parent;if(!t)return[];let n=t.children,i=-1;for(let s=0;s<n.length;s+=1)if(n[s].startIndex===e.startIndex&&n[s].type===e.type){i=s;break}if(i<=0)return[];let r=[];for(let s=i-1;s>=0;s-=1){let a=n[s];if(a.type==="attribute_item"||a.type==="inner_attribute_item")r.push(a.text);else{if(a.type==="line_comment"||a.type==="block_comment")continue;break}}return r}var Be=[{re:/#\[\s*tauri::command\b/,reason:"#[tauri::command]"},{re:/#\[\s*command\b/,reason:"#[command]"},{re:/#\[\s*test\b/,reason:"#[test]"},{re:/#\[\s*bench\b/,reason:"#[bench]"},{re:/#\[\s*tokio::test\b/,reason:"#[tokio::test]"},{re:/#\[\s*async_std::test\b/,reason:"#[async_std::test]"},{re:/#\[\s*wasm_bindgen\b/,reason:"#[wasm_bindgen]"},{re:/#\[\s*no_mangle\b/,reason:"#[no_mangle]"},{re:/#\[\s*napi\b/,reason:"#[napi]"},{re:/#\[\s*pyfunction\b/,reason:"#[pyfunction]"},{re:/#\[\s*pymethod\b/,reason:"#[pymethod]"},{re:/#\[\s*pyo3\b/,reason:"#[pyo3]"},{re:/#\[\s*cfg\s*\(\s*test\s*\)/,reason:"#[cfg(test)]"},{re:/#\[\s*doc\s*\(\s*hidden\s*\)/,reason:"#[doc(hidden)]"}];function je(e){return Be.find(({re:t})=>t.test(e))?.reason??null}var ze=[/\bSerialize\b/,/\bDeserialize\b/,/\bFromRow\b/,/\bsqlx::FromRow\b/,/\bDeriveEntityModel\b/,/\bIntoSchema\b/,/\bToSchema\b/,/\bDeriveValueType\b/,/\bError\b/,/\bthiserror::Error\b/];function We(e){return/#\[\s*derive\s*\(/.test(e)?ze.some(t=>t.test(e)):!1}function me(e){return/#\[\s*allow\s*\(\s*dead_code\s*\)/.test(e)}function Ue(e){return e.type==="const_item"||e.type==="type_item"||e.type==="static_item"||e.type==="associated_type"}function He(e){let t=Ze(e);if(t.size===0)return[];let n=[];for(let i of e.descendantsOfType("mod_item")){let r=i.childForFieldName("name")?.text;r&&t.has(r)&&n.push({startLine:i.startPosition.row,endLine:i.endPosition.row,reason:'serde `with = "..."` module \u2014 body invoked via reflection',containerName:r})}return n}function Ve(e){for(let t=0;t<Math.min(e.namedChildCount,12);t+=1){let n=e.namedChild(t);if(!n||n.type!=="line_comment"&&n.type!=="block_comment")break;if(/@generated\b/.test(n.text)||/This file is .*generated\b/i.test(n.text)||/Code generated by/i.test(n.text)||/Generated by:\s*https?:\/\/openapi-generator/i.test(n.text)||/openapi-generator/i.test(n.text)&&/Generated by/i.test(n.text))return!0}return!1}var Ke=/^#!?\[\s*serde\s*\(/,ce=/\bwith\s*=\s*"([^"]+)"/g;function Ze(e){let t=new Set;for(let n of e.descendantsOfType("attribute_item")){if(!Ke.test(n.text))continue;ce.lastIndex=0;let i;for(;(i=ce.exec(n.text))!==null;){let r=i[1],s=r.split("::").pop()??r;s&&t.add(s)}}return t}function pe(e){let t=new Map,n=i=>{let r=t.get(i);if(r)return r;let s=le(e,i);return r={ranges:s.map(a=>({startLine:a.startLine,endLine:a.endLine})),containers:new Set(s.map(a=>a.containerName).filter(a=>!!a))},t.set(i,r),r};return(i,r,s,a)=>{let u=n(i);for(let l of u.ranges)if(r>=l.startLine&&r<=l.endLine)return!0;if(a&&u.containers.has(a))return!0;for(let l of _(s))if(u.containers.has(l))return!0;return!1}}function gt(e,t={}){L(e,{groups:t.semanticProvider===!0?["whole-project","semantic-provider"]:["whole-project"]})}function be(e,t,n={}){L(e,{groups:n.definitions===!0?["source-file","definition-catalog"]:["source-file"],file:t.replace(/\\/g,"/")})}function ye(e,t){return t.isIgnoredPath(e.relativePath)?y("ignored-file"):K(e.symbol)?y("module-like-symbol"):E(e.symbol)?!e.isFunctionLike&&e.enclosingSymbol&&E(e.enclosingSymbol)?y("nested-non-callable-value"):!t.includeTests&&!S(e.relativePath)?y("test-file"):!t.includeTests&&t.isExcludedRegion(e.relativePath,e.startLine,e.symbol,e.parentTypeName)?y("excluded-file-region"):Z(e.symbol)?y("rust-trait-impl-member"):q(e.symbol)?y("rust-test-module"):!t.includeMembers&&!qe(e)?y("member"):e.endLine-e.startLine+1<t.minLoc?y("below-min-loc"):{accepted:!0}:y("non-value-symbol")}function S(e){return J(e)!=="test"}function y(e){return{accepted:!1,rejectionReason:e}}function E(e){return V(e)||e.endsWith("().")||e.endsWith(".")}function qe(e){return H(e.symbol)||_(e.symbol).length===0}function ge(){return new Map}function he(e,t,n){let i=new Map;for(let r of Y(e,n))e.isIgnored(r.relative_path)||t.has(r.relative_path)||v(i,r.symbol_id,r.relative_path,r.ref_count,"scip-mention");return i}function xe(e,t,n,i={}){let r=new Set;if(i.conservative||n.size===0){for(let s of te(e,t))r.add(s.symbol_id);return r}for(let s of ee(e,t))e.isIgnored(s.relative_path)||n.has(s.relative_path)||r.add(s.symbol_id);return r}function F(e,t){let n=e.get(t);if(!n)return!1;for(let i of n.values())if(i.occurrences>0)return!0;return!1}function C(e,t,n){let i=e.get(t);if(!i)return!1;for(let[r,s]of i)if(r!==n&&s.occurrences>0)return!0;return!1}function Se(e){return e?.occurrences??0}function v(e,t,n,i,r="source-fallback"){if(i<=0)return;let s=_e(e,t,n);s.occurrences+=i,s.sources.add(r)}function Re(e,t,n,i,r){if(i<=0)return;let s=_e(e,t,n);s.occurrences=Math.max(i,s.occurrences),s.sources.add(r)}function _e(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));let r=i.get(n);return r||(r={occurrences:0,sources:new Set},i.set(n,r)),r}var Je=3e3,$e=1e3;function Ut(e,t={}){let{scope:n,minLoc:i=1,includeTests:r=!1,skipBarrels:s=!1,includeMembers:a=!1,deadCodeOnly:u=!1,scanLimit:l,semantic:d=!0}=t,o=0,c=b("dead.candidates",()=>{let f=oe(Ge(e,{scope:n,minLoc:i,includeTests:r,includeMembers:a}),l);return o=f.length,f},()=>({definitions:o})),p=0,m=s?b("dead.inactive-barrels",()=>{let f=new Set($(e));return p=f.size,f},()=>({paths:p})):new Set,T=0,g=u?ge():b("dead.mention-reference-counts",()=>{let f=he(e,m,c.map(D=>D.symbolId));return T=f.size,f},()=>({definitions:c.length,symbolsWithReferences:T})),A=0,Ce=u?b("dead.mentioned-symbol-ids",()=>{let f=xe(e,c.map(D=>D.symbolId),m,{conservative:m.size===0});return A=f.size,f},()=>({definitions:c.length,referencedSymbols:A})):new Set,h=u?c.filter(f=>!Ce.has(f.symbolId)):c.filter(f=>!C(g,f.symbolId,f.relativePath));u?b("dead.source-fallback.dead-code-only",()=>tt(e,h,g,{includeTests:r,inactiveBarrelPaths:m}),()=>({definitions:h.length,includeTests:r})):b("dead.source-fallback.ast",()=>et(e,h,g,{includeTests:r,inactiveBarrelPaths:m}),()=>({definitions:h.length,includeTests:r}));let M=u?h.filter(f=>!F(g,f.symbolId)):h.filter(f=>!C(g,f.symbolId,f.relativePath));b("dead.caller-map-supplement",()=>ot(e,M,g,{includeTests:r,inactiveBarrelPaths:m,includeSemantic:!u&&d}),()=>({definitions:M.length,semantic:!u&&d}));let ve=u?h.filter(f=>!F(g,f.symbolId)):c;return Ye(e,Xe(ve,g))}function Ge(e,t){let n=pe(e),i=[];for(let r of Q(e,{scope:t.scope,symbolMatches:E,sqlPrefilter:"function-like"}))ye(r,{minLoc:t.minLoc,includeTests:t.includeTests,includeMembers:t.includeMembers,isIgnoredPath:a=>e.isIgnored(a),isExcludedRegion:n}).accepted&&i.push(r);return i}function Xe(e,t){return e.map(n=>Qe(n,t)).filter(n=>n.cross_file_refs===0).sort((n,i)=>i.loc-n.loc||n.relative_path.localeCompare(i.relative_path)||n.start_line-i.start_line)}function Qe(e,t){let n=t.get(e.symbolId)??new Map,i=Se(n.get(e.relativePath)),r=0;for(let[s,a]of n)s!==e.relativePath&&(r+=a.occurrences);return{relative_path:e.relativePath,start_line:e.startLine,end_line:e.endLine,loc:e.endLine-e.startLine+1,symbol:e.symbol,same_file_refs:i,cross_file_refs:r}}function Ye(e,t){let n=[],i=0,r=0,s=0;for(let a of t){if(e.isIgnored(a.relative_path)||G(e,a.relative_path)||X(e,a.symbol,a.relative_path))continue;let u=a.same_file_refs===0?"dead-code":"file-internal";u==="dead-code"?i++:r++,s+=a.loc,n.push({relativePath:a.relative_path,startLine:a.start_line,endLine:a.end_line,loc:a.loc,symbol:a.symbol,shortName:U(a.symbol),sameFileRefs:a.same_file_refs,kind:u})}return{symbols:n,counts:{total:n.length,deadCode:i,fileInternal:r,loc:s},totalCount:n.length,deadCodeCount:i,fileInternalCount:r,totalLoc:s}}function et(e,t,n,i){if(t.length===0)return;let r=new N(e),s=new Set(t.map(l=>l.symbolId)),a=new Set(t.map(l=>l.leaf).filter(Boolean)),u=new Set(r.sourceFiles());for(let l of R(e))u.add(l);r.scanSourceReferences({paths:u,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:a,skipPath:l=>i.inactiveBarrelPaths.has(l)||!i.includeTests&&!S(l)},l=>{s.has(l.target.symbolId)&&(it(e,l)||v(n,l.target.symbolId,l.sourceFile,st(l),"source-fallback"))})}function tt(e,t,n,i){if(t.length===0)return;let r=new N(e),s=nt(t),a=new Set(r.sourceFiles());for(let o of R(e))a.add(o);let u=new Set(s.keys()),l=new Map,d=o=>{let c=l.get(o);return c||(c=ie(e,o),l.set(o,c)),c};r.scanSourceReferences({paths:a,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:u,skipPath:o=>i.inactiveBarrelPaths.has(o)||!i.includeTests&&!S(o),resolveTargets:({sourceFile:o,name:c,kind:p})=>{let m=s.get(c);return m?rt(o,c,m,()=>d(o),{permissive:p!=="cross-language-dispatch"}):[]},afterPath:o=>{l.delete(o),be(e,o)}},o=>{let c=o.kind==="identifier"&&o.sourceFile===o.target.relativePath?Math.max(0,o.occurrences-1):o.occurrences;o.kind==="identifier"&&Ee(e,{sourceFile:o.sourceFile,name:o.name,target:o.target,occurrences:c})||v(n,o.target.symbolId,o.sourceFile,c,"source-fallback")})}function nt(e){let t=new Map;for(let n of e){if(!n.leaf)continue;let i=t.get(n.leaf)??[];i.push(n),t.set(n.leaf,i)}return t}function rt(e,t,n,i,r){let s=n.filter(d=>d.relativePath===e);if(s.length>0)return s;if(!r.permissive&&n.length===1)return[...n];let a=i(),u=a.get(t);if(u)for(let d of u){let o=n.filter(c=>w(d,c.relativePath));if(o.length>0)return o}let l=new Set;for(let d of a.values())for(let o of d)l.add(o);for(let d of l){let o=n.filter(c=>w(d,c.relativePath));if(o.length>0&&o.length===n.length)return o}return r.permissive?[...n]:[]}function it(e,t){return t.kind==="cross-language-dispatch"&&t.target.relativePath===t.sourceFile?!0:t.kind==="identifier"&&Ee(e,t)}function st(e){return e.kind==="identifier"&&e.target.relativePath===e.sourceFile?Math.max(0,e.occurrences-1):e.occurrences}function Ee(e,t){return t.occurrences>1?!1:W(e,t.sourceFile).some(n=>n.used||n.sourcePath!==t.target.relativePath?!1:n.importedName===t.name||n.localName===t.name)}function ot(e,t,n,i){let r=i.includeSemantic!==!1,s=r&&t.length>=Je&&R(e).length>=$e,a=(o,c)=>{c===o.relativePath||e.isIgnored(c)||i.inactiveBarrelPaths.has(c)||!i.includeTests&&!S(c)||Re(n,o.symbolId,c,1,"caller-map")};if(s?b("dead.caller-map.mention-chunks",()=>at(e,t,a),()=>({definitions:t.length})):b("dead.caller-map.per-symbol",()=>{for(let o of t){let c=se(e,o,{semantic:r});if(c.length!==0)for(let p of c)a(o,p.file)}},()=>({definitions:t.length,semantic:r})),!s)return;let u=0,l=b("dead.caller-map.semantic-candidates",()=>{let o=t.filter(c=>!C(n,c.symbolId,c.relativePath));return u=o.length,o},()=>({definitions:t.length,semanticCandidates:u}));if(l.length===0)return;let d=re(e,l);for(let o of l){let c=d.get(o.symbolId);if(c)for(let p of c)a(o,p)}}function at(e,t,n){let i=new Map(t.map(r=>[r.symbolId,r]));for(let r of ne(e,[...i.keys()])){let s=i.get(r.symbol_id);s&&n(s,r.relative_path)}}export{gt as a,Ut as b};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as oe}from"./chunk-B75HZHUP.js";import{a as N}from"./chunk-IMQFJ53K.js";import{b as J,e as $,f as G,g as X}from"./chunk-BZXE3HO4.js";import{c as se}from"./chunk-5VY3RIEI.js";import{c as Y,d as ee,e as te,f as ne,l as ie}from"./chunk-GULVO6NF.js";import{e as re}from"./chunk-WMO2VZZK.js";import{j as Q,o as _}from"./chunk-7TVFPOD7.js";import{d as U,g as H,h as V,i as K,j as Z,k as q}from"./chunk-X5C43YVI.js";import{o as W}from"./chunk-JZBGTSAB.js";import{A as P,x as z}from"./chunk-ISLWJ4PY.js";import{b as O,l as b,m as B,o as j,p as I}from"./chunk-WS3Z6W3M.js";import{c as w}from"./chunk-GNG622H3.js";import{a as R}from"./chunk-64MNV6AB.js";import{b as L}from"./chunk-7S5E7KWT.js";var x=new WeakMap,ae=B({kind:"definition-exclusions",invalidation:j("definition-exclusions"),serialize:e=>JSON.stringify(e),deserialize:De});function le(e,t){let n=z(t);if(!(n==="rust"||n==="typescript"||n==="tsx"||n==="javascript"))return[];let r=I(e,t);if(!r)return[];let s=O(e,t,r),a=ae.read(e,t,s);if(a)return a;let u=n==="rust"?Te(e,t):Pe(e,t);return ae.write(e,t,s,u),u}function De(e){try{let t=JSON.parse(e);return!Array.isArray(t)||!t.every(Le)?null:t}catch{return null}}function Le(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.startLine!="number"||!Number.isFinite(t.startLine)||typeof t.endLine!="number"||!Number.isFinite(t.endLine)||typeof t.reason!="string"?!1:t.containerName===void 0||typeof t.containerName=="string"}var ue=new Set(["describe","it","test","fdescribe","fit","xdescribe","xit","beforeEach","afterEach","beforeAll","afterAll","before","after","suite","bench","benchmark"]),we=/\b(?:describe|it|test|fdescribe|fit|xdescribe|xit|beforeEach|afterEach|beforeAll|afterAll|before|after|suite|bench|benchmark)\s*\(/,Ie=/\b(?:export\s+)?(?:async\s+)?function\s+use[A-Z][A-Za-z0-9_$]*\b|\b(?:const|let|var)\s+use[A-Z][A-Za-z0-9_$]*\s*(?::[^=;]+)?=\s*(?:async\s*)?(?:function\b|(?:<[^=;{]+>\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*=>)/;function Pe(e,t){let n=I(e,t);if(!n||!Ne(n))return[];let i=P(e,t);if(!i)return[];let r=x.get(i);if(r)return r;let s=!1,a=i.rootNode;for(let l of a.namedChildren){if(l.type!=="expression_statement")continue;let d=l.namedChild(0);if(!d||d.type!=="call_expression")continue;let o=d.namedChild(0);if(!o)continue;let c=o.type==="member_expression"?o.namedChild(o.namedChildCount-1)?.text:o.text;if(c&&ue.has(c)){s=!0;break}}let u=[];s&&u.push({startLine:0,endLine:a.endPosition.row,reason:"TS/JS test file (describe/it/test at top level)"});for(let l of a.namedChildren){let d=null,o=null;if(l.type==="function_declaration")d=l.namedChild(0)?.text??null,o=l;else if(l.type==="export_statement"){let c=l.namedChild(0);c?.type==="function_declaration"&&(d=c.namedChild(0)?.text??null,o=c)}else if(l.type==="lexical_declaration"){let c=l.namedChild(0);if(c?.type==="variable_declarator"){let p=c.namedChild(0)?.text,m=c.namedChild(1);p&&(m?.type==="arrow_function"||m?.type==="function_expression")&&(d=p,o=c)}}d&&/^use[A-Z]/.test(d)&&o&&u.push({startLine:o.startPosition.row,endLine:o.endPosition.row,reason:"React custom hook (use*)"})}return u.push(...de(i,new Set(["function_declaration","method_definition","class_declaration","interface_declaration","type_alias_declaration","enum_declaration","variable_declarator","export_statement"]),new Set(["comment"]))),x.set(i,u),u}function Ne(e){if(e.includes("scip-query"))return!0;let t=!1;for(let n of ue)if(e.includes(n)){t=!0;break}return t&&we.test(e)?!0:e.includes("use")&&Ie.test(e)}var ke=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale)?/i;function Fe(e){return ke.test(e)}function de(e,t,n){let i=[],r=s=>{if(t.has(s.type)&&s.parent){let u=s.parent.children,l=-1;for(let d=0;d<u.length;d+=1)if(u[d].startIndex===s.startIndex&&u[d].type===s.type){l=d;break}if(l>0)for(let d=l-1;d>=0;d-=1){let o=u[d];if(n.has(o.type)){if(Fe(o.text)){i.push({startLine:s.startPosition.row,endLine:s.endPosition.row,reason:"scip-query suppression comment"});break}continue}if(!(o.type==="attribute_item"||o.type==="inner_attribute_item"))break}}for(let a of s.namedChildren)r(a)};return r(e.rootNode),i}function Te(e,t){let n=P(e,t);if(!n)return[];let i=x.get(n);if(i)return i;let r=[],s=Ae(n);return s?(x.set(n,s),s):(fe(n.rootNode,r,!1,!1),r.push(...de(n,new Set(["function_item","function_signature_item","struct_item","enum_item","union_item","impl_item","mod_item","static_item","const_item"]),new Set(["line_comment","block_comment"]))),r.push(...He(n.rootNode)),x.set(n,r),r)}function Ae(e){return Ve(e.rootNode)?[{startLine:0,endLine:e.rootNode.endPosition.row,reason:"generated file (@generated header)"}]:null}function fe(e,t,n,i){let r=n,s=i;e.type==="trait_item"&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait declaration body (dynamic dispatch)"}),e.type==="impl_item"&&e.childForFieldName("trait")&&(s=!0,t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl block (dynamic dispatch)"})),e.type==="function_item"||e.type==="function_signature_item"?Me(e,t,n,i):i&&Ue(e)?t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl associated item (dynamic dispatch)"}):e.type==="struct_item"||e.type==="enum_item"||e.type==="union_item"?Oe(e,t,n):e.type==="mod_item"&&k(e).some(a=>/#\[\s*cfg\s*\(\s*test\s*\)/.test(a))&&(r=!0);for(let a of e.namedChildren)fe(a,t,r,s)}function Me(e,t,n,i){let r=k(e),s=null;i?s="trait impl method (dynamic dispatch)":n&&(s="inside #[cfg(test)] mod");for(let a of r){let u=je(a);if(u){s=u;break}if(me(a)){s="#[allow(dead_code)]";break}}s&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:s})}function Oe(e,t,n){let i=k(e),r=e.namedChildren.find(s=>s.type==="type_identifier")?.text;i.some(We)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[derive(<reflective>)] \u2014 fields accessed via macro/reflection",containerName:r}),i.some(me)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[allow(dead_code)]",containerName:r}),n&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"inside #[cfg(test)] mod",containerName:r})}function k(e){let t=e.parent;if(!t)return[];let n=t.children,i=-1;for(let s=0;s<n.length;s+=1)if(n[s].startIndex===e.startIndex&&n[s].type===e.type){i=s;break}if(i<=0)return[];let r=[];for(let s=i-1;s>=0;s-=1){let a=n[s];if(a.type==="attribute_item"||a.type==="inner_attribute_item")r.push(a.text);else{if(a.type==="line_comment"||a.type==="block_comment")continue;break}}return r}var Be=[{re:/#\[\s*tauri::command\b/,reason:"#[tauri::command]"},{re:/#\[\s*command\b/,reason:"#[command]"},{re:/#\[\s*test\b/,reason:"#[test]"},{re:/#\[\s*bench\b/,reason:"#[bench]"},{re:/#\[\s*tokio::test\b/,reason:"#[tokio::test]"},{re:/#\[\s*async_std::test\b/,reason:"#[async_std::test]"},{re:/#\[\s*wasm_bindgen\b/,reason:"#[wasm_bindgen]"},{re:/#\[\s*no_mangle\b/,reason:"#[no_mangle]"},{re:/#\[\s*napi\b/,reason:"#[napi]"},{re:/#\[\s*pyfunction\b/,reason:"#[pyfunction]"},{re:/#\[\s*pymethod\b/,reason:"#[pymethod]"},{re:/#\[\s*pyo3\b/,reason:"#[pyo3]"},{re:/#\[\s*cfg\s*\(\s*test\s*\)/,reason:"#[cfg(test)]"},{re:/#\[\s*doc\s*\(\s*hidden\s*\)/,reason:"#[doc(hidden)]"}];function je(e){return Be.find(({re:t})=>t.test(e))?.reason??null}var ze=[/\bSerialize\b/,/\bDeserialize\b/,/\bFromRow\b/,/\bsqlx::FromRow\b/,/\bDeriveEntityModel\b/,/\bIntoSchema\b/,/\bToSchema\b/,/\bDeriveValueType\b/,/\bError\b/,/\bthiserror::Error\b/];function We(e){return/#\[\s*derive\s*\(/.test(e)?ze.some(t=>t.test(e)):!1}function me(e){return/#\[\s*allow\s*\(\s*dead_code\s*\)/.test(e)}function Ue(e){return e.type==="const_item"||e.type==="type_item"||e.type==="static_item"||e.type==="associated_type"}function He(e){let t=Ze(e);if(t.size===0)return[];let n=[];for(let i of e.descendantsOfType("mod_item")){let r=i.childForFieldName("name")?.text;r&&t.has(r)&&n.push({startLine:i.startPosition.row,endLine:i.endPosition.row,reason:'serde `with = "..."` module \u2014 body invoked via reflection',containerName:r})}return n}function Ve(e){for(let t=0;t<Math.min(e.namedChildCount,12);t+=1){let n=e.namedChild(t);if(!n||n.type!=="line_comment"&&n.type!=="block_comment")break;if(/@generated\b/.test(n.text)||/This file is .*generated\b/i.test(n.text)||/Code generated by/i.test(n.text)||/Generated by:\s*https?:\/\/openapi-generator/i.test(n.text)||/openapi-generator/i.test(n.text)&&/Generated by/i.test(n.text))return!0}return!1}var Ke=/^#!?\[\s*serde\s*\(/,ce=/\bwith\s*=\s*"([^"]+)"/g;function Ze(e){let t=new Set;for(let n of e.descendantsOfType("attribute_item")){if(!Ke.test(n.text))continue;ce.lastIndex=0;let i;for(;(i=ce.exec(n.text))!==null;){let r=i[1],s=r.split("::").pop()??r;s&&t.add(s)}}return t}function pe(e){let t=new Map,n=i=>{let r=t.get(i);if(r)return r;let s=le(e,i);return r={ranges:s.map(a=>({startLine:a.startLine,endLine:a.endLine})),containers:new Set(s.map(a=>a.containerName).filter(a=>!!a))},t.set(i,r),r};return(i,r,s,a)=>{let u=n(i);for(let l of u.ranges)if(r>=l.startLine&&r<=l.endLine)return!0;if(a&&u.containers.has(a))return!0;for(let l of _(s))if(u.containers.has(l))return!0;return!1}}function gt(e,t={}){L(e,{groups:t.semanticProvider===!0?["whole-project","semantic-provider"]:["whole-project"]})}function be(e,t,n={}){L(e,{groups:n.definitions===!0?["source-file","definition-catalog"]:["source-file"],file:t.replace(/\\/g,"/")})}function ye(e,t){return t.isIgnoredPath(e.relativePath)?y("ignored-file"):K(e.symbol)?y("module-like-symbol"):E(e.symbol)?!e.isFunctionLike&&e.enclosingSymbol&&E(e.enclosingSymbol)?y("nested-non-callable-value"):!t.includeTests&&!S(e.relativePath)?y("test-file"):!t.includeTests&&t.isExcludedRegion(e.relativePath,e.startLine,e.symbol,e.parentTypeName)?y("excluded-file-region"):Z(e.symbol)?y("rust-trait-impl-member"):q(e.symbol)?y("rust-test-module"):!t.includeMembers&&!qe(e)?y("member"):e.endLine-e.startLine+1<t.minLoc?y("below-min-loc"):{accepted:!0}:y("non-value-symbol")}function S(e){return J(e)!=="test"}function y(e){return{accepted:!1,rejectionReason:e}}function E(e){return V(e)||e.endsWith("().")||e.endsWith(".")}function qe(e){return H(e.symbol)||_(e.symbol).length===0}function ge(){return new Map}function he(e,t,n){let i=new Map;for(let r of Y(e,n))e.isIgnored(r.relative_path)||t.has(r.relative_path)||v(i,r.symbol_id,r.relative_path,r.ref_count,"scip-mention");return i}function xe(e,t,n,i={}){let r=new Set;if(i.conservative||n.size===0){for(let s of te(e,t))r.add(s.symbol_id);return r}for(let s of ee(e,t))e.isIgnored(s.relative_path)||n.has(s.relative_path)||r.add(s.symbol_id);return r}function F(e,t){let n=e.get(t);if(!n)return!1;for(let i of n.values())if(i.occurrences>0)return!0;return!1}function C(e,t,n){let i=e.get(t);if(!i)return!1;for(let[r,s]of i)if(r!==n&&s.occurrences>0)return!0;return!1}function Se(e){return e?.occurrences??0}function v(e,t,n,i,r="source-fallback"){if(i<=0)return;let s=_e(e,t,n);s.occurrences+=i,s.sources.add(r)}function Re(e,t,n,i,r){if(i<=0)return;let s=_e(e,t,n);s.occurrences=Math.max(i,s.occurrences),s.sources.add(r)}function _e(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));let r=i.get(n);return r||(r={occurrences:0,sources:new Set},i.set(n,r)),r}var Je=3e3,$e=1e3;function Ut(e,t={}){let{scope:n,minLoc:i=1,includeTests:r=!1,skipBarrels:s=!1,includeMembers:a=!1,deadCodeOnly:u=!1,scanLimit:l,semantic:d=!0}=t,o=0,c=b("dead.candidates",()=>{let f=oe(Ge(e,{scope:n,minLoc:i,includeTests:r,includeMembers:a}),l);return o=f.length,f},()=>({definitions:o})),p=0,m=s?b("dead.inactive-barrels",()=>{let f=new Set($(e));return p=f.size,f},()=>({paths:p})):new Set,T=0,g=u?ge():b("dead.mention-reference-counts",()=>{let f=he(e,m,c.map(D=>D.symbolId));return T=f.size,f},()=>({definitions:c.length,symbolsWithReferences:T})),A=0,Ce=u?b("dead.mentioned-symbol-ids",()=>{let f=xe(e,c.map(D=>D.symbolId),m,{conservative:m.size===0});return A=f.size,f},()=>({definitions:c.length,referencedSymbols:A})):new Set,h=u?c.filter(f=>!Ce.has(f.symbolId)):c.filter(f=>!C(g,f.symbolId,f.relativePath));u?b("dead.source-fallback.dead-code-only",()=>tt(e,h,g,{includeTests:r,inactiveBarrelPaths:m}),()=>({definitions:h.length,includeTests:r})):b("dead.source-fallback.ast",()=>et(e,h,g,{includeTests:r,inactiveBarrelPaths:m}),()=>({definitions:h.length,includeTests:r}));let M=u?h.filter(f=>!F(g,f.symbolId)):h.filter(f=>!C(g,f.symbolId,f.relativePath));b("dead.caller-map-supplement",()=>ot(e,M,g,{includeTests:r,inactiveBarrelPaths:m,includeSemantic:!u&&d}),()=>({definitions:M.length,semantic:!u&&d}));let ve=u?h.filter(f=>!F(g,f.symbolId)):c;return Ye(e,Xe(ve,g))}function Ge(e,t){let n=pe(e),i=[];for(let r of Q(e,{scope:t.scope,symbolMatches:E,sqlPrefilter:"function-like"}))ye(r,{minLoc:t.minLoc,includeTests:t.includeTests,includeMembers:t.includeMembers,isIgnoredPath:a=>e.isIgnored(a),isExcludedRegion:n}).accepted&&i.push(r);return i}function Xe(e,t){return e.map(n=>Qe(n,t)).filter(n=>n.cross_file_refs===0).sort((n,i)=>i.loc-n.loc||n.relative_path.localeCompare(i.relative_path)||n.start_line-i.start_line)}function Qe(e,t){let n=t.get(e.symbolId)??new Map,i=Se(n.get(e.relativePath)),r=0;for(let[s,a]of n)s!==e.relativePath&&(r+=a.occurrences);return{relative_path:e.relativePath,start_line:e.startLine,end_line:e.endLine,loc:e.endLine-e.startLine+1,symbol:e.symbol,same_file_refs:i,cross_file_refs:r}}function Ye(e,t){let n=[],i=0,r=0,s=0;for(let a of t){if(e.isIgnored(a.relative_path)||G(e,a.relative_path)||X(e,a.symbol,a.relative_path))continue;let u=a.same_file_refs===0?"dead-code":"file-internal";u==="dead-code"?i++:r++,s+=a.loc,n.push({relativePath:a.relative_path,startLine:a.start_line,endLine:a.end_line,loc:a.loc,symbol:a.symbol,shortName:U(a.symbol),sameFileRefs:a.same_file_refs,kind:u})}return{symbols:n,counts:{total:n.length,deadCode:i,fileInternal:r,loc:s},totalCount:n.length,deadCodeCount:i,fileInternalCount:r,totalLoc:s}}function et(e,t,n,i){if(t.length===0)return;let r=new N(e),s=new Set(t.map(l=>l.symbolId)),a=new Set(t.map(l=>l.leaf).filter(Boolean)),u=new Set(r.sourceFiles());for(let l of R(e))u.add(l);r.scanSourceReferences({paths:u,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:a,skipPath:l=>i.inactiveBarrelPaths.has(l)||!i.includeTests&&!S(l)},l=>{s.has(l.target.symbolId)&&(it(e,l)||v(n,l.target.symbolId,l.sourceFile,st(l),"source-fallback"))})}function tt(e,t,n,i){if(t.length===0)return;let r=new N(e),s=nt(t),a=new Set(r.sourceFiles());for(let o of R(e))a.add(o);let u=new Set(s.keys()),l=new Map,d=o=>{let c=l.get(o);return c||(c=ie(e,o),l.set(o,c)),c};r.scanSourceReferences({paths:a,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:u,skipPath:o=>i.inactiveBarrelPaths.has(o)||!i.includeTests&&!S(o),resolveTargets:({sourceFile:o,name:c,kind:p})=>{let m=s.get(c);return m?rt(o,c,m,()=>d(o),{permissive:p!=="cross-language-dispatch"}):[]},afterPath:o=>{l.delete(o),be(e,o)}},o=>{let c=o.kind==="identifier"&&o.sourceFile===o.target.relativePath?Math.max(0,o.occurrences-1):o.occurrences;o.kind==="identifier"&&Ee(e,{sourceFile:o.sourceFile,name:o.name,target:o.target,occurrences:c})||v(n,o.target.symbolId,o.sourceFile,c,"source-fallback")})}function nt(e){let t=new Map;for(let n of e){if(!n.leaf)continue;let i=t.get(n.leaf)??[];i.push(n),t.set(n.leaf,i)}return t}function rt(e,t,n,i,r){let s=n.filter(d=>d.relativePath===e);if(s.length>0)return s;if(!r.permissive&&n.length===1)return[...n];let a=i(),u=a.get(t);if(u)for(let d of u){let o=n.filter(c=>w(d,c.relativePath));if(o.length>0)return o}let l=new Set;for(let d of a.values())for(let o of d)l.add(o);for(let d of l){let o=n.filter(c=>w(d,c.relativePath));if(o.length>0&&o.length===n.length)return o}return r.permissive?[...n]:[]}function it(e,t){return t.kind==="cross-language-dispatch"&&t.target.relativePath===t.sourceFile?!0:t.kind==="identifier"&&Ee(e,t)}function st(e){return e.kind==="identifier"&&e.target.relativePath===e.sourceFile?Math.max(0,e.occurrences-1):e.occurrences}function Ee(e,t){return t.occurrences>1?!1:W(e,t.sourceFile).some(n=>n.used||n.sourcePath!==t.target.relativePath?!1:n.importedName===t.name||n.localName===t.name)}function ot(e,t,n,i){let r=i.includeSemantic!==!1,s=r&&t.length>=Je&&R(e).length>=$e,a=(o,c)=>{c===o.relativePath||e.isIgnored(c)||i.inactiveBarrelPaths.has(c)||!i.includeTests&&!S(c)||Re(n,o.symbolId,c,1,"caller-map")};if(s?b("dead.caller-map.mention-chunks",()=>at(e,t,a),()=>({definitions:t.length})):b("dead.caller-map.per-symbol",()=>{for(let o of t){let c=se(e,o,{semantic:r});if(c.length!==0)for(let p of c)a(o,p.file)}},()=>({definitions:t.length,semantic:r})),!s)return;let u=0,l=b("dead.caller-map.semantic-candidates",()=>{let o=t.filter(c=>!C(n,c.symbolId,c.relativePath));return u=o.length,o},()=>({definitions:t.length,semanticCandidates:u}));if(l.length===0)return;let d=re(e,l);for(let o of l){let c=d.get(o.symbolId);if(c)for(let p of c)a(o,p)}}function at(e,t,n){let i=new Map(t.map(r=>[r.symbolId,r]));for(let r of ne(e,[...i.keys()])){let s=i.get(r.symbol_id);s&&n(s,r.relative_path)}}export{gt as a,Ut as b};
|
|
2
|
+
//# sourceMappingURL=chunk-QVGFVRKD.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{q as d}from"./chunk-
|
|
1
|
+
import{q as d}from"./chunk-GULVO6NF.js";import{a as h}from"./chunk-27HMTUJE.js";import{h as g}from"./chunk-X5C43YVI.js";import{p as m}from"./chunk-WS3Z6W3M.js";import{a as p}from"./chunk-64MNV6AB.js";function _(t,r,n={}){let e=h(t,r);if(!e)return[];let l=!g(e.symbol)&&!t.isIgnored(e.relativePath)?[{relativePath:e.relativePath,line:e.startLine}]:[],c=d(t,e,{semantic:n.semantic}).map(o=>({relativePath:o.file,line:o.line})),s=R(t,e),f=new Set,a=[];for(let o of[...l,...c,...s]){let u=`${o.relativePath}:${o.line}`;f.has(u)||(f.add(u),a.push(o))}return a}function R(t,r){if(!r.relativePath.endsWith(".rb"))return[];let n=b(r.symbol);if(n.length===0)return[];let e=[];for(let i of p(t,{extensions:[".rb"],includeIgnored:!1})){let l=m(t,i);if(!l)continue;let c=l.split(`
|
|
2
2
|
`);for(let s=0;s<c.length;s++){let f=c[s]??"";n.some(a=>new RegExp(`@${a}\\b|\\b${a}:`).test(f))&&e.push({relativePath:i,line:s})}}return e}function b(t){let n=(t.split(":").pop()??t).replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[^A-Za-z0-9_]+/g,"_").toLowerCase().replace(/^_+|_+$/g,""),e=n.split("_").filter(Boolean),i=new Set;return n&&i.add(n),e.length>=1&&i.add(e[e.length-1]),e.length>=2&&i.add(e.slice(-2).join("_")),[...i]}export{_ as a};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-QYOPMTZ6.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as d,b as m}from"./chunk-KJCDEDQW.js";import{c as u}from"./chunk-KMVGRIO2.js";import{a as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as d,b as m}from"./chunk-KJCDEDQW.js";import{c as u}from"./chunk-KMVGRIO2.js";import{a as c}from"./chunk-BP7S6V3M.js";function y(t,e={}){let{minSimilarity:o=.5,limit:l=20,scope:n,filePattern:p}=e,r=e.minDeps??(p?1:3),{profiles:i,distinctiveDeps:f}=D(t,{scope:n,minDeps:r}),s=d(i,a=>a.deps);return m({profiles:i,limit:l,filePattern:p,overrunFactor:5,candidateIndex:s,profile:{name:"similar-files"},compare:(a,g)=>F(a,g,o,f)})}function D(t,e){let{scope:o,minDeps:l}=e,n=c(t,o),{universalDeps:p,distinctiveDeps:r}=S(n),i=[];for(let[f,s]of n)s.size>=l&&i.push({file:f,deps:new Set([...s].filter(a=>!p.has(a)))});return{profiles:i,distinctiveDeps:r}}function S(t){let e=new Set,o=new Set,l=t.size;if(l===0)return{universalDeps:e,distinctiveDeps:o};let n=new Map;for(let r of t.values())for(let i of r)n.set(i,(n.get(i)??0)+1);let p=Math.max(3,Math.ceil(l*.03));for(let[r,i]of n)i>=5&&i/l>.3?e.add(r):i<=p&&o.add(r);return{universalDeps:e,distinctiveDeps:o}}function F(t,e,o,l){let n=new Set;for(let s of t.deps)e.deps.has(s)&&n.add(s);if(n.size<3||t.deps.size<4||e.deps.size<4)return null;let p=0;for(let s of n)l.has(s)&&p++;if(p<2)return null;let r=u(t.deps,e.deps);if(r<o)return null;let i=[];for(let s of t.deps)e.deps.has(s)||i.push(s);let f=[];for(let s of e.deps)t.deps.has(s)||f.push(s);return{fileA:t.file,fileB:e.file,similarity:r,sharedDeps:[...n],uniqueToA:i,uniqueToB:f}}export{y as a};
|
|
2
|
+
//# sourceMappingURL=chunk-QZOAOLLZ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as c}from"./chunk-BP7S6V3M.js";function j(e,s={}){let{minSimilarity:t=.5,limit:n=15,scope:i,minChainLength:r=3,maxChainLength:l=8}=s,a=c(e,i),o=y(a,r,l);if(o.length===0)return[];let f=d(o);return f.length<2?[]:S(x(f,t,n),n)}function d(e){let s=m(e),t=[];for(let n of e){let i=n.filter(r=>!s.has(r));i.length>=2&&t.push({original:n,filtered:i})}return t}function m(e){let{nodeFreq:s,tailFreq:t}=p(e),n=e.length*.9,i=e.length*.8,r=new Set;for(let[a,o]of s)o>n&&r.add(a);for(let[a,o]of t)o>i&&r.add(a);let l=["index.ts","index.js","cli.ts","main.ts","health.ts","health.js"];for(let a of s.keys()){let o=a.split("/").pop()??"";l.includes(o)&&r.add(a)}return r}function p(e){let s=new Map,t=new Map;for(let n of e){let i=new Set;for(let r of n)i.has(r)||(s.set(r,(s.get(r)??0)+1),i.add(r));for(let r=Math.max(0,n.length-2);r<n.length;r++)t.set(n[r],(t.get(n[r])??0)+1)}return{nodeFreq:s,tailFreq:t}}function x(e,s,t){let n=[];for(let i=0;i<e.length;i++){for(let r=i+1;r<e.length;r++){let l=b(e[i],e[r],s);l&&n.push(l)}if(n.length>t*10)break}return n.sort((i,r)=>Math.abs(r.similarity-i.similarity)>.01?r.similarity-i.similarity:i.divergencePoints.length-r.divergencePoints.length),n}function b(e,s,t){if(!C(e.filtered,s.filtered))return null;let{distance:n,ops:i}=A(e.filtered,s.filtered),r=Math.max(e.filtered.length,s.filtered.length);if(r===0)return null;let l=1-n/r;if(l<t||n===0)return null;let a=i.filter(f=>f.type==="substitute").map(f=>({index:f.indexA,nodeA:e.filtered[f.indexA],nodeB:s.filtered[f.indexB]}));return a.length===0||i.filter(f=>f.type==="match").length<2?null:{chainA:e.original,chainB:s.original,similarity:l,editDistance:n,divergencePoints:a,commonPrefix:F(e.original,s.original),commonSuffix:B(e.original,s.original)}}function C(e,s){let t=new Set(e);return s.some(n=>t.has(n))}function S(e,s){let t=[];for(let n of e)if(t.some(r=>h(n.chainA,r.chainA)&&h(n.chainB,r.chainB))||t.push(n),t.length>=s)break;return t}function y(e,s,t){let n=[];for(let r of e.keys()){if(n.length>=500)break;g(e,r,[r],new Set([r]),s,t,n,500)}return n}function g(e,s,t,n,i,r,l,a){if(l.length>=a)return;if(t.length>=r){t.length>=i&&l.push([...t]);return}let o=e.get(s);if(!o||o.size===0){t.length>=i&&l.push([...t]);return}let f=!1;for(let u of o)if(!n.has(u)&&(n.add(u),t.push(u),g(e,u,t,n,i,r,l,a),t.pop(),n.delete(u),f=!0,l.length>=a))return;!f&&t.length>=i&&l.push([...t])}function A(e,s){let t=e.length,n=s.length,i=Array.from({length:t+1},()=>Array(n+1).fill(0));for(let o=0;o<=t;o++)i[o][0]=o;for(let o=0;o<=n;o++)i[0][o]=o;for(let o=1;o<=t;o++)for(let f=1;f<=n;f++)e[o-1]===s[f-1]?i[o][f]=i[o-1][f-1]:i[o][f]=1+Math.min(i[o-1][f],i[o][f-1],i[o-1][f-1]);let r=[],l=t,a=n;for(;l>0||a>0;)l>0&&a>0&&e[l-1]===s[a-1]?(r.unshift({type:"match",indexA:l-1,indexB:a-1}),l--,a--):l>0&&a>0&&i[l][a]===i[l-1][a-1]+1?(r.unshift({type:"substitute",indexA:l-1,indexB:a-1}),l--,a--):a>0&&i[l][a]===i[l][a-1]+1?(r.unshift({type:"insert",indexA:l,indexB:a-1}),a--):(r.unshift({type:"delete",indexA:l-1,indexB:a}),l--);return{distance:i[t][n],ops:r}}function F(e,s){let t=[];for(let n=0;n<Math.min(e.length,s.length)&&e[n]===s[n];n++)t.push(e[n]);return t}function B(e,s){let t=[],n=e.length-1,i=s.length-1;for(;n>=0&&i>=0&&e[n]===s[i];)t.unshift(e[n]),n--,i--;return t}function h(e,s){if(e.length>s.length)return!1;let t=s.join("\u2192"),n=e.join("\u2192");return t.includes(n)}export{j as a};
|
|
2
|
+
//# sourceMappingURL=chunk-R7U2I55B.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e as $}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{e as $}from"./chunk-3AMWF6V5.js";import{b as D}from"./chunk-B75HZHUP.js";import{a as p}from"./chunk-BGBBVSH4.js";import{g as L}from"./chunk-WMO2VZZK.js";import{c as h,d as x,g as y}from"./chunk-7TVFPOD7.js";import{d as b}from"./chunk-X5C43YVI.js";import{a as g,e as S}from"./chunk-JZBGTSAB.js";import{p as d}from"./chunk-WS3Z6W3M.js";function K(e,n={}){let{scope:s,minLoc:i=1,limit:r,scanLimit:c,maxShapeFrequency:a=12}=n,o=n.semantic!==!1,t=M(e,B(e,{scope:s,minLoc:i,scanLimit:c}),{semantic:o,maxShapeFrequency:a}),m=I(t);return r?m.slice(0,r):m}function B(e,n){let s=y(e,{scope:n.scope}).filter(i=>i.isFunctionLike&&!e.isIgnored(i.relativePath)).filter(i=>p(i)>=n.minLoc);return typeof n.scanLimit=="number"&&n.scanLimit>0&&s.sort((i,r)=>p(r)-p(i)||i.relativePath.localeCompare(r.relativePath)),D(s,n.scanLimit)}function M(e,n,s){let i=[];for(let a of n){let o=w(e,a,s);o&&i.push({signature:o,definition:a,fn:v(a)})}let r=new Map;for(let a of i)r.set(a.signature,(r.get(a.signature)??0)+1);let c=new Map;for(let a of i){let o=F(a.fn.loc),t=(r.get(a.signature)??0)>s.maxShapeFrequency,m=t?$(e,a.definition):null;if(t&&!m)continue;let u=t?`${a.signature}\0body\0${m}`:`${a.signature}\0band\0${o}`,l=c.get(u)??{signature:a.signature,locBand:o,exactBody:t,functions:[]};l.functions.push(a.fn),c.set(u,l)}return[...c.values()]}function v(e){return{symbol:e.symbol,shortName:b(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:p(e)}}function I(e){let n=[];for(let s of e)s.functions.length>=2&&n.push(s);return n.sort((s,i)=>{let r=i.functions.length-s.functions.length;if(r!==0)return r;let c=s.functions.reduce((o,t)=>o+t.loc,0);return i.functions.reduce((o,t)=>o+t.loc,0)-c}),n}function F(e){return e<=5?"<=5":e<=20?"6-20":">20"}function w(e,n,s){if(s.semantic){let c=L(e,n);if(c)return c}let i=z(n.documentation),r=i?q(i):null;return r||A(G(e,n.relativePath,n.startLine,n.endLine,n.leaf),n.leaf)}function z(e){return h(x(e))}function G(e,n,s,i,r){let c=d(e,n);if(!c)return null;let a=c.split(/\r?\n/),o=k(a,s,i,r);for(let t of o){let m=Math.min(a.length-1,Math.max(t,t+4)),u="";for(let l=t;l<=m;l+=1){let f=a[l]?.trim();if(f&&(u=u?`${u} ${f}`:f,P(u)))return u}if(u&&u.includes("("))return u}return null}function P(e){let n=e.replace(/\s+/g," ").trim();return!n.includes("(")||S(n)>0?!1:/[;{]$/.test(n)||/\)\s*(?::\s*[^={]+)?\s*(?:=>|=|throws\b|where\b|$)/i.test(n)||/\)\s*As\s+.+$/i.test(n)}function q(e){if(!e||!e.trim())return null;let n=e.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim(),s=n.indexOf("(");return s===-1||(n=n.slice(s),n=n.replace(/\s+/g,"").toLowerCase(),n.length<3)?null:n}function A(e,n){if(!e||!e.trim())return null;let s=e.replace(/\s+/g," ").trim(),i=s.indexOf("(");if(i===-1)return null;let r=s.slice(0,i),a=new RegExp(`\\b${g(n)}\\b`,"i").exec(r);a&&typeof a.index=="number"&&(r=r.slice(0,a.index)),r=r.replace(/\b(public|private|protected|internal|final|static|abstract|sealed|virtual|override|async|suspend|inline|constexpr|consteval|constinit|const|pub|fn|function|def|sub|friend|shared|readonly|new|open|partial|export)\b/gi," ").replace(/\s+/g," ").trim();let o=C(s.slice(i)).replace(/\)\s*=\s*[\s\S]*$/,")").replace(/\s+throws\s+[^={]+$/i,"").replace(/\s+where\s+.+$/i,"").replace(/\s+/g," ").trim();if(!o.startsWith("("))return null;let t=`${r?`${r} `:""}${o}`.replace(/\s+/g,"").toLowerCase();return t.length>=3?t:null}function C(e){let n=0,s=0,i=0,r=0,c=null,a=!1;for(let o=0;o<e.length;o+=1){let t=e[o];if(c){if(a){a=!1;continue}if(t==="\\"){a=!0;continue}t===c&&(c=null);continue}if(t==='"'||t==="'"||t==="`"){c=t;continue}if(t==="(")n+=1;else if(t===")")n=Math.max(0,n-1);else if(t==="[")i+=1;else if(t==="]")i=Math.max(0,i-1);else if(t==="<")r+=1;else if(t===">")r=Math.max(0,r-1);else if(t==="{"){if(n===0&&i===0&&r===0)return e.slice(0,o);s+=1}else if(t==="}")s=Math.max(0,s-1);else if(t==="="&&e[o+1]===">"&&n===0&&s===0&&i===0&&r===0)return e.slice(0,o)}return e}function k(e,n,s,i){let r=g(i),c=new RegExp(`\\b${r}\\b\\s*\\(`,"i"),a=new RegExp(`\\bdef\\s+${r}\\b`,"i"),o=[],t=new Set,m=Math.max(0,Math.min(n,e.length-1)),u=Math.max(m,Math.min(e.length-1,Math.max(s,n+4)));for(let l=m;l<=u;l+=1){let f=e[l]??"";(c.test(f)||a.test(f))&&!t.has(l)&&(t.add(l),o.push(l))}for(let l=0;l<e.length;l+=1){let f=e[l]??"";(c.test(f)||a.test(f))&&!t.has(l)&&(t.add(l),o.push(l))}return o}export{K as a};
|
|
2
|
+
//# sourceMappingURL=chunk-RLB6SG25.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as i}from"./chunk-B75HZHUP.js";import{a,c as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as i}from"./chunk-B75HZHUP.js";import{a,c as m}from"./chunk-5VY3RIEI.js";import{a as r}from"./chunk-27HMTUJE.js";import{d as o}from"./chunk-X5C43YVI.js";function S(s,n,c={}){let e=r(s,n);if(!e)return null;let t=c.semantic!==!1,y=m(s,e,{limit:50,semantic:t}),b=i(a(s,e,{limit:50,additive:!0,callableOnly:!0,semantic:t}));return{symbol:e.symbol,shortName:o(e.symbol),callers:y.map(l=>({symbol:l.symbol,shortName:o(l.symbol),file:l.file})),callees:b.map(l=>({symbol:l.symbol,shortName:o(l.symbol),file:l.file}))}}export{S as a};
|
|
2
|
+
//# sourceMappingURL=chunk-SFDVBARK.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as d}from"./chunk-
|
|
1
|
+
import{c as d}from"./chunk-5VY3RIEI.js";import{g as m}from"./chunk-7TVFPOD7.js";import{d as r}from"./chunk-X5C43YVI.js";function y(o,t={}){let{limit:i=30,scope:e}=t,s=e?"AND def_d.relative_path LIKE ?":"",f=e?[`%${e}%`]:[],l=o.all(`SELECT
|
|
2
2
|
gs.symbol,
|
|
3
3
|
COUNT(*) AS ref_count,
|
|
4
4
|
COUNT(DISTINCT ref_d.id) AS file_count,
|
|
@@ -23,4 +23,4 @@ import{c as d}from"./chunk-72MFTCU5.js";import{g as m}from"./chunk-MBKJ7GHT.js";
|
|
|
23
23
|
GROUP BY gs.id
|
|
24
24
|
ORDER BY ref_count DESC
|
|
25
25
|
LIMIT ?`,...f,i).filter(n=>!o.isIgnored(n.defined_in)).map(n=>({symbol:n.symbol,shortName:r(n.symbol),refCount:n.ref_count,fileCount:n.file_count,definedIn:n.defined_in}));return l.length>0?l:c(o,e,i)}function c(o,t,i){return m(o,{scope:t}).filter(e=>!o.isIgnored(e.relativePath)).map(e=>u(o,e)).filter(e=>e.refCount>0).sort((e,s)=>s.refCount-e.refCount||s.fileCount-e.fileCount).slice(0,i)}function u(o,t){let e=d(o,t,{limit:500}).filter(s=>s.file!==t.relativePath);return{symbol:t.symbol,shortName:r(t.symbol),refCount:e.length,fileCount:new Set(e.map(s=>s.file)).size,definedIn:t.relativePath}}export{y as a};
|
|
26
|
-
//# sourceMappingURL=chunk-
|
|
26
|
+
//# sourceMappingURL=chunk-TYCZ7S4I.js.map
|