Renhuai123/ziwei-doushu
紫微斗数开源排盘引擎 — 基于倪海厦《天纪》体系,含完整排盘算法、四化系统、格局知识库、古籍原文数据
TypeScript★ 7,004+546 that day#4 on trending
D47.8/100
Duplication85
1.9% in typescript, tsxDead code20
19.4%Complexity65
32.2% The score is jscpd's own --health model: markup, data and text left out, tests kept. The numbers below are the trending scan's.
1.12%duplicated code · 162 of 14,468 lines
18clones in code
62code files of 108 scanned
1.49%duplicated over all files · 27 clones
Most complex files
Dead code 19.36% unused · 55 findings
- components/StarDetailPanel.tsxunused-file
- lib/ziwei/heming-knowledge.tsunused-file
- components/ShareCardCanvas.tsxunused-file
- lib/ziwei/sihua.tsunused-file
- components/ChartSummary.tsxunused-file
- components/ChatPanel.tsxunused-file
- lib/ziwei/shier-shen.tsunused-file
- lib/ziwei/true-solar-time.tsunused-file
- components/ShareModal.tsxunused-file
- lib/ziwei/yunxian-context.tsunused-file
The code number leaves out tests, fixtures, docs, examples, data files, styles, translations and vendored code.
Largest clones in the code
- 13 lines in 2 placestsx223 tokens
3export default function PrivacyPage() { 4 return ( 5 <> 6 <header style={{ position: 'sticky', top: 0, zIndex: 50, background: 'var(--bg-0)', borderBottom: '1px solid var(--bdr)', padding: '14px 24px', display: … 7 <a href="/" style={{ display: 'inline-flex', alignItems: 'center', gap: '6px', fontSize: '13px', color: 'var(--tx-3)', textDecoration: 'none' }}> 8 <span style={{ fontSize: '16px' }}>‹</span> 9 <span>返回首页</span> 10 </a> 11 <div style={{ width: '1px', height: '20px', background: 'var(--bdr-med)' }} /> 12 <span style={{ fontSize: '12px', color: 'var(--ac)', letterSpacing: '0.2em' }}>紫微命盘</span>First 10 of 13 lines.
- 17 lines in 2 placestsx134 tokens
47 body: JSON.stringify({ chart, messages: [...messages, userMsg] }), 48}); 49 50if (res.status === 404) throw new Error('api-missing'); 51if (!res.ok) throw new Error('请求失败'); 52if (!res.body) throw new Error('无响应流'); 53 54const reader = res.body.getReader(); 55const decoder = new TextDecoder(); 56let assistantText = '';282 body: JSON.stringify({ chart, messages: apiMessages }), 283}); 284if (res.status === 404) throw new Error('api-missing'); 285if (!res.ok) throw new Error('请求失败'); 286if (!res.body) throw new Error('无响应流'); 287 288const reader = res.body.getReader(); 289const decoder = new TextDecoder(); 290let assistantText = ''; 291First 10 of 17 lines, the second copy on the right.
- 12 lines in 2 placestsx103 tokens
125let text = ''; 126 127while (true) { 128 const { done, value } = await reader.read(); 129 if (done) break; 130 const chunk = decoder.decode(value, { stream: true }); 131 for (const line of chunk.split('\n')) { 132 if (!line.startsWith('data: ')) continue; 133 const data = line.slice(6); 134 if (data === '[DONE]') break;First 10 of 12 lines.
7 more
- 6 lines in 3 placestsx51 tokens
- 10 lines in 2 placestsx93 tokens
- 8 lines in 2 placestsx91 tokens
- 16 lines in 2 placestsx89 tokens
- 10 lines in 2 placestsx86 tokens
- 8 lines in 2 placestsx71 tokens
- 6 lines in 2 placestsx69 tokens
Largest clones over all files, tests and data included
- 10 lines in 2 placestypescript435 tokens
33const XLS_CN: readonly (readonly [number, number, number, number, number])[] = [ 34 [1935, 5, 1, 9, 30], [1936, 5, 1, 9, 30], [1937, 5, 1, 9, 30], [1938, 5, 1, 9, 30], 35 [1939, 5, 1, 9, 30], [1940, 5, 1, 9, 30], [1941, 5, 1, 9, 30], [1942, 5, 1, 9, 30], 36 [1943, 5, 1, 9, 30], [1944, 5, 1, 9, 30], [1945, 5, 1, 9, 30], [1946, 5, 1, 9, 30], 37 [1947, 5, 1, 9, 30], [1948, 5, 1, 9, 30], [1949, 5, 1, 9, 30], [1950, 5, 1, 9, 30], 38 [1951, 5, 1, 9, 30], [1952, 3, 1, 10, 31], [1953, 4, 1, 10, 31], [1954, 4, 1, 10, 31], 39 [1955, 5, 1, 9, 30], [1956, 5, 1, 9, 30], [1957, 4, 1, 9, 30], [1958, 4, 1, 9, 30], 40 [1959, 4, 1, 9, 30], [1960, 6, 1, 9, 30], [1961, 6, 1, 9, 30], [1974, 4, 1, 10, 31], 41 [1975, 4, 1, 10, 31], [1979, 7, 1, 9, 30], [1986, 5, 4, 9, 14], [1987, 4, 12, 9, 13], 42 [1988, 4, 10, 9, 11], [1989, 4, 16, 9, 17], [1990, 4, 15, 9, 16], [1991, 4, 14, 9, 15],14const ORACLE_XLS_CN: number[][] = [[1935, 5, 1, 9, 30], [1936, 5, 1, 9, 30], [1937, 5, 1, 9, 30], [1938, 5, 1, 9, 30], [1939, 5, 1, 9, 30], [1940, 5, 1, 9, 30]… - 16 lines in 2 placestypescript421 tokens
141export const SCHOOL_BRIGHTNESS_QS: number[][] = [ 142 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], // [0] 占位 143 [0, 5, 1, 2, 2, 3, 2, 1, 1, 2, 2, 3, 2], // 紫微 144 [0, 1, 7, 3, 2, 4, 5, 1, 7, 3, 2, 4, 5], // 天机 145 [0, 7, 6, 2, 1, 2, 2, 2, 3, 3, 5, 6, 7], // 太阳 146 [0, 2, 1, 3, 4, 1, 5, 2, 1, 3, 4, 1, 5], // 武曲 147 [0, 2, 6, 4, 5, 5, 1, 7, 6, 2, 5, 5, 1], // 天同 148 [0, 5, 4, 1, 5, 4, 7, 5, 4, 1, 5, 4, 7], // 廉贞 149 [0, 1, 1, 1, 3, 1, 3, 2, 1, 3, 2, 1, 3], // 天府 150 [0, 1, 1, 2, 7, 7, 7, 6, 6, 4, 2, 2, 1], // 太阴47SB_QS: [[0,0,0,0,0,0,0,0,0,0,0,0,0],[0,5,1,2,2,3,2,1,1,2,2,3,2],[0,1,7,3,2,4,5,1,7,3,2,4,5],[0,7,6,2,1,2,2,2,3,3,5,6,7],[0,2,1,3,4,1,5,2,1,3,4,1,5],[0,2,6,4,5,…First 10 of 16 lines, the second copy on the right.
- 16 lines in 2 placestypescript421 tokens
160export const SCHOOL_BRIGHTNESS_XD1: number[][] = [ 161 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 162 [0, 5, 1, 1, 2, 3, 2, 1, 1, 2, 2, 3, 2], // 紫微 163 [0, 1, 7, 3, 2, 4, 5, 1, 7, 3, 2, 4, 5], // 天机 164 [0, 7, 6, 2, 1, 2, 2, 1, 3, 4, 5, 7, 7], // 太阳 165 [0, 2, 1, 3, 4, 1, 5, 2, 1, 3, 4, 1, 5], // 武曲 166 [0, 2, 6, 4, 1, 5, 1, 7, 6, 2, 5, 5, 1], // 天同 167 [0, 5, 4, 1, 5, 4, 7, 5, 4, 1, 5, 4, 7], // 廉贞 168 [0, 1, 1, 1, 3, 2, 3, 2, 1, 3, 2, 2, 3], // 天府 169 [0, 1, 1, 6, 7, 7, 7, 7, 5, 4, 2, 2, 1], // 太阴48SB_XD1: [[0,0,0,0,0,0,0,0,0,0,0,0,0],[0,5,1,1,2,3,2,1,1,2,2,3,2],[0,1,7,3,2,4,5,1,7,3,2,4,5],[0,7,6,2,1,2,2,1,3,4,5,7,7],[0,2,1,3,4,1,5,2,1,3,4,1,5],[0,2,6,4,1…First 10 of 16 lines, the second copy on the right.
- 16 lines in 2 placestypescript421 tokens
- 16 lines in 2 placestypescript421 tokens
By format, code only
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| tsx | 30 | 6,681 | 16 | 150 | 2.25% |
| typescript | 32 | 7,787 | 2 | 12 | 0.15% |
By format, all files
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| tsx | 30 | 6,681 | 16 | 150 | 2.25% |
| typescript | 44 | 8,430 | 11 | 133 | 1.58% |
| markdown | 24 | 3,115 | 0 | 0 | 0% |
| css | 1 | 436 | 0 | 0 | 0% |
| yaml | 5 | 176 | 0 | 0 | 0% |
| json | 2 | 78 | 0 | 0 | 0% |
| bash | 1 | 21 | 0 | 0 | 0% |
| text | 1 | 4 | 0 | 0 | 0% |
Trending appearances
| Day | Rank | Stars | Files | Lines | Clones | All files | Code | Health | Commit |
|---|---|---|---|---|---|---|---|---|---|
| Oct 24, 2026 | #4 | 7,004 (+546) | 108 | 18,941 | 27 | 1.49% | 1.12% | D 47.8 | e478393 |
Want this for your own project? Install jscpd and run jscpd ., or measure it the way the baselines were measured.