scip-query 0.7.2 → 0.8.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 +179 -221
- package/dist/augment-vue-worker.js +1 -1
- package/dist/{chunk-OPWOX7NT.js → chunk-2EC4JTHC.js} +2 -2
- package/dist/{chunk-SVSLAUSJ.js → chunk-46ILZVMX.js} +2 -2
- package/dist/chunk-4A4JFNWG.js +2 -0
- package/dist/{chunk-QBXTQODK.js → chunk-4B7YLRXX.js} +2 -2
- package/dist/chunk-64UY7VTR.js +63 -0
- package/dist/chunk-66ORT3LS.js +2 -0
- package/dist/{chunk-VMS5YTBS.js → chunk-6G76D2YM.js} +2 -2
- package/dist/{chunk-PEU24CSY.js → chunk-6P5W4U6G.js} +2 -2
- package/dist/chunk-6ZFKI5EP.js +40 -0
- package/dist/{chunk-EVXQF7DM.js → chunk-7I6KNKE3.js} +2 -2
- package/dist/{chunk-EIGCLVKK.js → chunk-7TYJD45F.js} +2 -2
- package/dist/chunk-7UZWNW4E.js +2 -0
- package/dist/{chunk-GIRI7FHW.js → chunk-AGW2MVIO.js} +2 -2
- package/dist/chunk-APLCSDXL.js +4 -0
- package/dist/{chunk-JDFWJ7VK.js → chunk-BCFED24F.js} +2 -2
- package/dist/chunk-CVRXOP6M.js +3 -0
- package/dist/{chunk-2QNKEJ7R.js → chunk-D43L5PQF.js} +2 -2
- package/dist/chunk-DJTJ3DLZ.js +7 -0
- package/dist/chunk-EAU4RDFG.js +2 -0
- package/dist/{chunk-BI4F6GXI.js → chunk-EKP7XJ6L.js} +2 -2
- package/dist/{chunk-LLL7THVV.js → chunk-EM2PPDN7.js} +2 -2
- package/dist/{chunk-6QC7SCKV.js → chunk-FIPE5AQT.js} +2 -2
- package/dist/chunk-FTBT4RP2.js +7 -0
- package/dist/{chunk-TB2OYNRS.js → chunk-GD7XRHSV.js} +2 -2
- package/dist/{chunk-XDXZP3BE.js → chunk-GMEBYEMU.js} +2 -2
- package/dist/chunk-GTZAU7OL.js +2 -0
- package/dist/chunk-HVGNOUYP.js +2 -0
- package/dist/chunk-HVXIXDLV.js +2 -0
- package/dist/{chunk-5TB4N27G.js → chunk-I7OTKWNY.js} +2 -2
- package/dist/{chunk-RFCR2BRD.js → chunk-JAMU6FLN.js} +2 -2
- package/dist/chunk-JTCEWV7Q.js +2 -0
- package/dist/chunk-K4Z3FCUJ.js +6 -0
- package/dist/{chunk-WJQFABZN.js → chunk-K6YIGVL7.js} +2 -2
- package/dist/chunk-MKE7SEEX.js +2 -0
- package/dist/chunk-N5D5ZCBW.js +7 -0
- package/dist/{chunk-ROZNBWIF.js → chunk-NGLRXEWN.js} +2 -2
- package/dist/{chunk-IFGEPTH5.js → chunk-NK7TQQG4.js} +2 -2
- package/dist/chunk-NOVKLH2F.js +2 -0
- package/dist/chunk-OIMM7KMI.js +2 -0
- package/dist/chunk-OQSV6OS2.js +2 -0
- package/dist/chunk-PBGTMPJ7.js +2 -0
- package/dist/{chunk-YH6TTQEI.js → chunk-PCMVXWDC.js} +4 -4
- package/dist/{chunk-U75WH4XG.js → chunk-PE4EJOLN.js} +2 -2
- package/dist/chunk-PLFYFZX3.js +2 -0
- package/dist/{chunk-HTVLH3NL.js → chunk-QYQXPPDI.js} +2 -2
- package/dist/{chunk-P7UMQ7R7.js → chunk-RCRK4E7E.js} +2 -2
- package/dist/chunk-RIXOMSOR.js +20 -0
- package/dist/chunk-SB6I6O3P.js +2 -0
- package/dist/{chunk-X2JB54QF.js → chunk-SDGCKEB7.js} +2 -2
- package/dist/chunk-SLOIQKY7.js +2 -0
- package/dist/{chunk-4VYIZV3S.js → chunk-SOGLYIJ4.js} +4 -4
- package/dist/chunk-SSINY7HL.js +4 -0
- package/dist/{chunk-FU5WRWAN.js → chunk-TFO4OMJZ.js} +2 -2
- package/dist/chunk-TH4JVC34.js +71 -0
- package/dist/chunk-TQTVM27C.js +6 -0
- package/dist/{chunk-QP6FLI6D.js → chunk-TR5AU6A5.js} +2 -2
- package/dist/{chunk-4LKJMRT5.js → chunk-UQE3DSXY.js} +2 -2
- package/dist/{chunk-LXJTDFOV.js → chunk-UUDYI3FF.js} +2 -2
- package/dist/chunk-VDZL45XI.js +2 -0
- package/dist/{chunk-XANDY7N5.js → chunk-VN6B6HFB.js} +2 -2
- package/dist/{chunk-SDPP5KVQ.js → chunk-WC43FMAB.js} +2 -2
- package/dist/chunk-WEJYUS5O.js +2 -0
- package/dist/chunk-WQFOZIID.js +4 -0
- package/dist/chunk-XBFLIGWU.js +3 -0
- package/dist/{chunk-TGNL3ZKZ.js → chunk-XSZ5NC4O.js} +2 -2
- package/dist/{chunk-4T35WUCX.js → chunk-Z2AJQ7VA.js} +2 -2
- package/dist/{chunk-S5VMVNFM.js → chunk-ZIIQ55VK.js} +2 -2
- package/dist/chunk-ZJ737ZMD.js +2 -0
- package/dist/cli.js +171 -173
- package/dist/health-C6r2VgpA.d.ts +234 -0
- package/dist/index.d.ts +11 -18
- package/dist/index.js +1 -1
- package/dist/postinstall.js +4 -4
- 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.d.ts +66 -0
- package/dist/queries/cleanup-plan.js +2 -0
- package/dist/queries/co-change.d.ts +42 -0
- package/dist/queries/co-change.js +2 -0
- 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/deep-chains.js +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-gate.d.ts +52 -0
- package/dist/queries/diff-gate.js +2 -0
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +69 -0
- package/dist/queries/doc-drift.js +2 -0
- package/dist/queries/drift.js +1 -1
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/health.d.ts +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/index.d.ts +38 -2
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.js +1 -1
- package/dist/queries/outline.d.ts +1 -0
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +65 -0
- package/dist/queries/plan-context.js +2 -0
- package/dist/queries/recent-duplicates.d.ts +48 -0
- package/dist/queries/recent-duplicates.js +2 -0
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.d.ts +58 -0
- package/dist/queries/self-audit.js +2 -0
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +6 -0
- 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/trace.js +1 -1
- package/dist/queries/unused-params.d.ts +38 -0
- package/dist/queries/unused-params.js +2 -0
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +1 -1
- package/dist/reindex.js +1 -1
- package/dist/runtime.d.ts +3 -2
- package/dist/runtime.js +2 -2
- package/package.json +33 -1
- package/skills/concrete-plan/SKILL.md +37 -7
- package/skills/scip-ai-cleanup/SKILL.md +145 -0
- package/skills/scip-debloat/SKILL.md +37 -7
- package/skills/scip-explore/SKILL.md +22 -9
- package/skills/scip-language-playbook/SKILL.md +4 -4
- package/skills/scip-maintainability/SKILL.md +264 -0
- package/skills/scip-verify/SKILL.md +2 -2
- package/dist/chunk-3X43EYFU.js +0 -3
- package/dist/chunk-4GPWGSOE.js +0 -40
- package/dist/chunk-5RGK4YA5.js +0 -63
- package/dist/chunk-5TT47UMX.js +0 -44
- package/dist/chunk-6QH2L26C.js +0 -71
- package/dist/chunk-6SR4UNWI.js +0 -2
- package/dist/chunk-6XEWA6FX.js +0 -2
- package/dist/chunk-7WHNTKSD.js +0 -2
- package/dist/chunk-BOVNTAKQ.js +0 -3
- package/dist/chunk-D62LLANH.js +0 -2
- package/dist/chunk-EDXML2HI.js +0 -4
- package/dist/chunk-EZQOVY3C.js +0 -2
- package/dist/chunk-IODTPF5H.js +0 -20
- package/dist/chunk-KJ6CW6EK.js +0 -2
- package/dist/chunk-NBUINPSH.js +0 -2
- package/dist/chunk-NHDPYW7O.js +0 -2
- package/dist/chunk-NKJKI6SE.js +0 -2
- package/dist/chunk-OPZQIJZU.js +0 -7
- package/dist/chunk-P3PVY6TX.js +0 -2
- package/dist/chunk-QE6MGGUY.js +0 -2
- package/dist/chunk-QVPYMZUJ.js +0 -6
- package/dist/chunk-RCJEFQOK.js +0 -4
- package/dist/chunk-UHMJYNTK.js +0 -2
- package/dist/health-x7B4Xu_6.d.ts +0 -119
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as N}from"./chunk-EAU4RDFG.js";import{a as I,b as S}from"./chunk-7I6KNKE3.js";import{c as h,e as b,r as p,v as g}from"./chunk-SOGLYIJ4.js";function x(o,s,r={}){let{maxDepth:c=5,scope:a}=r,l=I(o,s);if(!l)return[];let u=[],f=new Set([l.symbolId]),m=new Set,t=[l];for(let e=1;e<=c&&t.length!==0;e++){let i=[];for(let y of t)for(let n of D(o,y,a)){let d=`${n.file}|${n.shortName}`;if(n.symbolId!==null){if(f.has(n.symbolId))continue;f.add(n.symbolId)}else if(m.has(d))continue;m.add(d),u.push({symbol:n.symbol,shortName:n.shortName,file:n.file,depth:e}),n.symbolId!==null&&n.symbolMatch&&i.push(n.symbolMatch)}t=i}return u.sort((e,i)=>e.depth-i.depth||e.file.localeCompare(i.file)),u}function D(o,s,r){let c=N(o,s,{limit:500}).filter(t=>!o.isIgnored(t.file)).filter(t=>!r||t.file.includes(r)),a=new Set(c.map(t=>t.file)),l=[];for(let t of M(o,s,r)){if(a.has(t))continue;let e=p(o,t),i=e.length>0?g(e,e[0].startLine):null;l.push({symbol:i?.symbol??t,file:t})}let u=[...c,...l],f=[],m=new Set;for(let t of u){let e=S(o,t.symbol);if(!e){let y=`${t.file}|${t.symbol}`;if(m.has(y))continue;m.add(y),f.push({symbolId:null,symbol:t.symbol,shortName:h(t.symbol),file:t.file,symbolMatch:null});continue}if(e.symbolId===s.symbolId||o.isIgnored(e.relativePath)||!_(e.symbol))continue;let i=`${e.symbolId}|${e.relativePath}`;m.has(i)||(m.add(i),f.push({symbolId:e.symbolId,symbol:e.symbol,shortName:h(e.symbol),file:e.relativePath,symbolMatch:e}))}return f}function M(o,s,r){let c=r?"AND consumer_d.relative_path LIKE ?":"",a=[s.symbolId,s.documentId];return r&&a.push(`%${r}%`),new Set(o.all(`SELECT DISTINCT consumer_d.relative_path
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN documents consumer_d ON consumer_d.id = c.document_id
|
|
@@ -7,4 +7,4 @@ import{d as N}from"./chunk-P3PVY6TX.js";import{a as I,b as S}from"./chunk-EVXQF7
|
|
|
7
7
|
AND c.document_id != ?
|
|
8
8
|
${o.pathExclusionsFor("consumer_d")}
|
|
9
9
|
${c}`,...a).map(l=>l.relative_path).filter(l=>!o.isIgnored(l)))}function _(o){let s=b(o);return s==="method"||s==="type"||o.endsWith("().")}export{x as a};
|
|
10
|
-
//# sourceMappingURL=chunk-
|
|
10
|
+
//# sourceMappingURL=chunk-UUDYI3FF.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var b=[];function p(i){i.groups.length>0&&b.push(i)}function h(i,c){let a=new Set(c.groups);for(let n of b)n.groups.some(t=>a.has(t))&&(c.file!==void 0&&n.clearFile?n.clearFile(i,c.file):n.clearAll(i))}function g(){let i=new WeakMap;return{cache:i,ensure(c){let a=i.get(c);return a||(a=new Map,i.set(c,a)),a}}}function C(i,c){let{cache:a,ensure:n}=g(),t={get(e,r,s){let l=n(e);if(l.has(r))return l.get(r);let o=s();return l.set(r,o),o},invalidate(e,r){a.get(e)?.delete(r)},invalidateAll(e){a.delete(e)},size(e){return a.get(e)?.size??0}};return p({name:i,groups:c.clearGroups,clearAll:e=>t.invalidateAll(e),clearFile:(e,r)=>t.invalidate(e,r)}),t}function V(i,c){let a=new WeakMap,n={get(t,e){let r=a.get(t);if(r)return r.value;let s=e();return a.set(t,{value:s}),s},invalidate(t){a.delete(t)},has(t){return a.has(t)}};return p({name:i,groups:c.clearGroups,clearAll:t=>n.invalidate(t)}),n}function f(i,c){let{cache:a,ensure:n}=g(),t={get(e,r,s,l){let o=n(e),u=o.get(r);if(u&&u.source===s)return u.value;let d=l();return o.set(r,{source:s,value:d}),d},invalidate(e,r){a.get(e)?.delete(r)},invalidateAll(e){a.delete(e)}};return p({name:i,groups:c.clearGroups,clearAll:e=>t.invalidateAll(e),clearFile:(e,r)=>t.invalidate(e,r)}),t}export{p as a,h as b,C as c,V as d,f as e};
|
|
2
|
+
//# sourceMappingURL=chunk-VDZL45XI.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{o as d}from"./chunk-6ZFKI5EP.js";import{a as h}from"./chunk-7I6KNKE3.js";import{g}from"./chunk-SOGLYIJ4.js";import{a as m}from"./chunk-WQFOZIID.js";import{a as p}from"./chunk-NN3O7TPH.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-VN6B6HFB.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-7I6KNKE3.js";import{a as c}from"./chunk-NN3O7TPH.js";import{existsSync as m}from"fs";import{basename as p,isAbsolute as g,join as d}from"path";function S(t,r){let e=f(t,r,{allowMultiple:!1})[0]?.relativePath;return e||x(t,r)}function j(t,r){return f(t,r,{allowMultiple:!0}).map(e=>e.relativePath)}function x(t,r){if(!r)return null;let e=r.replace(/\\/g,"/").replace(/^\.\//,""),s=g(e)&&e.startsWith(t.config.projectRoot)?e.slice(t.config.projectRoot.length).replace(/^\/+/,""):e,i=d(t.config.projectRoot,s);return m(i)?s:null}function f(t,r,e){let s=h(r);if(!s)return[];let i=c(t,{includeIgnored:!1}).map(o=>({relativePath:o,score:v(o,s)})).filter(o=>o.score>0).sort((o,l)=>l.score-o.score||o.relativePath.localeCompare(l.relativePath));if(i.length===0){let o=u(t,r);return!o||t.isIgnored(o.relativePath)?[]:[{relativePath:o.relativePath,score:700}]}let n=i.filter(o=>o.score>=1100);if(n.length>0)return e.allowMultiple?n:[n[0]];let a=i.filter(o=>o.score>=800);return a.length>0?e.allowMultiple?a:[a[0]]:e.allowMultiple?i:[i[0]]}function v(t,r){let e=h(t),s=p(e),i=p(r),n=0;return e===r&&(n+=1200),e.endsWith(`/${r}`)&&(n+=1100),s===i&&(n+=900),e.startsWith(`${r}/`)&&(n+=850),e.includes(r)&&(n+=250),n}function h(t){return t.trim().replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}export{S as a,j as b};
|
|
2
|
+
//# sourceMappingURL=chunk-WC43FMAB.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as P}from"./chunk-NN3O7TPH.js";import{a as j,d as O,e as w}from"./chunk-VDZL45XI.js";function G(t){return t.replace(/'''[\s\S]*?'''/g,f).replace(/"""[\s\S]*?"""/g,f).replace(/#.*$/gm,f).replace(/\/\/.*$/gm,f).replace(/\/\*[\s\S]*?\*\//g,f).replace(/`(?:\\[\s\S]|[^`])*`/g,f).replace(/'(?:\\.|[^'\\\r\n])*'/g,f).replace(/"(?:\\.|[^"\\\r\n])*"/g,f)}function f(t){return t.replace(/[^\r\n]/g," ")}var Tt=w("stripped-lines",{clearGroups:["whole-project","source-file"]});j({name:"stripped-source-singleton",groups:["whole-project","source-file"],clearAll:()=>{_=null,E=""},clearFile:()=>{_=null,E=""}});var _=null,E="";function V(t){return _===t||(_=t,E=G(t)),E}function Rt(t,n,e){let r=V(t);return`${r.slice(0,n)}${" ".repeat(e-n)}${r.slice(e)}`}function Dt(t,n){return new RegExp(`\\b${v(n)}\\b`,"m").test(t)}function $t(t,n){let e=new Set,r=new RegExp(`\\b${v(n)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let o of t.matchAll(r)){let s=o[1];s&&e.add(s)}return[...e]}function v(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function yt(t){let n=0;for(let e of t)e==="("&&(n+=1),e===")"&&(n-=1);return n}import{existsSync as T}from"fs";import{basename as Y,dirname as S,extname as p,join as g,relative as h,resolve as u}from"path";var K=O("indexed-paths",{clearGroups:[]}),m=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],X=[".py",".pyi"],b=[".java",".scala",".kt",".kts"],k=[".rs"],A=[".rb"],L=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],W=[".cs",".vb"],H=[".dart"],U=[".php"],Q=new Set(m),R=new Set(X),J=new Set(b),D=new Set(k),$=new Set(A),M=new Set(L),B=new Set(W),y=new Set(H),z=new Set(U),Z=[{extensions:m,lookup:Q},{extensions:X,lookup:R},{extensions:b,lookup:J},{extensions:k,lookup:D},{extensions:A,lookup:$},{extensions:L,lookup:M},{extensions:W,lookup:B},{extensions:H,lookup:y},{extensions:U,lookup:z}];function x(t,n){return n.has(p(t).toLowerCase())}function q(t){return x(t,R)}function tt(t){return x(t,J)}function nt(t){return x(t,D)}function et(t){return x(t,$)}function rt(t){return x(t,M)}function ot(t){return x(t,B)}function vt(t){return p(t).toLowerCase()===".vb"}function st(t){return x(t,y)}function it(t){return x(t,z)}function ct(t){let n=p(t).toLowerCase();for(let e of Z)if(e.lookup.has(n))return e.extensions;return m}function at(t){return tt(t)||ot(t)||it(t)}function Xt(t,n,e){return q(n)?ut(t,n,e):nt(n)?gt(t,n,e):et(n)?pt(t,n,e):rt(n)?ft(t,n,e):at(n)?St(t,e.replace(/\\/g,"."),ct(n)):st(n)?xt(t,n,e):lt(t,n,e)}function lt(t,n,e){if(!e.startsWith(".")&&!e.startsWith("/"))return null;let r=S(g(t.config.projectRoot,n)),o=u(r,e),s=N(t);for(let c of Nt(o)){let a=d(h(t.config.projectRoot,c));if(s.has(a)||T(c))return a}return d(h(t.config.projectRoot,o))}function ut(t,n,e){let r=N(t),o;if(e.startsWith(".")){let s=e.match(/^(\.+)(.*)$/);if(!s)return null;let c=s[1].length,a=s[2].replace(/^\./,""),i=S(g(t.config.projectRoot,n));for(let l=1;l<c;l++)i=S(i);o=a?u(i,a.replace(/\./g,"/")):i}else o=u(t.config.projectRoot,e.replace(/\./g,"/"));for(let s of dt(o)){let c=d(h(t.config.projectRoot,s));if(r.has(c)||T(s))return c}return null}function gt(t,n,e){if(!e)return null;let r=e.replace(/\s+as\s+.+$/,"").trim();if(!r.startsWith("crate::")&&!r.startsWith("self::")&&!r.startsWith("super::"))return null;let o=S(g(t.config.projectRoot,n)),s;return r.startsWith("crate::")?s=u(t.config.projectRoot,"src",r.slice(7).replace(/::/g,"/")):r.startsWith("self::")?s=u(o,r.slice(6).replace(/::/g,"/")):s=u(S(o),r.slice(7).replace(/::/g,"/")),C(t,Et(s))}function pt(t,n,e){let r=S(g(t.config.projectRoot,n)),o=u(r,e);return C(t,ht(o))}function ft(t,n,e){let r=S(g(t.config.projectRoot,n)),o=[u(r,e),u(t.config.projectRoot,e),u(t.config.projectRoot,"include",e),u(t.config.projectRoot,"src",e)];return C(t,o)}function St(t,n,e){let r=N(t),o=n.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),s=o.replace(/\./g,"/"),c=o.split(".").pop()??o;for(let i of e){let l=`${s}${i}`,I=[...r].find(F=>F.endsWith(l));if(I)return I}for(let i of e){let l=[...r].find(I=>Y(I)===`${c}${i}`);if(l)return l}let a=[...r].filter(i=>e.includes(p(i).toLowerCase())).filter(i=>i.includes(`/${s}/`)||i.includes(`/${c}/`)).sort((i,l)=>i.localeCompare(l));return a.length===1?a[0]:null}function xt(t,n,e){let r=N(t);if(e.startsWith("package:")){let c=e.slice(8),a=c.indexOf("/");if(a<0)return null;let i=c.slice(a+1),l=d(i.startsWith("lib/")?i:`lib/${i}`);return r.has(l)?l:null}let o=S(g(t.config.projectRoot,n)),s=u(o,e);for(let c of mt(s)){let a=d(h(t.config.projectRoot,c));if(r.has(a)||T(c))return a}return null}function dt(t){let n=p(t);return R.has(n)?[t]:[`${t}.py`,`${t}.pyi`,g(t,"__init__.py"),g(t,"__init__.pyi")]}function C(t,n){let e=N(t);for(let r of n){let o=d(h(t.config.projectRoot,r));if(e.has(o)||T(r))return o}return null}function Et(t){let n=p(t);return D.has(n)?[t]:[`${t}.rs`,g(t,"mod.rs")]}function ht(t){let n=p(t);return $.has(n)?[t]:[`${t}.rb`,g(t,"index.rb")]}function mt(t){let n=p(t);return y.has(n)?[t]:[`${t}.dart`,t]}function Nt(t){let n=p(t),e=new Set;if(n){e.add(t);for(let r of m)e.add(t.slice(0,-n.length)+r)}else for(let r of m)e.add(`${t}${r}`),e.add(g(t,`index${r}`));return[...e]}function N(t){return K.get(t,()=>new Set(P(t,{includeIgnored:!1}).map(d)))}function d(t){return t.replace(/\\/g,"/")}export{m as a,X as b,b as c,k as d,A as e,L as f,W as g,H as h,U as i,vt as j,ct as k,Xt as l,ut as m,gt as n,pt as o,ft as p,St as q,xt as r,d as s,G as t,Rt as u,Dt as v,$t as w,yt as x};
|
|
2
|
+
//# sourceMappingURL=chunk-WEJYUS5O.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{c as L,e as A}from"./chunk-VDZL45XI.js";import{existsSync as q,readFileSync as X}from"fs";import{join as $}from"path";var J=L("source-text",{clearGroups:["whole-project","source-file"]});function S(e,t){let r=t.replace(/\\/g,"/");return J.get(e,r,()=>{let n=$(e.config.projectRoot,r);return q(n)?X(n,"utf-8"):""})}var Z=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale|wrapper|passthrough|drift|extract)?/i;function Pe(e,t,r){if(r<=0)return!1;let n=S(e,t);if(!n)return!1;let s=n.split(`
|
|
2
|
+
`);for(let a=r-1;a>=0&&a>=r-5;a-=1){let i=(s[a]??"").trim();if(i!==""){if(Z.test(i))return!0;if(!i.startsWith("//")&&!i.startsWith("*")&&!i.startsWith("/*")&&!i.startsWith("@")&&!i.startsWith("#"))return!1}}return!1}import{extname as w}from"path";var ee={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb"};function y(e){return ee[w(e).toLowerCase()]??null}function x(e){return w(e).toLowerCase()===".vue"}import{createRequire as te}from"module";var f=te(import.meta.url),b=null,F=!1;function re(){if(F)return null;if(b)return b;try{return b=f("tree-sitter"),b}catch{return F=!0,null}}var k=new Map,_=new Set;function ne(e){if(_.has(e))return null;let t=k.get(e);if(t)return t;let r;try{switch(e){case"rust":r=f("tree-sitter-rust");break;case"typescript":r=f("tree-sitter-typescript").typescript;break;case"tsx":r=f("tree-sitter-typescript").tsx;break;case"javascript":r=f("tree-sitter-javascript");break;case"python":r=f("tree-sitter-python");break;case"java":r=f("tree-sitter-java");break;case"kotlin":r=f("tree-sitter-kotlin");break;case"scala":r=f("tree-sitter-scala");break;case"ruby":r=f("tree-sitter-ruby");break;case"c":r=f("tree-sitter-c");break;case"cpp":r=f("tree-sitter-cpp");break;case"csharp":r=f("tree-sitter-c-sharp");break;case"php":r=f("tree-sitter-php").php;break;case"vb":{let n=f("tree-sitter-vb-dotnet");r=n.language??n;break}}}catch{return _.add(e),null}return k.set(e,r),r}var R=new Map;function se(e){let t=R.get(e);if(t)return t;let r=ne(e);if(!r)return null;let n=re();if(!n)return null;let s=new n;try{s.setLanguage(r)}catch{return _.add(e),null}return R.set(e,s),s}function ae(e,t){return e.parse(n=>n>=t.length?null:t.slice(n,Math.min(t.length,n+16384)))}function C(e,t){let r=se(e);if(!r)return null;try{return ae(r,t)}catch{return null}}function T(e){let t=[],r=/<script\b([^>]*)>([\s\S]*?)<\/script>/g;for(let o of e.matchAll(r))typeof o.index=="number"&&t.push({tagOpen:o[1]??"",body:o[2]??"",openIdx:o.index+(o[0].length-(o[2]?.length??0)-9)});if(t.length===0)return null;let n=t.find(o=>/\bsetup\b/.test(o.tagOpen))??t[0],a=n.tagOpen.match(/\blang\s*=\s*["']?([\w-]+)/)?.[1]?.toLowerCase(),i=a==="ts"||a==="typescript"?"typescript":a==="tsx"?"tsx":"javascript";return{body:n.body,startLine:ie(e,n.openIdx),language:i}}function ie(e,t){let r=0;for(let n=0;n<t&&n<e.length;n++)e.charCodeAt(n)===10&&r++;return r}var j=A("ast-trees",{clearGroups:["whole-project","source-file"]});function N(e,t){if(x(t))return oe(e,t);let r=y(t);if(!r)return null;let n=S(e,t);return n?j.get(e,t,n,()=>C(r,n)):null}function oe(e,t){let r=S(e,t);return r?j.get(e,t,r,()=>{let n=T(r);if(!n)return null;let s=`
|
|
3
|
+
`.repeat(n.startLine)+n.body;return C(n.language,s)}):null}function h(e){return e.type==="comment"||e.type==="line_comment"||e.type==="block_comment"}var ce=new Set(["function_declaration","method_definition","method_signature","function_signature"]);function D(e,t){let r=le(e,t);if(r)return{name:r.name,startLine:r.definitionNode.startPosition.row,endLine:r.definitionNode.endPosition.row,paramCount:I(r.functionNode),params:E(r.functionNode),paramsEndLine:v(r.functionNode),isLiteralPassthrough:P(r.functionNode,t)};if(!ue(e.type,t))return null;let n=e.childForFieldName("name")??e.namedChildren.find(s=>s.type==="identifier"||s.type==="property_identifier");return n?{name:n.text,startLine:e.startPosition.row,endLine:e.endPosition.row,paramCount:I(e),params:E(e),paramsEndLine:v(e),isLiteralPassthrough:P(e,t)}:null}function M(e){return e.namedChildren.find(t=>t.type==="parameters"||t.type==="formal_parameters")}function E(e){let t=M(e);if(!t)return[];let r=[];for(let n of t.namedChildren){if(h(n))continue;if(n.type==="identifier"){r.push({name:n.text,simple:!0});continue}let s=n.namedChildren.some(o=>o.type.endsWith("_modifier"))||/^\s*(?:public|private|protected|readonly|override)\b/.test(n.text),a=n.childForFieldName("pattern");if(!s&&a&&a.type==="identifier"){r.push({name:a.text,simple:!0});continue}let i=n.namedChildren.find(o=>o.type==="identifier");r.push({name:a?.type==="identifier"?a.text:i?.text??"",simple:!1})}return r}function v(e){let t=M(e);return t?t.endPosition.row:e.startPosition.row}function ue(e,t){return t==="rust"?e==="function_item"||e==="function_signature_item":t==="python"?e==="function_definition":t==="typescript"||t==="tsx"||t==="javascript"?ce.has(e):!1}function le(e,t){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript")return null;if(e.type==="variable_declarator"){let r=e.childForFieldName("name")??e.namedChild(0),n=e.childForFieldName("value")??e.namedChild(1);return!r||!n||n.type!=="arrow_function"&&n.type!=="function_expression"?null:{name:r.text,definitionNode:e,functionNode:n}}if(e.type==="public_field_definition"){let r=e.childForFieldName("name")??e.namedChild(0),n=e.childForFieldName("value")??e.namedChild(1);return!r||!n||n.type!=="arrow_function"&&n.type!=="function_expression"?null:{name:r.text,definitionNode:e,functionNode:n}}return null}function I(e){let t=e.namedChildren.find(n=>n.type==="parameters"||n.type==="formal_parameters");if(!t)return 0;let r=0;for(let n of t.namedChildren)h(n)||(r+=1);return r}function P(e,t){let r=e.namedChildren.find(l=>l.type==="block"||l.type==="statement_block");if(!r)return!1;let n=r.namedChildren.filter(l=>!h(l));if(n.length!==1)return!1;let s=n[0],a=null;if(s.type==="return_statement"||s.type==="expression_statement"?a=s.namedChild(0)??null:t==="rust"&&(s.type==="call_expression"||s.type==="macro_invocation")&&(a=s),!a)return!1;let i=t==="python"?"call":"call_expression";if(a.type!==i)return!1;let o=a.namedChildren.find(l=>l.type==="arguments"||l.type==="argument_list");if(!o)return!1;let u=o.namedChildren.filter(l=>!h(l)),c=e.namedChildren.find(l=>l.type==="parameters"||l.type==="formal_parameters");if(!c)return!1;let p=[];for(let l of c.namedChildren){if(l.type==="identifier"){p.push(l.text);continue}let d=l.namedChildren.find(K=>K.type==="identifier");d&&p.push(d.text)}if(u.length!==p.length)return!1;for(let l=0;l<p.length;l+=1){let d=u[l];if(d.type!=="identifier"||d.text!==p[l])return!1}return!0}function O(e,t){let r=pe(e,t);if(!r)return null;let n=g(r);return n?{calleeLeaf:n,memberAccess:fe(r),line:e.startPosition.row}:null}function pe(e,t){if(t==="rust")return e.type==="call_expression"?e.childForFieldName("function")??e.namedChild(0):e.type==="macro_invocation"?e.childForFieldName("macro")??e.namedChild(0):null;if(t==="python")return e.type!=="call"?null:e.childForFieldName("function")??e.namedChild(0);if(t==="typescript"||t==="tsx"||t==="javascript"){if(e.type==="call_expression")return e.childForFieldName("function")??e.namedChild(0);if(e.type==="new_expression")return e.childForFieldName("constructor")??e.namedChild(0)}return null}function fe(e){switch(e.type){case"field_expression":case"member_expression":case"attribute":return!0;default:return!1}}function g(e){switch(e.type){case"identifier":case"type_identifier":case"property_identifier":case"shorthand_property_identifier":return e.text;case"field_expression":case"member_expression":case"attribute":{let t=e.namedChild(e.namedChildCount-1);return t?g(t):null}case"scoped_identifier":{let t=e.childForFieldName("name")??e.namedChild(e.namedChildCount-1);return t?g(t):null}case"super":case"self":case"this":return null;default:return null}}var me=new Set(["identifier","type_identifier","field_identifier"]),de=new Set(["identifier"]),ge=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),ye=new Set(["rust","python"]),he=/\{([^{}]*)\}/g,Se=/\b([A-Za-z_][\w]*)\b/g;function B(e,t){return be(t).has(e.type)}function Q(e,t){return ye.has(t)&&e.type==="string_content"}function H(e){let t=0;for(let n of e.values()){let s=n[n.length-1];s!==void 0&&s>t&&(t=s)}let r=new Array(t+1);for(let n=0;n<=t;n+=1)r[n]=new Set;for(let[n,s]of e)for(let a of s)r[a].add(n);return r}function be(e){return e==="rust"?me:e==="python"?de:ge}function V(e,t){let r=e.startPosition.row;for(let n of e.text.matchAll(he)){let s=n[1]??"";for(let a of s.matchAll(Se))a[1]&&t(a[1],r)}}var xe=[/\bdefault\s*=\s*"([^"]+)"/g,/\bwith\s*=\s*"([^"]+)"/g,/\bserialize_with\s*=\s*"([^"]+)"/g,/\bdeserialize_with\s*=\s*"([^"]+)"/g,/\bskip_serializing_if\s*=\s*"([^"]+)"/g,/\bgetter\s*=\s*"([^"]+)"/g,/\brename_all_with\s*=\s*"([^"]+)"/g,/\bschema_with\s*=\s*"([^"]+)"/g],_e=/^#!?\[\s*serde\s*\(/,Ce=/^#!?\[\s*schemars\s*\(/,Ne=/^#!?\[\s*validate\s*\(/,Le=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function G(e,t,r){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript"||e.type!=="call_expression")return;let n=e.childForFieldName("function")??e.namedChild(0);if(!n)return;let s=g(n);if(!s||!Le.has(s))return;let a=e.namedChildren.find(u=>u.type==="arguments");if(!a)return;let i=a.namedChild(0);if(!i||i.type!=="string")return;let o=i.namedChildren.find(u=>u.type==="string_fragment");o&&r.add(o.text)}function U(e,t){let r=_e.test(e),n=Ce.test(e),s=Ne.test(e);if(!(!r&&!n&&!s))for(let a of xe){a.lastIndex=0;let i;for(;(i=a.exec(e))!==null;){let o=i[1],u=o.split("::").pop()??o;u==="is_none"&&/\bOption\b/.test(o)||u==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(o)||u&&t.add(u)}}}function z(e,t){let r=new Map,n=(i,o)=>{if(i===o)return;let u=r.get(i);u||(u=new Set,r.set(i,u)),u.add(o)},s=t==="python"?new Set(["identifier"]):new Set(["type_identifier"]),a=(i,o)=>{let u=c=>{s.has(c.type)&&c.text!==o&&n(c.text,o);for(let p of c.children)u(p)};for(let c of i.children)u(c)};if(t==="rust")for(let i of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let o=i.namedChildren.find(c=>c.type==="type_identifier")?.text;if(!o)continue;let u=i.namedChildren.find(c=>c.type==="field_declaration_list"||c.type==="enum_variant_list"||c.type==="ordered_field_declaration_list");u&&a(u,o),i.type==="type_item"&&a(i,o)}else if(t==="python")for(let i of e.rootNode.descendantsOfType("class_definition")){let o=i.namedChildren.find(c=>c.type==="identifier")?.text;if(!o)continue;let u=i.namedChildren.find(c=>c.type==="block");if(u)for(let c of u.descendantsOfType("type"))for(let p of c.descendantsOfType("identifier"))p.text!==o&&n(p.text,o)}else for(let i of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let o=i.namedChildren.find(u=>u.type==="type_identifier")?.text;o&&a(i,o)}return r}var W=new WeakMap;function m(e,t){let r=y(t);if(!r)return null;let n=N(e,t);if(!n)return null;let s=W.get(n);if(s)return s;let a=Fe(n,r);return W.set(n,a),a}function Ae(e,t,r,n){let s=m(e,t);return s?we(s,r,n)?.isLiteralPassthrough??!0:!0}function we(e,t,r){return e.callables.find(n=>n.startLine===t&&n.endLine===r)??null}function Fe(e,t){let r=[],n=[],s=new Set,a=new Set,i=new Map,o=(c,p)=>{let l=i.get(c);if(!l){i.set(c,[p]);return}l[l.length-1]!==p&&l.push(p)},u=c=>{let p=D(c,t);p&&r.push(p);let l=O(c,t);l&&n.push(l),G(c,t,a),t==="rust"&&(c.type==="attribute_item"||c.type==="inner_attribute_item")&&U(c.text,s),B(c,t)&&o(c.text,c.startPosition.row),Q(c,t)&&V(c,o);for(let d of c.children)u(d)};return u(e.rootNode),{language:t,callables:r,callSites:n,typeContainerMap:z(e,t),identifierLineMap:i,identifiersByLine:H(i),fileIdentifiers:new Set(i.keys()),rustAttrReferencedNames:s,crossLanguageDispatchNames:a}}var Y=new Set(["rust","typescript","tsx","javascript","python"]);function ke(e,t){let r=m(e,t);return!r||!Y.has(r.language)?null:r.callables.map(n=>({name:n.name,startLine:n.startLine,endLine:n.endLine}))}function Re(e,t){let r=m(e,t);return!r||!Y.has(r.language)?null:r.callSites}function Te(e,t){return m(e,t)?.typeContainerMap??new Map}function je(e,t,r={}){let n=m(e,t);if(!n)return[];let s=[];if(r.includeCrossLanguageDispatchNames)for(let a of n.crossLanguageDispatchNames)s.push({name:a,kind:"cross-language-dispatch",occurrences:1});if(r.includeRustAttributeNames&&n.language==="rust")for(let a of n.rustAttrReferencedNames)s.push({name:a,kind:"rust-attribute",occurrences:1});return s}export{S as a,Pe as b,y as c,x as d,N as e,m as f,Ae as g,ke as h,Re as i,Te as j,je as k};
|
|
4
|
+
//# sourceMappingURL=chunk-WQFOZIID.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as G}from"./chunk-HVGNOUYP.js";import{a as L}from"./chunk-AQYBOORI.js";import{a as F}from"./chunk-DJTJ3DLZ.js";import{a as E}from"./chunk-SSINY7HL.js";import{a as x}from"./chunk-QYQXPPDI.js";import{a as B}from"./chunk-SLOIQKY7.js";import{a as N,b as v}from"./chunk-K4Z3FCUJ.js";import{a as A}from"./chunk-HVXIXDLV.js";import{a as D}from"./chunk-6P5W4U6G.js";import{c as R}from"./chunk-OQSV6OS2.js";import{a as w}from"./chunk-2EC4JTHC.js";import{b as k}from"./chunk-OIMM7KMI.js";import{a as p}from"./chunk-4A4JFNWG.js";import{f as $}from"./chunk-N5D5ZCBW.js";import{a as C}from"./chunk-EKP7XJ6L.js";import{a as S}from"./chunk-NOVKLH2F.js";import{e as h,f as d}from"./chunk-TQTVM27C.js";import{existsSync as j}from"fs";import{existsSync as H,readFileSync as I,writeFileSync as T}from"fs";import{isAbsolute as O,join as M}from"path";var U=75e3,q=5e3,z=2500;function J(e){let i=L(e);return i.symbols>=U||i.documents>=q?z:void 0}var K=".scipquery-baseline.json";function u(e,i){return i&&O(i)?i:M(e.config.projectRoot,i??K)}function P(e,i={}){let{scope:t}=i,s=J(e),o=[],f=k(e,{scope:t,minLoc:3,skipBarrels:!0,deadCodeOnly:!0,scanLimit:s,semantic:!1});for(let n of f.symbols)h(e,n.relativePath)||d(e,n.symbol,n.relativePath)||n.kind==="dead-code"&&o.push(`dead:${n.relativePath}:${n.shortName}`);for(let n of x(e,{scope:t,minLoc:3,scanLimit:s,semantic:!1}))h(e,n.relativePath)||d(e,n.symbol,n.relativePath)||o.push(`isolated:${n.relativePath}:${n.shortName}`);for(let n of C(e,{scope:t}))n.kind==="real"&&o.push(`cycle:${W(n.path)}`);for(let n of v(e,{scope:t,minSimilarity:.6,limit:50,minCallees:4,scanLimit:s,semantic:!1}))o.push(`similar:${[n.symbolA,n.symbolB].sort().join("|")}`);for(let n of A(e,{scope:t,minLoc:15,minCallees:5,limit:50,scanLimit:s,semantic:!1}))o.push(`extract:${n.relativePath}:${n.shortName}`);for(let n of F(e,{scope:t,maxLoc:15,limit:50,scanLimit:s,semantic:!1}))o.push(`wrapper:${n.file}:${n.shortName}`);for(let n of B(e,{scope:t,maxLoc:15,limit:50,scanLimit:s,semantic:!1}))o.push(`passthrough:${n.file}:${n.shortName}`);for(let n of E(e,{scope:t,minLoc:3,limit:50,scanLimit:s,semantic:!1}))o.push(`stale:${n.file}:${n.shortName}`);for(let n of w(e,{scope:t,semantic:!1}).results)n.kind!=="pattern-deviation"&&o.push(`drift:${n.kind}:${n.file}:${n.dep}`);return[...new Set(o)].sort()}function W(e){if(e.length===0)return"";let i=0;for(let t=1;t<e.length;t++)e[t]<e[i]&&(i=t);return[...e.slice(i),...e.slice(0,i)].join(">")}function ue(e,i={}){let t=P(e,{scope:i.scope}),s=u(e,i.path);return T(s,JSON.stringify({version:1,findings:t},null,2)+`
|
|
2
|
+
`),{path:s,findingCount:t.length}}function _(e,i={}){let t=u(e,i.path);if(!H(t))throw new Error(`No baseline found at ${t}. Create one with: scip-query health --write-baseline`);let s=JSON.parse(I(t,"utf-8")),o=new Set(s.findings??[]),f=P(e,{scope:i.scope}),n=new Set(f);return{baselinePath:t,baselineCount:o.size,current:f,newFindings:f.filter(a=>!o.has(a)),fixedFindings:[...o].filter(a=>!n.has(a))}}function Ae(e,i={}){let t=i.base??"HEAD",{minTogether:s=6,minConfidence:o=.6,maxEchoChecks:f=10,minSimilarity:n=.8}=i,a=D(e,{base:t}),r=a.changedFiles,l=new Set(r),c={base:t,changedFiles:r,changedSymbols:a.changedSymbols.length,checksRun:[],skipped:[],findings:[],note:a.summary.note};return r.length===0||(Y(e,a.changedSymbols,l,f,n,c),Q(e,l,s,o,c),V(e,l,c),X(e,r,c),Z(e,a.changedSymbols,c),ee(e,c)),c}function Y(e,i,t,s,o,f){f.checksRun.push("echo");for(let n of i.slice(0,s)){let a=N(e,n.symbol,{minSimilarity:o,limit:3});for(let r of a){let l=r.fileA===n.file?r.fileB:r.fileA,c=r.fileA===n.file?r.shortNameB:r.shortNameA;t.has(l)||f.findings.push({check:"echo",message:`${n.shortName} (${n.file}) is ${Math.round(r.similarity*100)}% similar to established ${c} (${l})`,remediation:`Extend or reuse ${c} instead of keeping the re-implementation.`})}}i.length>s&&f.skipped.push({check:"echo",reason:`echo check capped at ${s} of ${i.length} changed symbols`})}function Q(e,i,t,s,o){let f=$(e,{minTogether:t,minConfidence:0});if(!f){o.skipped.push({check:"co-change-partner",reason:"no git history"});return}o.checksRun.push("co-change-partner");let n=new Set;for(let a of f){let r=i.has(a.fileA),l=i.has(a.fileB);if(r===l)continue;let c=r?a.fileA:a.fileB,m=r?a.fileB:a.fileA,g=r?a.changesA:a.changesB,y=g>0?a.together/g:0;if(y<s||p(m)||p(c)||!j(`${e.config.projectRoot}/${m}`))continue;let b=`${c}|${m}`;n.has(b)||(n.add(b),o.findings.push({check:"co-change-partner",message:`${c} changed, but ${m} did not \u2014 they change together ${a.together}x (${Math.round(y*100)}% of the time)`,remediation:`Update ${m} alongside this change, or confirm the coupling no longer holds.`}))}}function V(e,i,t){t.checksRun.push("doc-reference");for(let s of R(e,i))i.has(s.doc)||t.findings.push({check:"doc-reference",message:`${s.doc} cites ${s.cited.join(", ")} \u2014 changed in this diff, doc untouched`,remediation:`Re-read ${s.doc} and update its claims, or update its citations.`})}function X(e,i,t){t.checksRun.push("unused-params");for(let s of G(e,{files:i,limit:50}))t.findings.push({check:"unused-params",message:`${s.shortName} (${s.file}) has trailing unused parameter(s): ${s.unusedTrailing.join(", ")}`,remediation:"Drop the unused trailing parameters and their call-site arguments."})}function Z(e,i,t){t.checksRun.push("new-dead");let s=new S(e);for(let o of i)o.fanIn>0||s.fileKind(o.file)!=="test"&&(h(e,o.file)||d(e,o.symbol,o.file)||t.findings.push({check:"new-dead",message:`${o.shortName} (${o.file}) was changed but has zero indexed consumers`,remediation:"Wire it up, or remove it before it becomes permanent dead code."}))}function ee(e,i){if(!j(u(e))){i.skipped.push({check:"baseline",reason:"no .scipquery-baseline.json \u2014 run health --write-baseline to enable"});return}i.checksRun.push("baseline");let t=_(e);for(let s of t.newFindings)i.findings.push({check:"baseline",message:`new finding vs committed baseline: ${s}`,remediation:"Fix the finding, or knowingly accept it via health --write-baseline."})}export{P as a,ue as b,_ as c,Ae as d};
|
|
3
|
+
//# sourceMappingURL=chunk-XBFLIGWU.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as b}from"./chunk-MX6F756F.js";import{a as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as b}from"./chunk-MX6F756F.js";import{a as u}from"./chunk-NOVKLH2F.js";import{a as f}from"./chunk-EAU4RDFG.js";import{a as c}from"./chunk-PCMVXWDC.js";import{c as l}from"./chunk-SOGLYIJ4.js";function R(o,e={}){let{limit:r=20,scope:s,minFanIn:i=2,minFanOut:n=2,scanLimit:m}=e,p=new u(o);return b(p.productionCallableDefinitions({scope:s,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof m=="number"&&m>0}),m).map(t=>y(o,t,e.semantic!==!1)).filter(t=>t.fanIn>=i&&t.fanOut>=n).sort((t,a)=>a.score-t.score||a.fanIn-t.fanIn).slice(0,r)}function y(o,e,r){let s=new Set(f(o,e,{limit:500,semantic:r}).map(n=>n.file)).size,i=new Set(c(o,e,{limit:500,semantic:r}).filter(n=>n.file!==e.relativePath).map(n=>`${n.symbol}|${n.file}`)).size;return{symbol:e.symbol,shortName:l(e.symbol),fanIn:s,fanOut:i,score:s*i,definedIn:e.relativePath}}export{R as a};
|
|
2
|
+
//# sourceMappingURL=chunk-XSZ5NC4O.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{a as m}from"./chunk-
|
|
1
|
+
import{a as m}from"./chunk-WC43FMAB.js";import{a as h}from"./chunk-7I6KNKE3.js";import{c as p}from"./chunk-SOGLYIJ4.js";import{readFileSync as f}from"fs";import{extname as y,join as d}from"path";function M(t,e,a={}){let{context:s=0}=a,r=L(e);if(r)return j(t,r.filePath,r.startLine,r.endLine,s);let l=h(t,e);return l?R(t,l,s):null}function L(t){let e=t.match(/^(.+\.\w+):(\d+)-(\d+)$/);return e?{filePath:e[1],startLine:parseInt(e[2],10),endLine:parseInt(e[3],10)}:null}function R(t,e,a){let s=t.get("SELECT language FROM documents WHERE relative_path = ?",e.relativePath),r=d(t.config.projectRoot,e.relativePath),l;try{l=f(r,"utf-8")}catch{return null}let n=l.split(`
|
|
2
2
|
`),c=Math.max(0,e.startLine-a),i=Math.min(n.length-1,e.endLine+a),u=n.slice(c,i+1).join(`
|
|
3
3
|
`);return{symbol:e.symbol,shortName:p(e.symbol),relativePath:e.relativePath,startLine:c,endLine:i,language:s?.language??v(e.relativePath),source:u}}function j(t,e,a,s,r){let l=m(t,e);if(!l)return null;let n=t.get("SELECT relative_path, language FROM documents WHERE relative_path = ?",l);if(!n)return null;let c=d(t.config.projectRoot,n.relative_path),i;try{i=f(c,"utf-8")}catch{return null}let u=i.split(`
|
|
4
4
|
`),o=Math.max(0,a-1-r),g=Math.min(u.length-1,s-1+r),b=u.slice(o,g+1).join(`
|
|
5
5
|
`);return{symbol:`${n.relative_path}:${a}-${s}`,shortName:`${n.relative_path}:${a}-${s}`,relativePath:n.relative_path,startLine:o,endLine:g,language:n.language??v(n.relative_path),source:b}}function v(t){switch(y(t).toLowerCase()){case".ts":case".tsx":case".mts":case".cts":return"typescript";case".js":case".jsx":case".mjs":case".cjs":return"javascript";case".py":case".pyi":return"python";case".rs":return"rust";case".go":return"go";case".java":return"java";case".kt":case".kts":return"kotlin";case".scala":return"scala";case".rb":return"ruby";case".php":return"php";case".cs":return"csharp";case".vb":return"vb";case".dart":return"dart";case".c":case".h":return"c";case".cc":case".cpp":case".cxx":case".hpp":case".hh":case".hxx":return"cpp";case".vue":return"vue";default:return null}}export{M as a};
|
|
6
|
-
//# sourceMappingURL=chunk-
|
|
6
|
+
//# sourceMappingURL=chunk-Z2AJQ7VA.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a}from"./chunk-NOVKLH2F.js";import{a as i}from"./chunk-7I6KNKE3.js";import{c as s,e as o,k as m}from"./chunk-SOGLYIJ4.js";function L(t,l){let r=i(t,l);return r?new a(t).definitionsForFile(r.relativePath).filter(e=>e.symbol!==r.symbol).filter(e=>m(r.symbol,e.symbol)).sort((e,n)=>e.startLine-n.startLine||e.endLine-n.endLine).map(e=>({symbol:e.symbol,shortName:s(e.symbol),startLine:e.startLine,endLine:e.endLine,kind:o(e.symbol)??"unknown"})):[]}export{L as a};
|
|
2
|
+
//# sourceMappingURL=chunk-ZIIQ55VK.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b}from"./chunk-WC43FMAB.js";import{l as d,u as f}from"./chunk-SOGLYIJ4.js";function S(a,g){let p=b(a,g),i=f(a,p,{sort:!0});if(i.length===0)return[];let o=i.map(e=>({symbol:e.symbol,shortName:e.shortName,startLine:e.startLine,endLine:e.endLine,signature:e.signature,children:[]})),s=new Map;for(let e of o)s.set(e.symbol,e);let c=[];for(let e=0;e<i.length;e++){let r=i[e],n=o[e];if(r.enclosingSymbol&&s.has(r.enclosingSymbol)){s.get(r.enclosingSymbol).children.push(n);continue}let l=null,m=1/0;for(let t of o)if(t!==n&&t.startLine<=n.startLine&&t.endLine>=n.endLine){if(t.startLine===n.startLine&&t.endLine===n.endLine&&!d(t.symbol,n.symbol))continue;let u=t.endLine-t.startLine;u<m&&(m=u,l=t)}l?l.children.push(n):c.push(n)}return c}export{S as a};
|
|
2
|
+
//# sourceMappingURL=chunk-ZJ737ZMD.js.map
|