@kb-labs/quality-entry 2.105.0 → 2.107.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.
Files changed (42) hide show
  1. package/dist/widgets/117.js +2 -3
  2. package/dist/widgets/165.js +1 -2
  3. package/dist/widgets/326.js +1 -2
  4. package/dist/widgets/370.js +1 -2
  5. package/dist/widgets/405.js +1 -2
  6. package/dist/widgets/46.js +1 -2
  7. package/dist/widgets/50.js +1 -2
  8. package/dist/widgets/546.js +1 -2
  9. package/dist/widgets/62.js +1 -2
  10. package/dist/widgets/648.js +1 -2
  11. package/dist/widgets/669.js +1 -2
  12. package/dist/widgets/707.js +1 -2
  13. package/dist/widgets/775.js +1 -2
  14. package/dist/widgets/78.js +1 -2
  15. package/dist/widgets/875.js +25 -0
  16. package/dist/widgets/945.js +1 -2
  17. package/dist/widgets/968.js +1 -2
  18. package/dist/widgets/__federation_expose_QualityOverview.js +1 -2
  19. package/dist/widgets/mf-manifest.json +22 -22
  20. package/dist/widgets/mf-stats.json +26 -26
  21. package/dist/widgets/remoteEntry.js +2 -3
  22. package/package.json +6 -6
  23. package/dist/widgets/117.js.map +0 -1
  24. package/dist/widgets/165.js.map +0 -1
  25. package/dist/widgets/326.js.map +0 -1
  26. package/dist/widgets/370.js.map +0 -1
  27. package/dist/widgets/405.js.map +0 -1
  28. package/dist/widgets/46.js.map +0 -1
  29. package/dist/widgets/50.js.map +0 -1
  30. package/dist/widgets/546.js.map +0 -1
  31. package/dist/widgets/62.js.map +0 -1
  32. package/dist/widgets/648.js.map +0 -1
  33. package/dist/widgets/669.js.map +0 -1
  34. package/dist/widgets/707.js.map +0 -1
  35. package/dist/widgets/733.js +0 -35
  36. package/dist/widgets/733.js.map +0 -1
  37. package/dist/widgets/775.js.map +0 -1
  38. package/dist/widgets/78.js.map +0 -1
  39. package/dist/widgets/945.js.map +0 -1
  40. package/dist/widgets/968.js.map +0 -1
  41. package/dist/widgets/__federation_expose_QualityOverview.js.map +0 -1
  42. package/dist/widgets/remoteEntry.js.map +0 -1
@@ -1,2 +1 @@
1
- "use strict";(self.rspackChunk_kb_labs_quality_entry=self.rspackChunk_kb_labs_quality_entry||[]).push([[15],{6026(e,n){var t=Symbol.for("react.transitional.element");function l(e,n,l){var i=null;if(void 0!==l&&(i=""+l),void 0!==n.key&&(i=""+n.key),"key"in n)for(var r in l={},n)"key"!==r&&(l[r]=n[r]);else l=n;return{$$typeof:t,type:e,key:i,ref:void 0!==(n=l.ref)?n:null,props:l}}n.Fragment=Symbol.for("react.fragment"),n.jsx=l,n.jsxs=l},4552(e,n,t){e.exports=t(6026)},9586(e,n,t){t.r(n),t.d(n,{default:()=>S});var l=t(4552),i=t(92),r=t(5155),a=t(4519);function s(e){switch(e){case"A":return"green";case"B":return"blue";case"C":return"orange";case"D":return"red";case"F":return"volcano";default:return"default"}}function o(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return 0===e?null:(0,l.jsxs)("span",{style:{color:(n?e<0:e>0)?"#52c41a":"#ff4d4f",fontSize:12,marginLeft:4},children:[e>0?"▲":"▼"," ",Math.abs(e)]})}var c=[{key:"architecture",label:"Architecture",icon:"ApartmentOutlined"},{key:"typescript",label:"TypeScript",icon:"CodeOutlined"},{key:"deadCode",label:"Dead Code",icon:"DeleteOutlined"},{key:"depHygiene",label:"Dep Hygiene",icon:"NodeIndexOutlined"},{key:"testCoverage",label:"Test Coverage",icon:"CheckCircleOutlined"}];function d(){var e,n,t,i,d,u,h,p,x=(0,a.useData)("/v1/plugins/quality/stats"),g=x.data,y=x.isLoading,f=(0,a.useData)("/v1/plugins/quality/health"),I=f.data,j=f.isLoading,m=(0,a.useData)("/v1/plugins/quality/history"),v=m.data,U=m.isLoading;if(y||j||U)return(0,l.jsx)(r.UISkeleton,{active:!0,lines:8,style:{padding:"24px 0"}});var k=null==v?void 0:v.delta,S=null!=(n=null==v||null==(p=v.latest)?void 0:p.dimensions)?n:null==I?void 0:I.dimensions;return(0,l.jsxs)("div",{children:[(0,l.jsx)(r.UICard,{title:"Health Score",style:{marginBottom:24},children:(0,l.jsxs)(r.UIRow,{gutter:32,align:"middle",children:[(0,l.jsxs)(r.UICol,{span:8,style:{textAlign:"center"},children:[(0,l.jsx)(r.UIProgress,{type:"circle",percent:null!=(t=null==I?void 0:I.score)?t:0,size:160,status:(e=null==I?void 0:I.score)?e>=80?"success":e<60?"exception":"normal":"normal"}),(0,l.jsxs)("div",{style:{marginTop:12},children:[(0,l.jsxs)(r.UITag,{color:s(null==I?void 0:I.grade),style:{fontSize:16,padding:"4px 12px"},children:["Grade ",null!=(i=null==I?void 0:I.grade)?i:"—"]}),k&&(0,l.jsxs)("div",{style:{marginTop:8,color:"#8c8c8c",fontSize:13},children:[o(k.score)," vs previous snapshot"]})]})]}),(0,l.jsx)(r.UICol,{span:16,children:(0,l.jsx)(r.UIRow,{gutter:[16,16],children:c.map(function(e){var n,t,i,a,o,c=e.key,d=e.label,u=e.icon,h=S?S[c]:void 0;return(0,l.jsx)(r.UICol,{span:12,children:(0,l.jsxs)(r.UICard,{size:"small",style:{borderRadius:8},children:[(0,l.jsxs)(r.UISpace,{children:[(0,l.jsx)(r.UIIcon,{name:u}),(0,l.jsx)("span",{style:{fontWeight:500},children:d}),(0,l.jsx)(r.UITag,{color:s(null==h?void 0:h.grade),children:null!=(n=null==h?void 0:h.grade)?n:"—"})]}),(0,l.jsx)(r.UIProgress,{percent:null!=(t=null==h?void 0:h.score)?t:0,size:"small",showInfo:!1,strokeColor:(null!=(i=null==h?void 0:h.score)?i:0)>=80?"#52c41a":(null!=(a=null==h?void 0:h.score)?a:0)>=60?"#faad14":"#ff4d4f",style:{marginTop:8}}),(0,l.jsxs)("div",{style:{fontSize:12,color:"#8c8c8c",marginTop:4},children:[null!=(o=null==h?void 0:h.score)?o:0,"/100"]})]})},c)})})})]})}),k&&(0,l.jsx)(r.UIAlert,{variant:"info",showIcon:!0,icon:(0,l.jsx)(r.UIIcon,{name:"LineChartOutlined"}),message:"Changes since last snapshot",description:(0,l.jsx)(r.UIRow,{gutter:16,style:{marginTop:8},children:[{label:"Layering violations",value:-k.layeringViolations,invert:!0},{label:"Any count",value:-k.anyCount,invert:!0},{label:"Unused files",value:-k.unusedFiles,invert:!0},{label:"Unused deps",value:-k.unusedDeps,invert:!0},{label:"Avg instability",value:-k.avgInstability,invert:!0}].map(function(e){var n=e.label,t=e.value,i=e.invert;return(0,l.jsxs)(r.UICol,{children:[(0,l.jsxs)("span",{style:{color:"#8c8c8c"},children:[n,": "]}),o(t,i),0===t&&(0,l.jsx)("span",{style:{color:"#8c8c8c"},children:"—"})]},n)})}),style:{marginBottom:24}}),(0,l.jsxs)(r.UIRow,{gutter:16,children:[(0,l.jsx)(r.UICol,{span:8,children:(0,l.jsx)(r.UICard,{children:(0,l.jsx)(r.UIStatistic,{title:"Packages",value:null!=(d=null==g?void 0:g.packages)?d:0,prefix:(0,l.jsx)(r.UIIcon,{name:"DatabaseOutlined"})})})}),(0,l.jsx)(r.UICol,{span:8,children:(0,l.jsx)(r.UICard,{children:(0,l.jsx)(r.UIStatistic,{title:"Lines of Code",value:null!=(u=null==g?void 0:g.loc)?u:0,prefix:(0,l.jsx)(r.UIIcon,{name:"CodeOutlined"})})})}),(0,l.jsx)(r.UICol,{span:8,children:(0,l.jsx)(r.UICard,{children:(0,l.jsx)(r.UIStatistic,{title:"Total Size",value:null!=(h=null==g?void 0:g.size)?h:"N/A",prefix:(0,l.jsx)(r.UIIcon,{name:"FileTextOutlined"})})})})]})]})}var u=[{title:"Package",dataIndex:"name",key:"name",render:function(e){return(0,l.jsx)("code",{style:{fontSize:12},children:e})},ellipsis:!0},{title:"Ca (afferent)",dataIndex:"afferent",key:"afferent",width:110,sorter:function(e,n){return e.afferent-n.afferent}},{title:"Ce (efferent)",dataIndex:"efferent",key:"efferent",width:110,sorter:function(e,n){return e.efferent-n.efferent}},{title:"Instability",dataIndex:"instability",key:"instability",width:110,defaultSortOrder:"descend",sorter:function(e,n){return e.instability-n.instability},render:function(e){return(0,l.jsx)(r.UITag,{color:e>=.8?"#ff4d4f":e>=.6?"#faad14":e>=.4?"#1677ff":"#52c41a",children:e.toFixed(2)})}}],h=[{title:"File",dataIndex:"file",key:"file",ellipsis:!0,render:function(e){return(0,l.jsx)("code",{style:{fontSize:11},children:e.replace(/^.*\/src\//,"src/")})}},{title:"From",key:"from",width:180,render:function(e,n){return(0,l.jsxs)(r.UISpace,{size:4,children:[(0,l.jsx)(r.UITag,{children:n.fromPackage}),(0,l.jsxs)("span",{style:{color:"#8c8c8c",fontSize:11},children:["L",n.fromLayer]})]})}},{title:"To",key:"to",width:180,render:function(e,n){return(0,l.jsxs)(r.UISpace,{size:4,children:[(0,l.jsx)(r.UITag,{color:"red",children:n.toPackage}),(0,l.jsxs)("span",{style:{color:"#8c8c8c",fontSize:11},children:["L",n.toLayer]})]})}},{title:"Import",dataIndex:"importSpecifier",key:"importSpecifier",ellipsis:!0,render:function(e){return(0,l.jsx)("code",{style:{fontSize:11},children:e})}}];function p(){var e,n,t,i,s,o,c,d=(0,a.useData)("/v1/plugins/quality/coupling"),p=d.data,x=d.isLoading,g=(0,a.useData)("/v1/plugins/quality/layers"),y=g.data,f=g.isLoading;if(x||f)return(0,l.jsx)(r.UISkeleton,{active:!0,lines:10,style:{padding:"24px 0"}});var I=(null!=(e=null==y?void 0:y.totalViolations)?e:0)>0;return(0,l.jsxs)("div",{children:[(0,l.jsxs)(r.UIRow,{gutter:16,style:{marginBottom:24},children:[(0,l.jsx)(r.UICol,{span:8,children:(0,l.jsx)(r.UICard,{children:(0,l.jsx)(r.UIStatistic,{title:"Layering Violations",value:null!=(n=null==y?void 0:y.totalViolations)?n:0,valueStyle:{color:I?"#ff4d4f":"#52c41a"},prefix:(0,l.jsx)(r.UIIcon,{name:I?"WarningOutlined":"CheckCircleOutlined"})})})}),(0,l.jsx)(r.UICol,{span:8,children:(0,l.jsx)(r.UICard,{children:(0,l.jsx)(r.UIStatistic,{title:"Avg Instability",value:(null!=(t=null==p?void 0:p.avgInstability)?t:0).toFixed(2),prefix:(0,l.jsx)(r.UIIcon,{name:"NodeIndexOutlined"})})})}),(0,l.jsx)(r.UICol,{span:8,children:(0,l.jsx)(r.UICard,{children:(0,l.jsx)(r.UIStatistic,{title:"Affected Packages",value:null!=(i=null==y||null==(c=y.affectedPackages)?void 0:c.length)?i:0,prefix:(0,l.jsx)(r.UIIcon,{name:"ApartmentOutlined"})})})})]}),I&&(0,l.jsx)(r.UIAlert,{variant:"error",showIcon:!0,icon:(0,l.jsx)(r.UIIcon,{name:"WarningOutlined"}),message:"".concat(y.totalViolations," layering violation").concat(y.totalViolations>1?"s":""," detected"),description:"Lower-layer packages are importing from higher-layer packages, breaking the dependency rules.",style:{marginBottom:16}}),(0,l.jsx)(r.UICard,{title:"Layering Violations",style:{marginBottom:24},children:I?(0,l.jsx)(r.UITable,{dataSource:null!=(s=null==y?void 0:y.violations)?s:[],columns:h,rowKey:function(e){return"".concat(e.file,":").concat(e.importSpecifier)},size:"small",pagination:{pageSize:20}}):(0,l.jsx)(r.UIAlert,{variant:"success",showIcon:!0,icon:(0,l.jsx)(r.UIIcon,{name:"CheckCircleOutlined"}),message:"No layering violations — architecture is clean"})}),(0,l.jsx)(r.UICard,{title:"Package Coupling (Ca/Ce/Instability)",children:(0,l.jsx)(r.UITable,{dataSource:null!=(o=null==p?void 0:p.packages)?o:[],columns:u,rowKey:"name",size:"small",pagination:{pageSize:30}})})]})}var x=[{title:"File",dataIndex:"file",key:"file",ellipsis:!0,render:function(e){return(0,l.jsx)("code",{style:{fontSize:12},children:e})}}],g=[{title:"File",dataIndex:"file",key:"file",ellipsis:!0,render:function(e){return(0,l.jsx)("code",{style:{fontSize:12},children:e})}},{title:"Symbol",dataIndex:"symbol",key:"symbol",width:200,render:function(e){return(0,l.jsx)(r.UITag,{children:(0,l.jsx)("code",{children:e})})}}],y=[{title:"Package",dataIndex:"package",key:"package",render:function(e){return(0,l.jsx)("code",{style:{fontSize:12},children:e})}},{title:"Workspace",dataIndex:"workspace",key:"workspace",width:220,render:function(e){return(0,l.jsx)(r.UITag,{children:e})}}];function f(){var e,n,t,i,s,o,c,d,u,h,p,f,I,j,m=(0,a.useData)("/v1/plugins/quality/dead-code"),v=m.data,U=m.isLoading,k=(0,a.useData)("/v1/plugins/quality/health"),S=k.data,C=k.isLoading;if(U||C)return(0,l.jsx)(r.UISkeleton,{active:!0,lines:8,style:{padding:"24px 0"}});var b=null!=(n=null==S||null==(h=S.dimensions)||null==(u=h.typescript)?void 0:u.details)?n:[],w=null!=(t=null==S||null==(f=S.dimensions)||null==(p=f.typescript)?void 0:p.score)?t:100,z=null!=(i=null==S||null==(j=S.dimensions)||null==(I=j.typescript)?void 0:I.grade)?i:"A",T=(null!=(s=null==v?void 0:v.unusedFiles)?s:[]).map(function(e){return{key:e,file:e}}),A=(null!=(o=null==v?void 0:v.unusedExports)?o:[]).map(function(e){return{key:"".concat(e.file,":").concat(e.symbol),file:e.file,symbol:e.symbol}}),D=(null!=(c=null==v?void 0:v.unusedDependencies)?c:[]).map(function(e){return{key:"".concat(e.workspace,":").concat(e.package),package:e.package,workspace:e.workspace}}),O=(null!=(d=null==v?void 0:v.unlistedDependencies)?d:[]).map(function(e){return{key:"".concat(e.workspace,":").concat(e.package),package:e.package,workspace:e.workspace}});return(0,l.jsxs)("div",{children:[(0,l.jsxs)(r.UIRow,{gutter:16,style:{marginBottom:24},children:[(0,l.jsx)(r.UICol,{span:6,children:(0,l.jsx)(r.UICard,{children:(0,l.jsx)(r.UIStatistic,{title:"TypeScript Score",value:"".concat(w,"/100"),prefix:(0,l.jsx)(r.UITag,{color:null!=(e=({A:"green",B:"blue",C:"orange",D:"red",F:"volcano"})[z])?e:"default",children:z})})})}),(0,l.jsx)(r.UICol,{span:6,children:(0,l.jsx)(r.UICard,{children:(0,l.jsx)(r.UIStatistic,{title:"Unused Files",value:T.length,valueStyle:{color:T.length>0?"#ff4d4f":"#52c41a"},prefix:(0,l.jsx)(r.UIIcon,{name:"FileUnknownOutlined"})})})}),(0,l.jsx)(r.UICol,{span:6,children:(0,l.jsx)(r.UICard,{children:(0,l.jsx)(r.UIStatistic,{title:"Unused Exports",value:A.length,valueStyle:{color:A.length>0?"#faad14":"#52c41a"},prefix:(0,l.jsx)(r.UIIcon,{name:"ExportOutlined"})})})}),(0,l.jsx)(r.UICol,{span:6,children:(0,l.jsx)(r.UICard,{children:(0,l.jsx)(r.UIStatistic,{title:"Dep Issues",value:D.length+O.length,valueStyle:{color:D.length+O.length>0?"#faad14":"#52c41a"},prefix:(0,l.jsx)(r.UIIcon,{name:"NodeIndexOutlined"})})})})]}),b.length>0&&(0,l.jsx)(r.UICard,{title:"TypeScript Health",style:{marginBottom:24},children:b.map(function(e,n){return(0,l.jsx)(r.UIAlert,{variant:w<60?"error":w<80?"warning":"info",showIcon:!0,message:e,style:{marginBottom:8}},n)})}),T.length>0&&(0,l.jsx)(r.UICard,{title:(0,l.jsxs)(r.UISpace,{children:[(0,l.jsx)(r.UIIcon,{name:"FileUnknownOutlined"}),(0,l.jsx)("span",{children:"Unused Files"}),(0,l.jsx)(r.UITag,{color:"red",children:T.length})]}),style:{marginBottom:16},children:(0,l.jsx)(r.UITable,{dataSource:T,columns:x,size:"small",pagination:{pageSize:20}})}),A.length>0&&(0,l.jsx)(r.UICard,{title:(0,l.jsxs)(r.UISpace,{children:[(0,l.jsx)(r.UIIcon,{name:"ExportOutlined"}),(0,l.jsx)("span",{children:"Unused Exports"}),(0,l.jsx)(r.UITag,{color:"orange",children:A.length})]}),style:{marginBottom:16},children:(0,l.jsx)(r.UITable,{dataSource:A,columns:g,size:"small",pagination:{pageSize:20}})}),D.length>0&&(0,l.jsx)(r.UICard,{title:(0,l.jsxs)(r.UISpace,{children:[(0,l.jsx)(r.UIIcon,{name:"NodeCollapseOutlined"}),(0,l.jsx)("span",{children:"Unused Dependencies"}),(0,l.jsx)(r.UITag,{color:"orange",children:D.length})]}),style:{marginBottom:16},children:(0,l.jsx)(r.UITable,{dataSource:D,columns:y,size:"small",pagination:{pageSize:20}})}),O.length>0&&(0,l.jsx)(r.UICard,{title:(0,l.jsxs)(r.UISpace,{children:[(0,l.jsx)(r.UIIcon,{name:"WarningOutlined"}),(0,l.jsx)("span",{children:"Unlisted Dependencies"}),(0,l.jsx)(r.UITag,{color:"red",children:O.length})]}),children:(0,l.jsx)(r.UITable,{dataSource:O,columns:y,size:"small",pagination:{pageSize:20}})}),0===T.length&&0===A.length&&0===D.length&&0===O.length&&(0,l.jsx)(r.UIAlert,{variant:"success",showIcon:!0,icon:(0,l.jsx)(r.UIIcon,{name:"CheckCircleOutlined"}),message:"No dead code detected — codebase is clean"})]})}function I(e){var n;return null!=(n=({A:"green",B:"blue",C:"orange",D:"red",F:"volcano"})[null!=e?e:""])?n:"default"}function j(e){var n=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return 0===e?(0,l.jsx)("span",{style:{color:"#8c8c8c"},children:"—"}):(0,l.jsxs)("span",{style:{color:(n?e<0:e>0)?"#52c41a":"#ff4d4f"},children:[e>0?"▲":"▼"," ",Math.abs(e)]})}var m=[{title:"Date",dataIndex:"timestamp",key:"timestamp",width:170,render:function(e){return new Date(e).toLocaleString()}},{title:"Score",dataIndex:"score",key:"score",width:80,sorter:function(e,n){return e.score-n.score}},{title:"Grade",dataIndex:"grade",key:"grade",width:70,render:function(e){return(0,l.jsx)(r.UITag,{color:I(e),children:e})}},{title:"Architecture",key:"arch",width:110,render:function(e,n){return(0,l.jsxs)(r.UISpace,{size:4,children:[(0,l.jsx)(r.UITag,{color:I(n.dimensions.architecture.grade),style:{fontSize:11},children:n.dimensions.architecture.grade}),(0,l.jsx)("span",{style:{fontSize:11,color:"#8c8c8c"},children:n.dimensions.architecture.score})]})}},{title:"TypeScript",key:"ts",width:110,render:function(e,n){return(0,l.jsxs)(r.UISpace,{size:4,children:[(0,l.jsx)(r.UITag,{color:I(n.dimensions.typescript.grade),style:{fontSize:11},children:n.dimensions.typescript.grade}),(0,l.jsx)("span",{style:{fontSize:11,color:"#8c8c8c"},children:n.dimensions.typescript.score})]})}},{title:"Dead Code",key:"dc",width:110,render:function(e,n){return(0,l.jsxs)(r.UISpace,{size:4,children:[(0,l.jsx)(r.UITag,{color:I(n.dimensions.deadCode.grade),style:{fontSize:11},children:n.dimensions.deadCode.grade}),(0,l.jsx)("span",{style:{fontSize:11,color:"#8c8c8c"},children:n.dimensions.deadCode.score})]})}},{title:"Violations",key:"violations",width:95,render:function(e,n){return(0,l.jsx)("span",{style:{color:n.counters.layeringViolations>0?"#ff4d4f":"#52c41a"},children:n.counters.layeringViolations})}},{title:"Any",key:"any",width:70,render:function(e,n){return n.counters.anyCount}},{title:"Unused",key:"unused",width:80,render:function(e,n){return n.counters.unusedFiles}},{title:"Branch",key:"branch",width:120,ellipsis:!0,render:function(e,n){return(0,l.jsx)("code",{style:{fontSize:11},children:n.git.branch||"—"})}},{title:"Commit",key:"commit",width:90,render:function(e,n){return(0,l.jsx)("code",{style:{fontSize:11},children:n.git.commit?n.git.commit.slice(0,7):"—"})}}];function v(){var e,n=(0,a.useData)("/v1/plugins/quality/history"),t=n.data,i=n.isLoading,s=n.refetch,o=(0,a.useMutateData)("/v1/plugins/quality/snapshot"),c=(0,a.useNotification)();if(i)return(0,l.jsx)(r.UISkeleton,{active:!0,lines:8,style:{padding:"24px 0"}});var d=null!=(e=null==t?void 0:t.snapshots)?e:[],u=null==t?void 0:t.delta,h=u&&Object.values(u).some(function(e){return 0!==e});return(0,l.jsxs)("div",{children:[u&&(0,l.jsx)(r.UICard,{title:"Changes since last snapshot",style:{marginBottom:24},children:h?(0,l.jsxs)("div",{style:{display:"flex",gap:32,flexWrap:"wrap"},children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{style:{color:"#8c8c8c"},children:"Score "}),j(u.score,!1)]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{style:{color:"#8c8c8c"},children:"Violations "}),j(u.layeringViolations)]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{style:{color:"#8c8c8c"},children:"Any count "}),j(u.anyCount)]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{style:{color:"#8c8c8c"},children:"Ts-ignore "}),j(u.tsIgnoreCount)]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{style:{color:"#8c8c8c"},children:"Unused files "}),j(u.unusedFiles)]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{style:{color:"#8c8c8c"},children:"Unused deps "}),j(u.unusedDeps)]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{style:{color:"#8c8c8c"},children:"Avg instability "}),j(parseFloat(u.avgInstability.toFixed(2)))]})]}):(0,l.jsx)("span",{style:{color:"#8c8c8c",fontSize:13},children:"No changes since last snapshot"})}),(0,l.jsx)(r.UICard,{title:"Snapshot History (".concat(d.length,")"),extra:(0,l.jsx)(r.UIButton,{size:"small",icon:(0,l.jsx)(r.UIIcon,{name:"CameraOutlined"}),loading:o.isLoading,onClick:function(){o.mutate({},{onSuccess:function(){c.success("Snapshot saved"),s()},onError:function(e){var n;c.error("Failed: ".concat((null!=(n=Error)&&"u">typeof Symbol&&n[Symbol.hasInstance]?!!n[Symbol.hasInstance](e):e instanceof n)?e.message:String(e)))}})},children:"Save Snapshot"}),children:0===d.length?(0,l.jsx)(r.UIAlert,{variant:"info",showIcon:!0,icon:(0,l.jsx)(r.UIIcon,{name:"InfoCircleOutlined"}),message:"No snapshots yet",description:'Run "kb quality snapshot" or click "Save Snapshot" to start tracking trends.'}):(0,l.jsx)(r.UITable,{dataSource:d.slice().reverse(),columns:m,rowKey:"id",size:"small",pagination:{pageSize:20},scroll:{x:1200}})})]})}function U(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,l=Array(n);t<n;t++)l[t]=e[t];return l}function k(){var e,n,t,s,o=function(e){if(Array.isArray(e))return e}(e=i.useState())||function(e){var n,t,l=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=l){var i=[],r=!0,a=!1;try{for(l=l.call(e);!(r=(n=l.next()).done)&&(i.push(n.value),2!==i.length);r=!0);}catch(e){a=!0,t=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw t}}return i}}(e)||function(e){if(e){if("string"==typeof e)return U(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return U(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),c=o[0],d=o[1],u=c?"/v1/plugins/quality/build-order?package=".concat(encodeURIComponent(c)):"/v1/plugins/quality/build-order",h=(0,a.useData)(u),p=h.data,x=h.isLoading,g=h.isError;if((0,a.useData)("/v1/plugins/quality/cycles").data,x)return(0,l.jsx)(r.UISkeleton,{active:!0,lines:6,style:{padding:"24px 0"}});if(g)return(0,l.jsx)(r.UIAlert,{message:"Failed to load build order",variant:"error",showIcon:!0});var y=[{title:"Layer",dataIndex:"layer",key:"layer",width:100,render:function(e){return(0,l.jsxs)(r.UITag,{color:"blue",children:["Layer ",e]})}},{title:"Packages (can build in parallel)",dataIndex:"packages",key:"packages",render:function(e){return(0,l.jsx)(r.UISpace,{wrap:!0,children:e.map(function(e){return(0,l.jsx)(r.UITag,{children:e},e)})})}}],f=null==p?void 0:p.layers.map(function(e,n){return{layer:n+1,packages:e,key:n}});return(0,l.jsxs)("div",{children:[(null==p?void 0:p.hasCircular)&&(0,l.jsx)(r.UIAlert,{message:"Circular Dependencies Detected!",description:"Found ".concat(p.circular.length," circular dependency cycles. Build order may not be correct."),variant:"error",showIcon:!0,style:{marginBottom:24}}),(0,l.jsx)(r.UICard,{title:"Filter",style:{marginBottom:24},children:(0,l.jsx)(r.UISelect,{style:{width:400},placeholder:"Select package to see its build dependencies",value:c,onChange:function(e){return d(e)},allowClear:!0,showSearch:!0,options:null!=(n=null==p?void 0:p.sorted.map(function(e){return{label:e,value:e}}))?n:[]})}),(0,l.jsx)(r.UICard,{title:"Build Layers (".concat(null!=(t=null==p?void 0:p.layerCount)?t:0," layers, ").concat(null!=(s=null==p?void 0:p.packageCount)?s:0," packages)"),style:{marginBottom:24},children:(0,l.jsx)(r.UITable,{dataSource:null!=f?f:[],columns:y,pagination:!1,expandable:{expandedRowRender:function(e){return(0,l.jsxs)("div",{style:{padding:"8px 0"},children:[(0,l.jsx)("strong",{children:"Packages in this layer:"}),(0,l.jsx)("div",{style:{marginTop:8},children:e.packages.map(function(e){return(0,l.jsx)(r.UITag,{style:{marginBottom:4},children:e},e)})})]})}}})}),(null==p?void 0:p.hasCircular)&&(0,l.jsx)(r.UICard,{title:"Circular Dependencies (".concat(p.circular.length,")"),children:p.circular.map(function(e,n){return(0,l.jsx)(r.UIAlert,{message:"Cycle ".concat(n+1),description:e.join(" → "),variant:"warning",showIcon:!0,style:{marginBottom:12}},n)})})]})}function S(){var e=(0,l.jsx)(r.UITabs,{syncUrl:"search",items:[{key:"overview",label:"Overview",children:(0,l.jsx)(d,{})},{key:"architecture",label:"Architecture",children:(0,l.jsx)(p,{})},{key:"debt",label:"Debt",children:(0,l.jsx)(f,{})},{key:"history",label:"History",children:(0,l.jsx)(v,{})},{key:"build-order",label:"Build Order",children:(0,l.jsx)(k,{})}]});return(0,l.jsx)(r.UIPage,{children:(0,l.jsx)(r.UIPageHeader,{title:"Quality",description:"Code health, architecture analysis, and trend tracking",tabs:e})})}}}]);
2
- //# sourceMappingURL=__federation_expose_QualityOverview.js.map
1
+ "use strict";(self.rspackChunk_kb_labs_quality_entry=self.rspackChunk_kb_labs_quality_entry||[]).push([[15],{6026(e,n){var t=Symbol.for("react.transitional.element");function l(e,n,l){var i=null;if(void 0!==l&&(i=""+l),void 0!==n.key&&(i=""+n.key),"key"in n)for(var r in l={},n)"key"!==r&&(l[r]=n[r]);else l=n;return{$$typeof:t,type:e,key:i,ref:void 0!==(n=l.ref)?n:null,props:l}}n.Fragment=Symbol.for("react.fragment"),n.jsx=l,n.jsxs=l},4552(e,n,t){e.exports=t(6026)},9586(e,n,t){t.r(n),t.d(n,{default:()=>S});var l=t(4552),i=t(92),r=t(5155),a=t(4519);function s(e){switch(e){case"A":return"green";case"B":return"blue";case"C":return"orange";case"D":return"red";case"F":return"volcano";default:return"default"}}function o(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return 0===e?null:(0,l.jsxs)("span",{style:{color:(n?e<0:e>0)?"#52c41a":"#ff4d4f",fontSize:12,marginLeft:4},children:[e>0?"▲":"▼"," ",Math.abs(e)]})}var c=[{key:"architecture",label:"Architecture",icon:"ApartmentOutlined"},{key:"typescript",label:"TypeScript",icon:"CodeOutlined"},{key:"deadCode",label:"Dead Code",icon:"DeleteOutlined"},{key:"depHygiene",label:"Dep Hygiene",icon:"NodeIndexOutlined"},{key:"testCoverage",label:"Test Coverage",icon:"CheckCircleOutlined"}];function d(){var e,n,t,i,d,u,h,p,x=(0,a.useData)("/v1/plugins/quality/stats"),g=x.data,y=x.isLoading,f=(0,a.useData)("/v1/plugins/quality/health"),I=f.data,j=f.isLoading,m=(0,a.useData)("/v1/plugins/quality/history"),v=m.data,U=m.isLoading;if(y||j||U)return(0,l.jsx)(r.UISkeleton,{active:!0,lines:8,style:{padding:"24px 0"}});var k=null==v?void 0:v.delta,S=null!=(n=null==v||null==(p=v.latest)?void 0:p.dimensions)?n:null==I?void 0:I.dimensions;return(0,l.jsxs)("div",{children:[(0,l.jsx)(r.UICard,{title:"Health Score",style:{marginBottom:24},children:(0,l.jsxs)(r.UIRow,{gutter:32,align:"middle",children:[(0,l.jsxs)(r.UICol,{span:8,style:{textAlign:"center"},children:[(0,l.jsx)(r.UIProgress,{type:"circle",percent:null!=(t=null==I?void 0:I.score)?t:0,size:160,status:(e=null==I?void 0:I.score)?e>=80?"success":e<60?"exception":"normal":"normal"}),(0,l.jsxs)("div",{style:{marginTop:12},children:[(0,l.jsxs)(r.UITag,{color:s(null==I?void 0:I.grade),style:{fontSize:16,padding:"4px 12px"},children:["Grade ",null!=(i=null==I?void 0:I.grade)?i:"—"]}),k&&(0,l.jsxs)("div",{style:{marginTop:8,color:"#8c8c8c",fontSize:13},children:[o(k.score)," vs previous snapshot"]})]})]}),(0,l.jsx)(r.UICol,{span:16,children:(0,l.jsx)(r.UIRow,{gutter:[16,16],children:c.map(function(e){var n,t,i,a,o,c=e.key,d=e.label,u=e.icon,h=S?S[c]:void 0;return(0,l.jsx)(r.UICol,{span:12,children:(0,l.jsxs)(r.UICard,{size:"small",style:{borderRadius:8},children:[(0,l.jsxs)(r.UISpace,{children:[(0,l.jsx)(r.UIIcon,{name:u}),(0,l.jsx)("span",{style:{fontWeight:500},children:d}),(0,l.jsx)(r.UITag,{color:s(null==h?void 0:h.grade),children:null!=(n=null==h?void 0:h.grade)?n:"—"})]}),(0,l.jsx)(r.UIProgress,{percent:null!=(t=null==h?void 0:h.score)?t:0,size:"small",showInfo:!1,strokeColor:(null!=(i=null==h?void 0:h.score)?i:0)>=80?"#52c41a":(null!=(a=null==h?void 0:h.score)?a:0)>=60?"#faad14":"#ff4d4f",style:{marginTop:8}}),(0,l.jsxs)("div",{style:{fontSize:12,color:"#8c8c8c",marginTop:4},children:[null!=(o=null==h?void 0:h.score)?o:0,"/100"]})]})},c)})})})]})}),k&&(0,l.jsx)(r.UIAlert,{variant:"info",showIcon:!0,icon:(0,l.jsx)(r.UIIcon,{name:"LineChartOutlined"}),message:"Changes since last snapshot",description:(0,l.jsx)(r.UIRow,{gutter:16,style:{marginTop:8},children:[{label:"Layering violations",value:-k.layeringViolations,invert:!0},{label:"Any count",value:-k.anyCount,invert:!0},{label:"Unused files",value:-k.unusedFiles,invert:!0},{label:"Unused deps",value:-k.unusedDeps,invert:!0},{label:"Avg instability",value:-k.avgInstability,invert:!0}].map(function(e){var n=e.label,t=e.value,i=e.invert;return(0,l.jsxs)(r.UICol,{children:[(0,l.jsxs)("span",{style:{color:"#8c8c8c"},children:[n,": "]}),o(t,i),0===t&&(0,l.jsx)("span",{style:{color:"#8c8c8c"},children:"—"})]},n)})}),style:{marginBottom:24}}),(0,l.jsxs)(r.UIRow,{gutter:16,children:[(0,l.jsx)(r.UICol,{span:8,children:(0,l.jsx)(r.UICard,{children:(0,l.jsx)(r.UIStatistic,{title:"Packages",value:null!=(d=null==g?void 0:g.packages)?d:0,prefix:(0,l.jsx)(r.UIIcon,{name:"DatabaseOutlined"})})})}),(0,l.jsx)(r.UICol,{span:8,children:(0,l.jsx)(r.UICard,{children:(0,l.jsx)(r.UIStatistic,{title:"Lines of Code",value:null!=(u=null==g?void 0:g.loc)?u:0,prefix:(0,l.jsx)(r.UIIcon,{name:"CodeOutlined"})})})}),(0,l.jsx)(r.UICol,{span:8,children:(0,l.jsx)(r.UICard,{children:(0,l.jsx)(r.UIStatistic,{title:"Total Size",value:null!=(h=null==g?void 0:g.size)?h:"N/A",prefix:(0,l.jsx)(r.UIIcon,{name:"FileTextOutlined"})})})})]})]})}var u=[{title:"Package",dataIndex:"name",key:"name",render:function(e){return(0,l.jsx)("code",{style:{fontSize:12},children:e})},ellipsis:!0},{title:"Ca (afferent)",dataIndex:"afferent",key:"afferent",width:110,sorter:function(e,n){return e.afferent-n.afferent}},{title:"Ce (efferent)",dataIndex:"efferent",key:"efferent",width:110,sorter:function(e,n){return e.efferent-n.efferent}},{title:"Instability",dataIndex:"instability",key:"instability",width:110,defaultSortOrder:"descend",sorter:function(e,n){return e.instability-n.instability},render:function(e){return(0,l.jsx)(r.UITag,{color:e>=.8?"#ff4d4f":e>=.6?"#faad14":e>=.4?"#1677ff":"#52c41a",children:e.toFixed(2)})}}],h=[{title:"File",dataIndex:"file",key:"file",ellipsis:!0,render:function(e){return(0,l.jsx)("code",{style:{fontSize:11},children:e.replace(/^.*\/src\//,"src/")})}},{title:"From",key:"from",width:180,render:function(e,n){return(0,l.jsxs)(r.UISpace,{size:4,children:[(0,l.jsx)(r.UITag,{children:n.fromPackage}),(0,l.jsxs)("span",{style:{color:"#8c8c8c",fontSize:11},children:["L",n.fromLayer]})]})}},{title:"To",key:"to",width:180,render:function(e,n){return(0,l.jsxs)(r.UISpace,{size:4,children:[(0,l.jsx)(r.UITag,{color:"red",children:n.toPackage}),(0,l.jsxs)("span",{style:{color:"#8c8c8c",fontSize:11},children:["L",n.toLayer]})]})}},{title:"Import",dataIndex:"importSpecifier",key:"importSpecifier",ellipsis:!0,render:function(e){return(0,l.jsx)("code",{style:{fontSize:11},children:e})}}];function p(){var e,n,t,i,s,o,c,d=(0,a.useData)("/v1/plugins/quality/coupling"),p=d.data,x=d.isLoading,g=(0,a.useData)("/v1/plugins/quality/layers"),y=g.data,f=g.isLoading;if(x||f)return(0,l.jsx)(r.UISkeleton,{active:!0,lines:10,style:{padding:"24px 0"}});var I=(null!=(e=null==y?void 0:y.totalViolations)?e:0)>0;return(0,l.jsxs)("div",{children:[(0,l.jsxs)(r.UIRow,{gutter:16,style:{marginBottom:24},children:[(0,l.jsx)(r.UICol,{span:8,children:(0,l.jsx)(r.UICard,{children:(0,l.jsx)(r.UIStatistic,{title:"Layering Violations",value:null!=(n=null==y?void 0:y.totalViolations)?n:0,valueStyle:{color:I?"#ff4d4f":"#52c41a"},prefix:(0,l.jsx)(r.UIIcon,{name:I?"WarningOutlined":"CheckCircleOutlined"})})})}),(0,l.jsx)(r.UICol,{span:8,children:(0,l.jsx)(r.UICard,{children:(0,l.jsx)(r.UIStatistic,{title:"Avg Instability",value:(null!=(t=null==p?void 0:p.avgInstability)?t:0).toFixed(2),prefix:(0,l.jsx)(r.UIIcon,{name:"NodeIndexOutlined"})})})}),(0,l.jsx)(r.UICol,{span:8,children:(0,l.jsx)(r.UICard,{children:(0,l.jsx)(r.UIStatistic,{title:"Affected Packages",value:null!=(i=null==y||null==(c=y.affectedPackages)?void 0:c.length)?i:0,prefix:(0,l.jsx)(r.UIIcon,{name:"ApartmentOutlined"})})})})]}),I&&(0,l.jsx)(r.UIAlert,{variant:"error",showIcon:!0,icon:(0,l.jsx)(r.UIIcon,{name:"WarningOutlined"}),message:"".concat(y.totalViolations," layering violation").concat(y.totalViolations>1?"s":""," detected"),description:"Lower-layer packages are importing from higher-layer packages, breaking the dependency rules.",style:{marginBottom:16}}),(0,l.jsx)(r.UICard,{title:"Layering Violations",style:{marginBottom:24},children:I?(0,l.jsx)(r.UITable,{dataSource:null!=(s=null==y?void 0:y.violations)?s:[],columns:h,rowKey:function(e){return"".concat(e.file,":").concat(e.importSpecifier)},size:"small",pagination:{pageSize:20}}):(0,l.jsx)(r.UIAlert,{variant:"success",showIcon:!0,icon:(0,l.jsx)(r.UIIcon,{name:"CheckCircleOutlined"}),message:"No layering violations — architecture is clean"})}),(0,l.jsx)(r.UICard,{title:"Package Coupling (Ca/Ce/Instability)",children:(0,l.jsx)(r.UITable,{dataSource:null!=(o=null==p?void 0:p.packages)?o:[],columns:u,rowKey:"name",size:"small",pagination:{pageSize:30}})})]})}var x=[{title:"File",dataIndex:"file",key:"file",ellipsis:!0,render:function(e){return(0,l.jsx)("code",{style:{fontSize:12},children:e})}}],g=[{title:"File",dataIndex:"file",key:"file",ellipsis:!0,render:function(e){return(0,l.jsx)("code",{style:{fontSize:12},children:e})}},{title:"Symbol",dataIndex:"symbol",key:"symbol",width:200,render:function(e){return(0,l.jsx)(r.UITag,{children:(0,l.jsx)("code",{children:e})})}}],y=[{title:"Package",dataIndex:"package",key:"package",render:function(e){return(0,l.jsx)("code",{style:{fontSize:12},children:e})}},{title:"Workspace",dataIndex:"workspace",key:"workspace",width:220,render:function(e){return(0,l.jsx)(r.UITag,{children:e})}}];function f(){var e,n,t,i,s,o,c,d,u,h,p,f,I,j,m=(0,a.useData)("/v1/plugins/quality/dead-code"),v=m.data,U=m.isLoading,k=(0,a.useData)("/v1/plugins/quality/health"),S=k.data,C=k.isLoading;if(U||C)return(0,l.jsx)(r.UISkeleton,{active:!0,lines:8,style:{padding:"24px 0"}});var b=null!=(n=null==S||null==(h=S.dimensions)||null==(u=h.typescript)?void 0:u.details)?n:[],w=null!=(t=null==S||null==(f=S.dimensions)||null==(p=f.typescript)?void 0:p.score)?t:100,z=null!=(i=null==S||null==(j=S.dimensions)||null==(I=j.typescript)?void 0:I.grade)?i:"A",T=(null!=(s=null==v?void 0:v.unusedFiles)?s:[]).map(function(e){return{key:e,file:e}}),A=(null!=(o=null==v?void 0:v.unusedExports)?o:[]).map(function(e){return{key:"".concat(e.file,":").concat(e.symbol),file:e.file,symbol:e.symbol}}),D=(null!=(c=null==v?void 0:v.unusedDependencies)?c:[]).map(function(e){return{key:"".concat(e.workspace,":").concat(e.package),package:e.package,workspace:e.workspace}}),O=(null!=(d=null==v?void 0:v.unlistedDependencies)?d:[]).map(function(e){return{key:"".concat(e.workspace,":").concat(e.package),package:e.package,workspace:e.workspace}});return(0,l.jsxs)("div",{children:[(0,l.jsxs)(r.UIRow,{gutter:16,style:{marginBottom:24},children:[(0,l.jsx)(r.UICol,{span:6,children:(0,l.jsx)(r.UICard,{children:(0,l.jsx)(r.UIStatistic,{title:"TypeScript Score",value:"".concat(w,"/100"),prefix:(0,l.jsx)(r.UITag,{color:null!=(e=({A:"green",B:"blue",C:"orange",D:"red",F:"volcano"})[z])?e:"default",children:z})})})}),(0,l.jsx)(r.UICol,{span:6,children:(0,l.jsx)(r.UICard,{children:(0,l.jsx)(r.UIStatistic,{title:"Unused Files",value:T.length,valueStyle:{color:T.length>0?"#ff4d4f":"#52c41a"},prefix:(0,l.jsx)(r.UIIcon,{name:"FileUnknownOutlined"})})})}),(0,l.jsx)(r.UICol,{span:6,children:(0,l.jsx)(r.UICard,{children:(0,l.jsx)(r.UIStatistic,{title:"Unused Exports",value:A.length,valueStyle:{color:A.length>0?"#faad14":"#52c41a"},prefix:(0,l.jsx)(r.UIIcon,{name:"ExportOutlined"})})})}),(0,l.jsx)(r.UICol,{span:6,children:(0,l.jsx)(r.UICard,{children:(0,l.jsx)(r.UIStatistic,{title:"Dep Issues",value:D.length+O.length,valueStyle:{color:D.length+O.length>0?"#faad14":"#52c41a"},prefix:(0,l.jsx)(r.UIIcon,{name:"NodeIndexOutlined"})})})})]}),b.length>0&&(0,l.jsx)(r.UICard,{title:"TypeScript Health",style:{marginBottom:24},children:b.map(function(e,n){return(0,l.jsx)(r.UIAlert,{variant:w<60?"error":w<80?"warning":"info",showIcon:!0,message:e,style:{marginBottom:8}},n)})}),T.length>0&&(0,l.jsx)(r.UICard,{title:(0,l.jsxs)(r.UISpace,{children:[(0,l.jsx)(r.UIIcon,{name:"FileUnknownOutlined"}),(0,l.jsx)("span",{children:"Unused Files"}),(0,l.jsx)(r.UITag,{color:"red",children:T.length})]}),style:{marginBottom:16},children:(0,l.jsx)(r.UITable,{dataSource:T,columns:x,size:"small",pagination:{pageSize:20}})}),A.length>0&&(0,l.jsx)(r.UICard,{title:(0,l.jsxs)(r.UISpace,{children:[(0,l.jsx)(r.UIIcon,{name:"ExportOutlined"}),(0,l.jsx)("span",{children:"Unused Exports"}),(0,l.jsx)(r.UITag,{color:"orange",children:A.length})]}),style:{marginBottom:16},children:(0,l.jsx)(r.UITable,{dataSource:A,columns:g,size:"small",pagination:{pageSize:20}})}),D.length>0&&(0,l.jsx)(r.UICard,{title:(0,l.jsxs)(r.UISpace,{children:[(0,l.jsx)(r.UIIcon,{name:"NodeCollapseOutlined"}),(0,l.jsx)("span",{children:"Unused Dependencies"}),(0,l.jsx)(r.UITag,{color:"orange",children:D.length})]}),style:{marginBottom:16},children:(0,l.jsx)(r.UITable,{dataSource:D,columns:y,size:"small",pagination:{pageSize:20}})}),O.length>0&&(0,l.jsx)(r.UICard,{title:(0,l.jsxs)(r.UISpace,{children:[(0,l.jsx)(r.UIIcon,{name:"WarningOutlined"}),(0,l.jsx)("span",{children:"Unlisted Dependencies"}),(0,l.jsx)(r.UITag,{color:"red",children:O.length})]}),children:(0,l.jsx)(r.UITable,{dataSource:O,columns:y,size:"small",pagination:{pageSize:20}})}),0===T.length&&0===A.length&&0===D.length&&0===O.length&&(0,l.jsx)(r.UIAlert,{variant:"success",showIcon:!0,icon:(0,l.jsx)(r.UIIcon,{name:"CheckCircleOutlined"}),message:"No dead code detected — codebase is clean"})]})}function I(e){var n;return null!=(n=({A:"green",B:"blue",C:"orange",D:"red",F:"volcano"})[null!=e?e:""])?n:"default"}function j(e){var n=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return 0===e?(0,l.jsx)("span",{style:{color:"#8c8c8c"},children:"—"}):(0,l.jsxs)("span",{style:{color:(n?e<0:e>0)?"#52c41a":"#ff4d4f"},children:[e>0?"▲":"▼"," ",Math.abs(e)]})}var m=[{title:"Date",dataIndex:"timestamp",key:"timestamp",width:170,render:function(e){return new Date(e).toLocaleString()}},{title:"Score",dataIndex:"score",key:"score",width:80,sorter:function(e,n){return e.score-n.score}},{title:"Grade",dataIndex:"grade",key:"grade",width:70,render:function(e){return(0,l.jsx)(r.UITag,{color:I(e),children:e})}},{title:"Architecture",key:"arch",width:110,render:function(e,n){return(0,l.jsxs)(r.UISpace,{size:4,children:[(0,l.jsx)(r.UITag,{color:I(n.dimensions.architecture.grade),style:{fontSize:11},children:n.dimensions.architecture.grade}),(0,l.jsx)("span",{style:{fontSize:11,color:"#8c8c8c"},children:n.dimensions.architecture.score})]})}},{title:"TypeScript",key:"ts",width:110,render:function(e,n){return(0,l.jsxs)(r.UISpace,{size:4,children:[(0,l.jsx)(r.UITag,{color:I(n.dimensions.typescript.grade),style:{fontSize:11},children:n.dimensions.typescript.grade}),(0,l.jsx)("span",{style:{fontSize:11,color:"#8c8c8c"},children:n.dimensions.typescript.score})]})}},{title:"Dead Code",key:"dc",width:110,render:function(e,n){return(0,l.jsxs)(r.UISpace,{size:4,children:[(0,l.jsx)(r.UITag,{color:I(n.dimensions.deadCode.grade),style:{fontSize:11},children:n.dimensions.deadCode.grade}),(0,l.jsx)("span",{style:{fontSize:11,color:"#8c8c8c"},children:n.dimensions.deadCode.score})]})}},{title:"Violations",key:"violations",width:95,render:function(e,n){return(0,l.jsx)("span",{style:{color:n.counters.layeringViolations>0?"#ff4d4f":"#52c41a"},children:n.counters.layeringViolations})}},{title:"Any",key:"any",width:70,render:function(e,n){return n.counters.anyCount}},{title:"Unused",key:"unused",width:80,render:function(e,n){return n.counters.unusedFiles}},{title:"Branch",key:"branch",width:120,ellipsis:!0,render:function(e,n){return(0,l.jsx)("code",{style:{fontSize:11},children:n.git.branch||"—"})}},{title:"Commit",key:"commit",width:90,render:function(e,n){return(0,l.jsx)("code",{style:{fontSize:11},children:n.git.commit?n.git.commit.slice(0,7):"—"})}}];function v(){var e,n=(0,a.useData)("/v1/plugins/quality/history"),t=n.data,i=n.isLoading,s=n.refetch,o=(0,a.useMutateData)("/v1/plugins/quality/snapshot"),c=(0,a.useNotification)();if(i)return(0,l.jsx)(r.UISkeleton,{active:!0,lines:8,style:{padding:"24px 0"}});var d=null!=(e=null==t?void 0:t.snapshots)?e:[],u=null==t?void 0:t.delta,h=u&&Object.values(u).some(function(e){return 0!==e});return(0,l.jsxs)("div",{children:[u&&(0,l.jsx)(r.UICard,{title:"Changes since last snapshot",style:{marginBottom:24},children:h?(0,l.jsxs)("div",{style:{display:"flex",gap:32,flexWrap:"wrap"},children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{style:{color:"#8c8c8c"},children:"Score "}),j(u.score,!1)]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{style:{color:"#8c8c8c"},children:"Violations "}),j(u.layeringViolations)]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{style:{color:"#8c8c8c"},children:"Any count "}),j(u.anyCount)]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{style:{color:"#8c8c8c"},children:"Ts-ignore "}),j(u.tsIgnoreCount)]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{style:{color:"#8c8c8c"},children:"Unused files "}),j(u.unusedFiles)]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{style:{color:"#8c8c8c"},children:"Unused deps "}),j(u.unusedDeps)]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{style:{color:"#8c8c8c"},children:"Avg instability "}),j(parseFloat(u.avgInstability.toFixed(2)))]})]}):(0,l.jsx)("span",{style:{color:"#8c8c8c",fontSize:13},children:"No changes since last snapshot"})}),(0,l.jsx)(r.UICard,{title:"Snapshot History (".concat(d.length,")"),extra:(0,l.jsx)(r.UIButton,{size:"small",icon:(0,l.jsx)(r.UIIcon,{name:"CameraOutlined"}),loading:o.isLoading,onClick:function(){o.mutate({},{onSuccess:function(){c.success("Snapshot saved"),s()},onError:function(e){var n;c.error("Failed: ".concat((null!=(n=Error)&&"u">typeof Symbol&&n[Symbol.hasInstance]?!!n[Symbol.hasInstance](e):e instanceof n)?e.message:String(e)))}})},children:"Save Snapshot"}),children:0===d.length?(0,l.jsx)(r.UIAlert,{variant:"info",showIcon:!0,icon:(0,l.jsx)(r.UIIcon,{name:"InfoCircleOutlined"}),message:"No snapshots yet",description:'Run "kb quality snapshot" or click "Save Snapshot" to start tracking trends.'}):(0,l.jsx)(r.UITable,{dataSource:d.slice().reverse(),columns:m,rowKey:"id",size:"small",pagination:{pageSize:20},scroll:{x:1200}})})]})}function U(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,l=Array(n);t<n;t++)l[t]=e[t];return l}function k(){var e,n,t,s,o=function(e){if(Array.isArray(e))return e}(e=i.useState())||function(e){var n,t,l=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=l){var i=[],r=!0,a=!1;try{for(l=l.call(e);!(r=(n=l.next()).done)&&(i.push(n.value),2!==i.length);r=!0);}catch(e){a=!0,t=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw t}}return i}}(e)||function(e){if(e){if("string"==typeof e)return U(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return U(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),c=o[0],d=o[1],u=c?"/v1/plugins/quality/build-order?package=".concat(encodeURIComponent(c)):"/v1/plugins/quality/build-order",h=(0,a.useData)(u),p=h.data,x=h.isLoading,g=h.isError;if((0,a.useData)("/v1/plugins/quality/cycles").data,x)return(0,l.jsx)(r.UISkeleton,{active:!0,lines:6,style:{padding:"24px 0"}});if(g)return(0,l.jsx)(r.UIAlert,{message:"Failed to load build order",variant:"error",showIcon:!0});var y=[{title:"Layer",dataIndex:"layer",key:"layer",width:100,render:function(e){return(0,l.jsxs)(r.UITag,{color:"blue",children:["Layer ",e]})}},{title:"Packages (can build in parallel)",dataIndex:"packages",key:"packages",render:function(e){return(0,l.jsx)(r.UISpace,{wrap:!0,children:e.map(function(e){return(0,l.jsx)(r.UITag,{children:e},e)})})}}],f=null==p?void 0:p.layers.map(function(e,n){return{layer:n+1,packages:e,key:n}});return(0,l.jsxs)("div",{children:[(null==p?void 0:p.hasCircular)&&(0,l.jsx)(r.UIAlert,{message:"Circular Dependencies Detected!",description:"Found ".concat(p.circular.length," circular dependency cycles. Build order may not be correct."),variant:"error",showIcon:!0,style:{marginBottom:24}}),(0,l.jsx)(r.UICard,{title:"Filter",style:{marginBottom:24},children:(0,l.jsx)(r.UISelect,{style:{width:400},placeholder:"Select package to see its build dependencies",value:c,onChange:function(e){return d(e)},allowClear:!0,showSearch:!0,options:null!=(n=null==p?void 0:p.sorted.map(function(e){return{label:e,value:e}}))?n:[]})}),(0,l.jsx)(r.UICard,{title:"Build Layers (".concat(null!=(t=null==p?void 0:p.layerCount)?t:0," layers, ").concat(null!=(s=null==p?void 0:p.packageCount)?s:0," packages)"),style:{marginBottom:24},children:(0,l.jsx)(r.UITable,{dataSource:null!=f?f:[],columns:y,pagination:!1,expandable:{expandedRowRender:function(e){return(0,l.jsxs)("div",{style:{padding:"8px 0"},children:[(0,l.jsx)("strong",{children:"Packages in this layer:"}),(0,l.jsx)("div",{style:{marginTop:8},children:e.packages.map(function(e){return(0,l.jsx)(r.UITag,{style:{marginBottom:4},children:e},e)})})]})}}})}),(null==p?void 0:p.hasCircular)&&(0,l.jsx)(r.UICard,{title:"Circular Dependencies (".concat(p.circular.length,")"),children:p.circular.map(function(e,n){return(0,l.jsx)(r.UIAlert,{message:"Cycle ".concat(n+1),description:e.join(" → "),variant:"warning",showIcon:!0,style:{marginBottom:12}},n)})})]})}function S(){var e=(0,l.jsx)(r.UITabs,{syncUrl:"search",items:[{key:"overview",label:"Overview",children:(0,l.jsx)(d,{})},{key:"architecture",label:"Architecture",children:(0,l.jsx)(p,{})},{key:"debt",label:"Debt",children:(0,l.jsx)(f,{})},{key:"history",label:"History",children:(0,l.jsx)(v,{})},{key:"build-order",label:"Build Order",children:(0,l.jsx)(k,{})}]});return(0,l.jsx)(r.UIPage,{children:(0,l.jsx)(r.UIPageHeader,{title:"Quality",description:"Code health, architecture analysis, and trend tracking",tabs:e})})}}}]);
@@ -5,7 +5,7 @@
5
5
  "name": "qualityPlugin",
6
6
  "globalName": "qualityPlugin",
7
7
  "buildInfo": {
8
- "buildVersion": "2.105.0",
8
+ "buildVersion": "2.107.0",
9
9
  "buildName": "@kb-labs/quality-entry"
10
10
  },
11
11
  "publicPath": "auto",
@@ -25,15 +25,16 @@
25
25
  },
26
26
  "shared": [
27
27
  {
28
- "id": "qualityPlugin:react-router-dom",
29
- "name": "react-router-dom",
30
- "version": "7.17.0",
28
+ "id": "qualityPlugin:@kb-labs/studio-event-bus",
29
+ "name": "@kb-labs/studio-event-bus",
30
+ "version": "2.107.0",
31
31
  "singleton": true,
32
- "requiredVersion": "^7.0.0",
32
+ "requiredVersion": "^2.0.0",
33
33
  "assets": {
34
34
  "js": {
35
35
  "sync": [
36
- "733.js"
36
+ "50.js",
37
+ "669.js"
37
38
  ],
38
39
  "async": []
39
40
  },
@@ -46,7 +47,7 @@
46
47
  {
47
48
  "id": "qualityPlugin:@kb-labs/studio-ui-core",
48
49
  "name": "@kb-labs/studio-ui-core",
49
- "version": "2.105.0",
50
+ "version": "2.107.0",
50
51
  "singleton": true,
51
52
  "requiredVersion": "^2.0.0",
52
53
  "assets": {
@@ -85,7 +86,7 @@
85
86
  {
86
87
  "id": "qualityPlugin:@kb-labs/studio-hooks",
87
88
  "name": "@kb-labs/studio-hooks",
88
- "version": "2.105.0",
89
+ "version": "2.107.0",
89
90
  "singleton": true,
90
91
  "requiredVersion": "^2.0.0",
91
92
  "assets": {
@@ -105,7 +106,7 @@
105
106
  {
106
107
  "id": "qualityPlugin:@kb-labs/studio-ui-kit",
107
108
  "name": "@kb-labs/studio-ui-kit",
108
- "version": "2.105.0",
109
+ "version": "2.107.0",
109
110
  "singleton": true,
110
111
  "requiredVersion": "^2.0.0",
111
112
  "assets": {
@@ -125,16 +126,15 @@
125
126
  }
126
127
  },
127
128
  {
128
- "id": "qualityPlugin:react-dom",
129
- "name": "react-dom",
129
+ "id": "qualityPlugin:react",
130
+ "name": "react",
130
131
  "version": "19.2.5",
131
132
  "singleton": true,
132
133
  "requiredVersion": "^19.0.0",
133
134
  "assets": {
134
135
  "js": {
135
136
  "sync": [
136
- "165.js",
137
- "546.js"
137
+ "405.js"
138
138
  ],
139
139
  "async": []
140
140
  },
@@ -145,15 +145,16 @@
145
145
  }
146
146
  },
147
147
  {
148
- "id": "qualityPlugin:react",
149
- "name": "react",
148
+ "id": "qualityPlugin:react-dom",
149
+ "name": "react-dom",
150
150
  "version": "19.2.5",
151
151
  "singleton": true,
152
152
  "requiredVersion": "^19.0.0",
153
153
  "assets": {
154
154
  "js": {
155
155
  "sync": [
156
- "405.js"
156
+ "165.js",
157
+ "546.js"
157
158
  ],
158
159
  "async": []
159
160
  },
@@ -184,16 +185,15 @@
184
185
  }
185
186
  },
186
187
  {
187
- "id": "qualityPlugin:@kb-labs/studio-event-bus",
188
- "name": "@kb-labs/studio-event-bus",
189
- "version": "2.105.0",
188
+ "id": "qualityPlugin:react-router-dom",
189
+ "name": "react-router-dom",
190
+ "version": "7.18.1",
190
191
  "singleton": true,
191
- "requiredVersion": "^2.0.0",
192
+ "requiredVersion": "^7.0.0",
192
193
  "assets": {
193
194
  "js": {
194
195
  "sync": [
195
- "50.js",
196
- "669.js"
196
+ "875.js"
197
197
  ],
198
198
  "async": []
199
199
  },
@@ -5,7 +5,7 @@
5
5
  "name": "qualityPlugin",
6
6
  "globalName": "qualityPlugin",
7
7
  "buildInfo": {
8
- "buildVersion": "2.105.0",
8
+ "buildVersion": "2.107.0",
9
9
  "buildName": "@kb-labs/quality-entry"
10
10
  },
11
11
  "publicPath": "auto",
@@ -25,15 +25,16 @@
25
25
  },
26
26
  "shared": [
27
27
  {
28
- "id": "qualityPlugin:react-router-dom",
29
- "name": "react-router-dom",
30
- "version": "7.17.0",
31
- "requiredVersion": "^7.0.0",
28
+ "id": "qualityPlugin:@kb-labs/studio-event-bus",
29
+ "name": "@kb-labs/studio-event-bus",
30
+ "version": "2.107.0",
31
+ "requiredVersion": "^2.0.0",
32
32
  "singleton": true,
33
33
  "assets": {
34
34
  "js": {
35
35
  "sync": [
36
- "733.js"
36
+ "50.js",
37
+ "669.js"
37
38
  ],
38
39
  "async": []
39
40
  },
@@ -48,7 +49,7 @@
48
49
  {
49
50
  "id": "qualityPlugin:@kb-labs/studio-ui-core",
50
51
  "name": "@kb-labs/studio-ui-core",
51
- "version": "2.105.0",
52
+ "version": "2.107.0",
52
53
  "requiredVersion": "^2.0.0",
53
54
  "singleton": true,
54
55
  "assets": {
@@ -91,7 +92,7 @@
91
92
  {
92
93
  "id": "qualityPlugin:@kb-labs/studio-hooks",
93
94
  "name": "@kb-labs/studio-hooks",
94
- "version": "2.105.0",
95
+ "version": "2.107.0",
95
96
  "requiredVersion": "^2.0.0",
96
97
  "singleton": true,
97
98
  "assets": {
@@ -113,7 +114,7 @@
113
114
  {
114
115
  "id": "qualityPlugin:@kb-labs/studio-ui-kit",
115
116
  "name": "@kb-labs/studio-ui-kit",
116
- "version": "2.105.0",
117
+ "version": "2.107.0",
117
118
  "requiredVersion": "^2.0.0",
118
119
  "singleton": true,
119
120
  "assets": {
@@ -135,16 +136,15 @@
135
136
  "usedExports": []
136
137
  },
137
138
  {
138
- "id": "qualityPlugin:react-dom",
139
- "name": "react-dom",
139
+ "id": "qualityPlugin:react",
140
+ "name": "react",
140
141
  "version": "19.2.5",
141
142
  "requiredVersion": "^19.0.0",
142
143
  "singleton": true,
143
144
  "assets": {
144
145
  "js": {
145
146
  "sync": [
146
- "165.js",
147
- "546.js"
147
+ "405.js"
148
148
  ],
149
149
  "async": []
150
150
  },
@@ -153,19 +153,22 @@
153
153
  "async": []
154
154
  }
155
155
  },
156
- "usedIn": [],
156
+ "usedIn": [
157
+ "src/studio/pages/QualityOverview.tsx"
158
+ ],
157
159
  "usedExports": []
158
160
  },
159
161
  {
160
- "id": "qualityPlugin:react",
161
- "name": "react",
162
+ "id": "qualityPlugin:react-dom",
163
+ "name": "react-dom",
162
164
  "version": "19.2.5",
163
165
  "requiredVersion": "^19.0.0",
164
166
  "singleton": true,
165
167
  "assets": {
166
168
  "js": {
167
169
  "sync": [
168
- "405.js"
170
+ "165.js",
171
+ "546.js"
169
172
  ],
170
173
  "async": []
171
174
  },
@@ -174,9 +177,7 @@
174
177
  "async": []
175
178
  }
176
179
  },
177
- "usedIn": [
178
- "src/studio/pages/QualityOverview.tsx"
179
- ],
180
+ "usedIn": [],
180
181
  "usedExports": []
181
182
  },
182
183
  {
@@ -202,16 +203,15 @@
202
203
  "usedExports": []
203
204
  },
204
205
  {
205
- "id": "qualityPlugin:@kb-labs/studio-event-bus",
206
- "name": "@kb-labs/studio-event-bus",
207
- "version": "2.105.0",
208
- "requiredVersion": "^2.0.0",
206
+ "id": "qualityPlugin:react-router-dom",
207
+ "name": "react-router-dom",
208
+ "version": "7.18.1",
209
+ "requiredVersion": "^7.0.0",
209
210
  "singleton": true,
210
211
  "assets": {
211
212
  "js": {
212
213
  "sync": [
213
- "50.js",
214
- "669.js"
214
+ "875.js"
215
215
  ],
216
216
  "async": []
217
217
  },