Skip to content

Commit

Permalink
♻️ refactor: re-order field assignments in CIATriad.tsx and dashboard…
Browse files Browse the repository at this point in the history
….tsx to match confidentiality, integrity, availability order.
  • Loading branch information
caverav committed Nov 4, 2024
1 parent 39d0e64 commit 34223b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions frontend/src/components/dashboard/CIATriad.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ const cvssStringTo = (
L: 1,
} as const;
const substrings = {
integrity: 35,
availability: 39,
confidentiality: 43,
confidentiality: 35,
integrity: 39,
availability: 43,
} as const;
return values[cvssVector.substring(substrings[field], substrings[field] + 1)];
};
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/routes/dashboard/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ const cvssStringTo = (
) => {
const values: Record<string, number> = { H: 2, L: 1, N: 0 } as const;
const substrings = {
integrity: 35,
availability: 39,
confidentiality: 43,
confidentiality: 35,
integrity: 39,
availability: 43,
} as const;
return values[cvssVector.substring(substrings[field], substrings[field] + 1)];
};
Expand Down

0 comments on commit 34223b9

Please sign in to comment.