chore: resolve static-analysis code smells (duplicated literals, naming, parameter grouping) - #567
Merged
Merged
Conversation
…ng, parameter grouping) Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Clears the open, non-gating SonarCloud code smells on
developthat need no real refactor. No behaviour changes; every message/attribute string is byte-identical, only factored.go:S1192duplicated literals (29): unexportedconsts in the owning package (scalarValues*inrecord.go,dotPenWidthOne/dotFillBlack/dotArrowheadNoneindot.go, message fragments inmigrate/*,fuml/emit.go,cmd/sysml/usage.go); two sites reuse existing consts (sysmlPrefix,theValue).godre:S8209(5):el, parent *elementparameter grouping inrdf_in_normative.go,docgen.go.godre:S8193(4): single-useif x := f(); x != ""initialisers inlined.go:S1871(3): three identicalcasebodies inderiveNormativeGraphmerged into one case list.go:S1186(2): the two intentionally empty closures inmontecarlo.gostate why.go:S117/go:S978(7, tests):out_path→outPath,go_→goT,real→realValue/realURI,max→maxF.typescript:S7747(2):for…of routesinstead offor…of [...routes]inautolayout.ts(the loops only mutate the key being visited).java:S1130/S5785/S5778inBinaryStagerTest: drop the unthrowablethrows,assertEquals, one throwing call perassertThrowslambda.Deliberately left open:
go:S3776cognitive complexity,go:S107,godre:S8242,java:S107/S135/S6539— those need real refactors of migrator/export code and are out of scope here. The fourgo:S5332XMI namespace findings stay as marked false positives (semantic namespace IRIs, not endpoints).How it was verified
gofmt -l .empty,go build ./...,go vet ./...,make lint,go test ./...(83 packages ok);npm run typecheckineditors/vscode;mvn testineditors/cameo/tools.Checklist
make testandmake lintpass locallyLink to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/bb80cf5ab72a4155979b6b455ff3b1f8
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/bb80cf5ab72a4155979b6b455ff3b1f8?variant=devin
Requested by: @HuiJun