mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-15 20:05:13 +02:00
style(all): reformat long lines across files for improved code readability and alignment of nested structures
This commit is contained in:
parent
e64fb25dae
commit
9914d26bdf
20 changed files with 229 additions and 182 deletions
|
|
@ -12,7 +12,8 @@ export function useTargets() {
|
|||
export function useAddTarget() {
|
||||
const qc = useQueryClient();
|
||||
return useMutation({
|
||||
mutationFn: (body: { path: string }) => apiPost<TargetView>('/targets', body),
|
||||
mutationFn: (body: { path: string }) =>
|
||||
apiPost<TargetView>('/targets', body),
|
||||
onSuccess: () => {
|
||||
qc.invalidateQueries({ queryKey: ['targets'] });
|
||||
},
|
||||
|
|
|
|||
|
|
@ -25,7 +25,9 @@ function verdictTooltip(verdict: VerifyResult): string {
|
|||
? `Not confirmed after ${verdict.attempts?.length ?? 0} payload attempt(s)`
|
||||
: 'Not confirmed';
|
||||
case 'Unsupported':
|
||||
return reason ? `Unsupported: ${reason}` : 'Dynamic verification not supported';
|
||||
return reason
|
||||
? `Unsupported: ${reason}`
|
||||
: 'Dynamic verification not supported';
|
||||
case 'Inconclusive':
|
||||
return inconclusive_reason
|
||||
? `Inconclusive: ${inconclusive_reason}${detail ? `: ${detail}` : ''}`
|
||||
|
|
|
|||
|
|
@ -55,7 +55,9 @@ export function adaptSurfaceMap(data: SurfaceMap): GraphModel {
|
|||
const detail = nodeDetail(node);
|
||||
const searchText = [title, detail, loc.file].join(' ').toLowerCase();
|
||||
const authBadge =
|
||||
node.node === 'entry_point' && node.auth_required ? ['auth'] : undefined;
|
||||
node.node === 'entry_point' && node.auth_required
|
||||
? ['auth']
|
||||
: undefined;
|
||||
return {
|
||||
key: String(index),
|
||||
rawId: index,
|
||||
|
|
|
|||
|
|
@ -195,10 +195,7 @@ function cfgNodeStyle(
|
|||
}
|
||||
}
|
||||
|
||||
function surfaceNodeStyle(
|
||||
type: string,
|
||||
palette: GraphThemePalette,
|
||||
): NodeStyle {
|
||||
function surfaceNodeStyle(type: string, palette: GraphThemePalette): NodeStyle {
|
||||
switch (type) {
|
||||
case 'EntryPoint':
|
||||
return {
|
||||
|
|
@ -261,7 +258,11 @@ function surfaceNodeStyle(
|
|||
function surfaceEdgeStyle(type: string, palette: GraphThemePalette): EdgeStyle {
|
||||
switch (type) {
|
||||
case 'calls':
|
||||
return { color: withAlpha(palette.textSecondary, 0.78), width: 1.4, dash: [] };
|
||||
return {
|
||||
color: withAlpha(palette.textSecondary, 0.78),
|
||||
width: 1.4,
|
||||
dash: [],
|
||||
};
|
||||
case 'reads_from':
|
||||
return { color: palette.success, width: 1.5, dash: [] };
|
||||
case 'writes_to':
|
||||
|
|
|
|||
|
|
@ -733,7 +733,9 @@ export function DynamicVerdictSection({ verdict }: { verdict: VerifyResult }) {
|
|||
className="dynamic-toolchain-match"
|
||||
title={`Toolchain match: ${verdict.toolchain_match}`}
|
||||
>
|
||||
{verdict.toolchain_match === 'exact' ? 'exact toolchain' : 'approximate toolchain'}
|
||||
{verdict.toolchain_match === 'exact'
|
||||
? 'exact toolchain'
|
||||
: 'approximate toolchain'}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
|
|
@ -763,7 +765,8 @@ export function DynamicVerdictSection({ verdict }: { verdict: VerifyResult }) {
|
|||
)}
|
||||
{verdict.inconclusive_reason && (
|
||||
<div>
|
||||
<strong>Inconclusive reason:</strong> {verdict.inconclusive_reason}
|
||||
<strong>Inconclusive reason:</strong>{' '}
|
||||
{verdict.inconclusive_reason}
|
||||
</div>
|
||||
)}
|
||||
{verdict.detail && (
|
||||
|
|
@ -777,7 +780,10 @@ export function DynamicVerdictSection({ verdict }: { verdict: VerifyResult }) {
|
|||
<strong>Payload attempts:</strong>
|
||||
<ul className="dynamic-attempt-list">
|
||||
{attempts.map((a, i) => (
|
||||
<li key={i} className={`attempt-row ${a.triggered ? 'triggered' : ''}`}>
|
||||
<li
|
||||
key={i}
|
||||
className={`attempt-row ${a.triggered ? 'triggered' : ''}`}
|
||||
>
|
||||
<code>{a.payload_label}</code>
|
||||
<span className="attempt-outcome">
|
||||
{a.triggered
|
||||
|
|
|
|||
|
|
@ -781,7 +781,9 @@ export function FindingsPage() {
|
|||
</td>
|
||||
<td>
|
||||
<VerdictBadge
|
||||
verdict={f.dynamic_verdict ?? f.evidence?.dynamic_verdict}
|
||||
verdict={
|
||||
f.dynamic_verdict ?? f.evidence?.dynamic_verdict
|
||||
}
|
||||
compact
|
||||
/>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -307,8 +307,11 @@ function VerdictDiffSection({ data }: { data: CompareResponse }) {
|
|||
const entries = data.verdict_diff;
|
||||
if (!entries || entries.length === 0) {
|
||||
return (
|
||||
<div style={{ color: 'var(--text-secondary)', padding: 'var(--space-4)' }}>
|
||||
No verdict-level transitions. Both scans share no findings with stable hashes.
|
||||
<div
|
||||
style={{ color: 'var(--text-secondary)', padding: 'var(--space-4)' }}
|
||||
>
|
||||
No verdict-level transitions. Both scans share no findings with stable
|
||||
hashes.
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -333,11 +336,16 @@ function VerdictDiffSection({ data }: { data: CompareResponse }) {
|
|||
<>
|
||||
<span
|
||||
className={`compare-finding-row ${TRANSITION_ROW_CLS[t]}`}
|
||||
style={{ padding: '0 var(--space-2)', borderRadius: 'var(--radius-sm)' }}
|
||||
style={{
|
||||
padding: '0 var(--space-2)',
|
||||
borderRadius: 'var(--radius-sm)',
|
||||
}}
|
||||
>
|
||||
{TRANSITION_LABELS[t]}
|
||||
</span>
|
||||
<span style={{ marginLeft: 'var(--space-2)' }}>({items.length})</span>
|
||||
<span style={{ marginLeft: 'var(--space-2)' }}>
|
||||
({items.length})
|
||||
</span>
|
||||
</>
|
||||
}
|
||||
>
|
||||
|
|
@ -345,7 +353,10 @@ function VerdictDiffSection({ data }: { data: CompareResponse }) {
|
|||
<div
|
||||
key={i}
|
||||
className={`compare-finding-row ${TRANSITION_ROW_CLS[t]}`}
|
||||
style={{ fontFamily: 'var(--font-mono)', fontSize: 'var(--text-xs)' }}
|
||||
style={{
|
||||
fontFamily: 'var(--font-mono)',
|
||||
fontSize: 'var(--text-xs)',
|
||||
}}
|
||||
>
|
||||
<span style={{ color: 'var(--text-tertiary)' }}>
|
||||
{e.path}:{e.line}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,8 @@ function nodeSubtitle(node: SurfaceNode): string {
|
|||
}
|
||||
|
||||
function nodeLocation(node: SurfaceNode): string {
|
||||
const loc = node.node === 'entry_point' ? node.handler_location : node.location;
|
||||
const loc =
|
||||
node.node === 'entry_point' ? node.handler_location : node.location;
|
||||
return `${loc.file}:${loc.line}`;
|
||||
}
|
||||
|
||||
|
|
@ -158,9 +159,12 @@ function NeighborList({
|
|||
{EDGE_KIND_LABELS[e.kind]}
|
||||
</span>
|
||||
<span>
|
||||
{direction === 'in' ? '←' : '→'} <strong>{nodeTitle(other)}</strong>
|
||||
{direction === 'in' ? '←' : '→'}{' '}
|
||||
<strong>{nodeTitle(other)}</strong>
|
||||
</span>
|
||||
<code className="surface-neighbor-edge-loc">{nodeLocation(other)}</code>
|
||||
<code className="surface-neighbor-edge-loc">
|
||||
{nodeLocation(other)}
|
||||
</code>
|
||||
</li>
|
||||
);
|
||||
})}
|
||||
|
|
@ -250,7 +254,11 @@ export function SurfacePage() {
|
|||
<option value="external_service">External services</option>
|
||||
<option value="dangerous_local">Dangerous locals</option>
|
||||
</select>
|
||||
<div className="surface-view-toggle" role="tablist" aria-label="Surface view">
|
||||
<div
|
||||
className="surface-view-toggle"
|
||||
role="tablist"
|
||||
aria-label="Surface view"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
role="tab"
|
||||
|
|
|
|||
|
|
@ -39,7 +39,8 @@ describe('VerdictBadge', () => {
|
|||
render(
|
||||
<VerdictBadge
|
||||
verdict={makeVerdict('PartiallyConfirmed', {
|
||||
detail: 'sink-reachability probe fired but the oracle marker was not observed',
|
||||
detail:
|
||||
'sink-reachability probe fired but the oracle marker was not observed',
|
||||
})}
|
||||
/>,
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue