We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7f6f9c9 commit 20617d2Copy full SHA for 20617d2
extensions/ql-vscode/src/view/common/CodePaths/CodePaths.tsx
@@ -12,6 +12,12 @@ const ShowPathsLink = styled(VSCodeLink)`
12
cursor: pointer;
13
`;
14
15
+const Label = styled.span`
16
+ color: var(--vscode-descriptionForeground);
17
+ margin-right: 10px;
18
+ margin-left: 10px;
19
+`;
20
+
21
export type CodePathsProps = {
22
codeFlows: CodeFlow[];
23
ruleDescription: string;
@@ -37,9 +43,14 @@ export const CodePaths = ({
37
43
});
38
44
};
39
45
46
+ const allPathLengths = codeFlows
47
+ .map((codeFlow) => codeFlow.threadFlows.length)
48
+ .flat();
49
+ const shortestPath = Math.min(...allPathLengths);
40
50
return (
41
51
<>
42
52
<ShowPathsLink onClick={onShowPathsClick}>Show paths</ShowPathsLink>
53
+ <Label>(Shortest: {shortestPath})</Label>
54
</>
55
);
56
0 commit comments