File tree Expand file tree Collapse file tree
extensions/ql-vscode/src/view/results/locations Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,21 +30,26 @@ export function Location({
3030} : Props ) : JSX . Element {
3131 const resolvableLoc = useMemo ( ( ) => tryGetResolvableLocation ( loc ) , [ loc ] ) ;
3232 const displayLabel = useMemo ( ( ) => convertNonPrintableChars ( label ) , [ label ] ) ;
33+
3334 if ( loc === undefined ) {
3435 return < NonClickableLocation msg = { displayLabel } /> ;
35- } else if ( isStringLoc ( loc ) ) {
36+ }
37+
38+ if ( isStringLoc ( loc ) ) {
3639 return < a href = { loc } > { loc } </ a > ;
37- } else if ( databaseUri === undefined || resolvableLoc === undefined ) {
40+ }
41+
42+ if ( databaseUri === undefined || resolvableLoc === undefined ) {
3843 return < NonClickableLocation msg = { displayLabel } locationHint = { title } /> ;
39- } else {
40- return (
41- < ClickableLocation
42- loc = { resolvableLoc }
43- label = { displayLabel }
44- databaseUri = { databaseUri }
45- title = { title }
46- handleClick = { handleClick }
47- />
48- ) ;
4944 }
45+
46+ return (
47+ < ClickableLocation
48+ loc = { resolvableLoc }
49+ label = { displayLabel }
50+ databaseUri = { databaseUri }
51+ title = { title }
52+ handleClick = { handleClick }
53+ />
54+ ) ;
5055}
Original file line number Diff line number Diff line change @@ -33,7 +33,9 @@ export function SarifLocation({
3333 ) ;
3434 if ( parsedLoc === undefined || "hint" in parsedLoc ) {
3535 return < Location label = { text || "[no location]" } title = { parsedLoc ?. hint } /> ;
36- } else if ( isWholeFileLoc ( parsedLoc ) ) {
36+ }
37+
38+ if ( isWholeFileLoc ( parsedLoc ) ) {
3739 return (
3840 < Location
3941 loc = { parsedLoc }
@@ -43,7 +45,9 @@ export function SarifLocation({
4345 handleClick = { handleClick }
4446 />
4547 ) ;
46- } else if ( isLineColumnLoc ( parsedLoc ) ) {
48+ }
49+
50+ if ( isLineColumnLoc ( parsedLoc ) ) {
4751 return (
4852 < Location
4953 loc = { parsedLoc }
@@ -58,7 +62,7 @@ export function SarifLocation({
5862 handleClick = { handleClick }
5963 />
6064 ) ;
61- } else {
62- return null ;
6365 }
66+
67+ return null ;
6468}
You can’t perform that action at this time.
0 commit comments