Repository navigation
Conversation
| return this.makeMidFilter(); | ||
| } | ||
|
|
||
| return this.makeTrebleFilter(); |
There was a problem hiding this comment.
@fschoelzel, would it be better to return undefined if none of the three cases matches?
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2157 +/- ##
============================
============================
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
I am not a fan of changing 3rd party libraries unless its functionally necessary, because it makes upgrading them more complicated. I am interested in your opinion, @fschoelzel (and also your feedback on which files are unchanged 3rd party libraries and which are customized). |
fea00df to
7edddcb
Compare
I agree, and ideally we should not use obviously unmaintained 3rd party libraries like https://github.com/allensarkisyan/VideoFrame. Either this library should be forked for Kitodo (then I can send a PR for the fork), or we need some alternative. The relevant code has only 271 lines. |
These few lines in VideoFrame.js create 43 Codacy issues! |
7d0e43f to
1312669
Compare
|
Pull request #2161 replaces the complete 3rd party code which was changed here. |
1312669 to
9a06380
Compare
…-return Resolve the high-severity Codacy "consistent-return" findings by ensuring every code path of a function either always returns a value or never does: - DlfMediaPlayer/ThumbnailPreview.js: make onPointerMove() void and give mouseEventToPosition() explicit "return undefined;" guards. - DlfMediaPlayer/VariantGroups.js: return undefined when no active track. - SlubMediaPlayer/SlubMediaPlayer.js: stop returning the unused result of ui.handleEscape() and give prepareScreenshot() "return undefined;". - SlubMediaPlayer/.../RiaaEq.js: rewrite makeFilter() with if/else so the exhaustive NodeKey handling always returns. - SlubMediaPlayer/modals/BookmarkModal.js: add exhaustive switch defaults. - PageView/FulltextControl.js: return undefined when no segment matches. Behavior is preserved (all changes make implicit undefined returns explicit). Verified with ESLint (consistent-return) and tsc --noEmit. Assisted-by: OpenCode / qwen3.8-27b-thinking (Alibaba Cloud) Signed-off-by: Stefan Weil <sw@weilnetz.de>
Codacy's ESLint runs consistent-return with treatUndefinedAsUnspecified,
where "return undefined" counts as a no-value return. The earlier
"if (track) { return ...; } return undefined;" form therefore triggered
"Method 'findActiveGroup' expected a return value".
Assign the group to a variable and return it unconditionally, which keeps
a single value-return (consistent under both rule semantics), preserves
the previous behavior (the group, or undefined), and type-checks (the
Record<GroupKey, Group> index stays a plain GroupKey).
Assisted-by: OpenCode / qwen3.8-27b-thinking (Alibaba Cloud)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Replaces the object-based keyToGroup lookup with a Map so no dynamic property access remains (Codacy detect-object-injection). Assisted-by: OpenCode / qwen3.8-27b-thinking (Alibaba Cloud) Signed-off-by: Stefan Weil <sw@weilnetz.de>
9a06380 to
1d76615
Compare
|
I rebased the PR, fixed a Codacy issue which was marked as new although being old and removed the changes to 3rd party code which will be removed by PR #2161 anyway. |
Resolve the high-severity Codacy "consistent-return" findings by ensuring every code path of a function either always returns a value or never does:
Behavior is preserved (all changes make implicit undefined returns explicit). Verified with ESLint (consistent-return) and tsc --noEmit.
Assisted-by: OpenCode / qwen3.8-27b-thinking (Alibaba Cloud)