diff options
| author | Christian Cleberg <[email protected]> | 2026-07-16 10:18:40 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-07-16 10:18:40 -0500 |
| commit | e93972f39150e5e590e49aaf46a369c463277c30 (patch) | |
| tree | 2eb72968c1101155db1ee97e74367eb6491cd86b /HutchSafariExtension/Resources | |
| parent | 9834b780b24a1dd617fa761155712920159f3d8d (diff) | |
| download | hutch-e93972f39150e5e590e49aaf46a369c463277c30.tar.gz hutch-e93972f39150e5e590e49aaf46a369c463277c30.tar.bz2 hutch-e93972f39150e5e590e49aaf46a369c463277c30.zip | |
chore: clear the actionable SonarCloud code smells
- S1871: merge the identical .home / .recentActivity deep-link cases in
RootView — recent activity is a section of Home, not its own screen.
- S1186: comment the two intentionally-empty Cancel buttons
(PatchsetDetailView, TicketDetailView) and the empty URLProtocol
stopLoading override in APICacheTests.
- S108: comment the expected-miss catch block in APICacheTests.
- S1172: rename the unused url parameter in mimeType(for:) to _.
- S4624: extract the nested template literal in the deep-link builders
(background.js, content.js) to a pathSegment variable.
Left as Won't Fix, with reasons: the 35 hardcoded-URI warnings (a
one-forge client and its literal-URL tests), executeCached's 8 params
(38 call sites, no benefit), the forceRefresh S1172 pair (fixed as a
real bug instead), S1481 on ArtifactsView (false positive — $vm.error
is used), and S7785 (top-level await would break a classic content
script).
Diffstat (limited to 'HutchSafariExtension/Resources')
| -rw-r--r-- | HutchSafariExtension/Resources/background.js | 3 | ||||
| -rw-r--r-- | HutchSafariExtension/Resources/content.js | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/HutchSafariExtension/Resources/background.js b/HutchSafariExtension/Resources/background.js index 81bf8b6..0147de0 100644 --- a/HutchSafariExtension/Resources/background.js +++ b/HutchSafariExtension/Resources/background.js @@ -68,7 +68,8 @@ function hutchDeepLinkFor(rawURL) { const path = deepLinkPath(url.hostname, normalizedPath(url.pathname)); const service = deepLinkService(url.hostname, path); - return `hutch://${service}${path ? `/${path}` : ""}${url.search}${url.hash}`; + const pathSegment = path ? `/${path}` : ""; + return `hutch://${service}${pathSegment}${url.search}${url.hash}`; } function showUnsupportedMessage(tabId) { diff --git a/HutchSafariExtension/Resources/content.js b/HutchSafariExtension/Resources/content.js index dba7c5d..e5cb087 100644 --- a/HutchSafariExtension/Resources/content.js +++ b/HutchSafariExtension/Resources/content.js @@ -63,7 +63,8 @@ function hutchDeepLinkForLocation() { const path = hutchDeepLinkPath(location.hostname, hutchNormalizedPath(location.pathname)); const service = hutchDeepLinkService(location.hostname, path); - return `hutch://${service}${path ? `/${path}` : ""}${location.search}${location.hash}`; + const pathSegment = path ? `/${path}` : ""; + return `hutch://${service}${pathSegment}${location.search}${location.hash}`; } function storageGet(defaults) { |
